Skip to content

Commit

Permalink
refactor mdrun (#158)
Browse files Browse the repository at this point in the history
Co-authored-by: Brandon Duane Walker <[email protected]>
  • Loading branch information
misterbrandonwalker and Brandon Duane Walker authored Aug 5, 2024
1 parent b13af23 commit 871e79c
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 34 deletions.
29 changes: 0 additions & 29 deletions utils/mdrun-plugin/tests/test_mdrun.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
specVersion: "0.1.0"
name: mdrun
version: 0.1.0
container: mdrun-plugin
container: mdrun-tool
entrypoint:
title: mdrun
description: Wrapper of the GROMACS mdrun module.
author: Data Scientist
contact: [email protected]
author: Brandon Walker, Nazanin Donyapour
contact: [email protected], [email protected]
repository:
documentation:
citation:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions utils/molecular-dynamics/gromacs/mdrun-tool/tests/test_mdrun.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Tests for mdrun."""
from pathlib import Path

from sophios.api.pythonapi import Step
from sophios.api.pythonapi import Workflow


def test_mdrun() -> None:
"""Test mdrun."""
# Define paths and setup input properties
cwl_file_str = "mdrun_0@[email protected]"
cwl_file = Path(__file__).resolve().parent.parent / Path(cwl_file_str)
file_path_str = "mdrun.tpr"
file_path = Path(__file__).resolve().parent / Path(file_path_str)

# Create the CWL step
mdrun_step = Step(clt_path=cwl_file)
mdrun_step.input_tpr_path = file_path
mdrun_step.output_crd_path = "system.gro"
mdrun_step.output_edr_path = "system.edr"
mdrun_step.output_log_path = "system.log"
mdrun_step.output_trr_path = "system.trr"
mdrun_step.output_xtc_path = "system.xtc"
mdrun_step.output_cpt_path = "system.cpt"
mdrun_step.output_dhdl_path = "system.xvg"

# Create the workflow and run it
steps = [mdrun_step]
filename = "mdrun_workflow"
workflow = Workflow(steps, filename)
workflow.run()

# Define output directory and check for expected output
outdir = Path("outdir")
files = list(outdir.rglob("system.trr"))

assert (
files
), f"The file 'system.trr' does not exist in any subdirectory of '{outdir}'."

0 comments on commit 871e79c

Please sign in to comment.