-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98adcf9
commit 4a1e53f
Showing
9 changed files
with
193 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env python3 | ||
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- | ||
# | ||
# Copyright (c) 2024 Authors and contributors | ||
# | ||
# Released under the GNU Public Licence, v2 or any higher version | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
import re | ||
import sys | ||
|
||
from tester.__main__ import main | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env python3 | ||
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- | ||
# | ||
# Copyright (c) 2024 Authors and contributors | ||
# | ||
# Released under the GNU Public Licence, v2 or any higher version | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
"""Make the tester module available to mdacli.""" | ||
|
||
from .tester_class import Tester # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python | ||
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- | ||
# | ||
# Copyright (c) 2024 Authors and contributors | ||
# (see the AUTHORS.rst file for the full list of names) | ||
# | ||
# Released under the GNU Public Licence, v3 or any higher version | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
"""Test module for mdacli.""" | ||
|
||
from MDAnalysis.analysis.base import AnalysisBase | ||
|
||
from mdacli import cli | ||
|
||
|
||
def main(): | ||
"""Execute main CLI entry point.""" | ||
cli( | ||
name="Tester", | ||
module_list=["tester"], | ||
base_class=AnalysisBase, | ||
version=0.0, | ||
description="test", | ||
ignore_warnings=True, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python3 | ||
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- | ||
# | ||
# Copyright (c) 2024 Authors and contributors | ||
# | ||
# Released under the GNU Public Licence, v2 or any higher version | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
"""Mock module for mdacli to test logging.""" | ||
|
||
import logging | ||
|
||
from MDAnalysis.analysis.base import AnalysisBase | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class Tester(AnalysisBase): | ||
"""Mock class for mdacli. Implements only the minimum requirements. | ||
Currently only logs messages at different levels to check the verbosity and | ||
debug flags in the CLI. | ||
Parameters | ||
---------- | ||
atomgroup : AtomGroup or Universe | ||
""" | ||
|
||
def __init__(self, atomgroup, **kwargs): | ||
"""Initialise the Tester class.""" | ||
super(Tester, self).__init__(atomgroup.universe.trajectory, **kwargs) | ||
logger.info("This is an info message") | ||
logger.warn("This is a warning") | ||
logger.debug("This is a debug message") | ||
|
||
def _prepare(self): | ||
"""Prepare the analysis.""" | ||
pass | ||
|
||
def _single_frame(self): | ||
"""Analyse a single frame.""" | ||
pass | ||
|
||
def _conclude(self): | ||
"""Conclude the analysis.""" | ||
pass |