diff --git a/utils/gmx-energy-plugin/tests/test_gmx_energy.py b/utils/gmx-energy-plugin/tests/test_gmx_energy.py deleted file mode 100644 index a7df4eae..00000000 --- a/utils/gmx-energy-plugin/tests/test_gmx_energy.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Tests for gmx_energy.""" -import sys -from pathlib import Path - -current_dir = Path(__file__).resolve().parent -target_dir = current_dir.parent.parent.parent / "cwl_utils" -sys.path.append(str(target_dir)) - -from cwl_utilities import call_cwltool # noqa: E402 -from cwl_utilities import create_input_yaml # noqa: E402 -from cwl_utilities import parse_cwl_arguments # noqa: E402 - - -def test_gmx_energy() -> None: - """Test gmx_energy.""" - cwl_file_str = "gmx_energy.cwl" - cwl_file = Path(__file__).resolve().parent.parent / Path(cwl_file_str) - input_to_props = parse_cwl_arguments(cwl_file) - input_to_props["config"] = '{"terms": ["Potential"]}' - file_path_str = "energy.edr" - file_path = str(Path(__file__).resolve().parent / Path(file_path_str)) - input_to_props["input_energy_path"]["path"] = file_path - - input_yaml_path = Path("gmx_energy.yml") - create_input_yaml(input_to_props, input_yaml_path) - - stdout, stderr = call_cwltool(cwl_file, input_yaml_path) - - assert Path("system.xvg").exists() diff --git a/utils/gmx-energy-plugin/.bumpversion.cfg b/utils/molecular-dynamics/gromacs/gmx-energy-tool/.bumpversion.cfg similarity index 100% rename from utils/gmx-energy-plugin/.bumpversion.cfg rename to utils/molecular-dynamics/gromacs/gmx-energy-tool/.bumpversion.cfg diff --git a/utils/gmx-energy-plugin/.dockerignore b/utils/molecular-dynamics/gromacs/gmx-energy-tool/.dockerignore similarity index 100% rename from utils/gmx-energy-plugin/.dockerignore rename to utils/molecular-dynamics/gromacs/gmx-energy-tool/.dockerignore diff --git a/utils/gmx-energy-plugin/.gitignore b/utils/molecular-dynamics/gromacs/gmx-energy-tool/.gitignore similarity index 100% rename from utils/gmx-energy-plugin/.gitignore rename to utils/molecular-dynamics/gromacs/gmx-energy-tool/.gitignore diff --git a/utils/gmx-energy-plugin/CHANGELOG.md b/utils/molecular-dynamics/gromacs/gmx-energy-tool/CHANGELOG.md similarity index 100% rename from utils/gmx-energy-plugin/CHANGELOG.md rename to utils/molecular-dynamics/gromacs/gmx-energy-tool/CHANGELOG.md diff --git a/utils/gmx-energy-plugin/README.md b/utils/molecular-dynamics/gromacs/gmx-energy-tool/README.md similarity index 100% rename from utils/gmx-energy-plugin/README.md rename to utils/molecular-dynamics/gromacs/gmx-energy-tool/README.md diff --git a/utils/gmx-energy-plugin/VERSION b/utils/molecular-dynamics/gromacs/gmx-energy-tool/VERSION similarity index 100% rename from utils/gmx-energy-plugin/VERSION rename to utils/molecular-dynamics/gromacs/gmx-energy-tool/VERSION diff --git a/utils/gmx-energy-plugin/gmx_energy.cwl b/utils/molecular-dynamics/gromacs/gmx-energy-tool/gmx_energy_0@1@0.cwl similarity index 100% rename from utils/gmx-energy-plugin/gmx_energy.cwl rename to utils/molecular-dynamics/gromacs/gmx-energy-tool/gmx_energy_0@1@0.cwl diff --git a/utils/gmx-energy-plugin/ict.yml b/utils/molecular-dynamics/gromacs/gmx-energy-tool/ict.yml similarity index 94% rename from utils/gmx-energy-plugin/ict.yml rename to utils/molecular-dynamics/gromacs/gmx-energy-tool/ict.yml index 4f310669..0092c67c 100644 --- a/utils/gmx-energy-plugin/ict.yml +++ b/utils/molecular-dynamics/gromacs/gmx-energy-tool/ict.yml @@ -1,12 +1,12 @@ specVersion: "0.1.0" name: gmx_energy version: 0.1.0 -container: gmx-energy-plugin +container: gmx-energy-tool entrypoint: title: gmx_energy description: Wrapper of the GROMACS energy module for extracting energy components from a given GROMACS energy file. -author: Data Scientist -contact: data.scientist@labshare.org +author: Brandon Walker, Nazanin Donyapour +contact: brandon.walker@axleinfo.com, nazanin.donyapour@axleinfo.com repository: documentation: citation: diff --git a/utils/gmx-energy-plugin/pyproject.toml b/utils/molecular-dynamics/gromacs/gmx-energy-tool/pyproject.toml similarity index 92% rename from utils/gmx-energy-plugin/pyproject.toml rename to utils/molecular-dynamics/gromacs/gmx-energy-tool/pyproject.toml index 5a48637c..feccd181 100644 --- a/utils/gmx-energy-plugin/pyproject.toml +++ b/utils/molecular-dynamics/gromacs/gmx-energy-tool/pyproject.toml @@ -8,8 +8,7 @@ readme = "README.md" [tool.poetry.dependencies] python = ">=3.9,<3.12" typer = "^0.7.0" -cwl-utils = "0.33" -cwltool = "3.1.20240404144621" +sophios = "0.1.1" [tool.poetry.group.dev.dependencies] bump2version = "^1.0.1" diff --git a/utils/gmx-energy-plugin/tests/__init__.py b/utils/molecular-dynamics/gromacs/gmx-energy-tool/tests/__init__.py similarity index 100% rename from utils/gmx-energy-plugin/tests/__init__.py rename to utils/molecular-dynamics/gromacs/gmx-energy-tool/tests/__init__.py diff --git a/utils/gmx-energy-plugin/tests/energy.edr b/utils/molecular-dynamics/gromacs/gmx-energy-tool/tests/energy.edr similarity index 100% rename from utils/gmx-energy-plugin/tests/energy.edr rename to utils/molecular-dynamics/gromacs/gmx-energy-tool/tests/energy.edr diff --git a/utils/molecular-dynamics/gromacs/gmx-energy-tool/tests/test_gmx_energy.py b/utils/molecular-dynamics/gromacs/gmx-energy-tool/tests/test_gmx_energy.py new file mode 100644 index 00000000..c4c9dd50 --- /dev/null +++ b/utils/molecular-dynamics/gromacs/gmx-energy-tool/tests/test_gmx_energy.py @@ -0,0 +1,33 @@ +"""Tests for gmx_energy.""" +from pathlib import Path + +from sophios.api.pythonapi import Step +from sophios.api.pythonapi import Workflow + + +def test_gmx_energy() -> None: + """Test gmx_energy.""" + # Define paths + cwl_file_str = "gmx_energy_0@1@0.cwl" + cwl_file = Path(__file__).resolve().parent.parent / Path(cwl_file_str) + input_energy_path = Path(__file__).resolve().parent / Path("energy.edr") + + # Create the CWL step + gmx_energy_step = Step(clt_path=cwl_file) + gmx_energy_step.config = '{"terms": ["Potential"]}' + gmx_energy_step.input_energy_path = input_energy_path + gmx_energy_step.output_xvg_path = "system.xvg" + + # Create the workflow and run it + steps = [gmx_energy_step] + filename = "gmx_energy_workflow" + workflow = Workflow(steps, filename) + workflow.run() + + # Define output directory and check for expected output + outdir = Path("outdir") + files = list(outdir.rglob("system.xvg")) + + assert ( + files + ), f"The file 'system.xvg' does not exist in any subdirectory of '{outdir}'."