Skip to content

Commit

Permalink
refactor gmx_energy
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Duane Walker authored and misterbrandonwalker committed Jul 30, 2024
1 parent 23fb84d commit 5cc6dca
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 34 deletions.
29 changes: 0 additions & 29 deletions utils/gmx-energy-plugin/tests/test_gmx_energy.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: 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: [email protected]
author: Brandon Walker, Nazanin Donyapour
contact: [email protected], [email protected]
repository:
documentation:
citation:
Expand Down
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.
Original file line number Diff line number Diff line change
@@ -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@[email protected]"
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}'."

0 comments on commit 5cc6dca

Please sign in to comment.