diff --git a/utils/wget-xlsx-plugin/.bumpversion.cfg b/utils/pre-process/data-download/wget-xlsx-tool/.bumpversion.cfg similarity index 100% rename from utils/wget-xlsx-plugin/.bumpversion.cfg rename to utils/pre-process/data-download/wget-xlsx-tool/.bumpversion.cfg diff --git a/utils/wget-xlsx-plugin/.dockerignore b/utils/pre-process/data-download/wget-xlsx-tool/.dockerignore similarity index 100% rename from utils/wget-xlsx-plugin/.dockerignore rename to utils/pre-process/data-download/wget-xlsx-tool/.dockerignore diff --git a/utils/wget-xlsx-plugin/.gitignore b/utils/pre-process/data-download/wget-xlsx-tool/.gitignore similarity index 100% rename from utils/wget-xlsx-plugin/.gitignore rename to utils/pre-process/data-download/wget-xlsx-tool/.gitignore diff --git a/utils/wget-xlsx-plugin/CHANGELOG.md b/utils/pre-process/data-download/wget-xlsx-tool/CHANGELOG.md similarity index 100% rename from utils/wget-xlsx-plugin/CHANGELOG.md rename to utils/pre-process/data-download/wget-xlsx-tool/CHANGELOG.md diff --git a/utils/wget-xlsx-plugin/README.md b/utils/pre-process/data-download/wget-xlsx-tool/README.md similarity index 70% rename from utils/wget-xlsx-plugin/README.md rename to utils/pre-process/data-download/wget-xlsx-tool/README.md index 79d5bbee..aaba2ae8 100644 --- a/utils/wget-xlsx-plugin/README.md +++ b/utils/pre-process/data-download/wget-xlsx-tool/README.md @@ -9,5 +9,5 @@ This plugin takes 2 input arguments and 1 output argument: | Name | Description | I/O | Type | Default | |---------------|-------------------------|--------|--------|---------| | url | url, Type: string | Input | string | string | -| output_xlsx_path | | Input | string | string | -| output_xlsx_path | | Output | File | File | +| output_xlsx_path | Output xlsx filename | Input | string | string | +| output_xlsx_path | Output xlsx file | Output | File | File | diff --git a/utils/wget-xlsx-plugin/VERSION b/utils/pre-process/data-download/wget-xlsx-tool/VERSION similarity index 100% rename from utils/wget-xlsx-plugin/VERSION rename to utils/pre-process/data-download/wget-xlsx-tool/VERSION diff --git a/utils/wget-xlsx-plugin/ict.yml b/utils/pre-process/data-download/wget-xlsx-tool/ict.yml similarity index 84% rename from utils/wget-xlsx-plugin/ict.yml rename to utils/pre-process/data-download/wget-xlsx-tool/ict.yml index 83a4395f..0863eec9 100644 --- a/utils/wget-xlsx-plugin/ict.yml +++ b/utils/pre-process/data-download/wget-xlsx-tool/ict.yml @@ -1,12 +1,12 @@ specVersion: "0.1.0" name: wget_xlsx version: 0.1.0 -container: wget-xlsx-plugin +container: wget-xlsx-tool entrypoint: title: wget_xlsx description: Download an xlsx 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/wget-xlsx-plugin/pyproject.toml b/utils/pre-process/data-download/wget-xlsx-tool/pyproject.toml similarity index 89% rename from utils/wget-xlsx-plugin/pyproject.toml rename to utils/pre-process/data-download/wget-xlsx-tool/pyproject.toml index c8c68726..748af957 100644 --- a/utils/wget-xlsx-plugin/pyproject.toml +++ b/utils/pre-process/data-download/wget-xlsx-tool/pyproject.toml @@ -7,9 +7,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/wget-xlsx-plugin/tests/__init__.py b/utils/pre-process/data-download/wget-xlsx-tool/tests/__init__.py similarity index 100% rename from utils/wget-xlsx-plugin/tests/__init__.py rename to utils/pre-process/data-download/wget-xlsx-tool/tests/__init__.py diff --git a/utils/pre-process/data-download/wget-xlsx-tool/tests/test_wget_xlsx.py b/utils/pre-process/data-download/wget-xlsx-tool/tests/test_wget_xlsx.py new file mode 100644 index 00000000..24b711d3 --- /dev/null +++ b/utils/pre-process/data-download/wget-xlsx-tool/tests/test_wget_xlsx.py @@ -0,0 +1,28 @@ +"""Test the wget_xlsx tool.""" +from pathlib import Path + +from sophios.api.pythonapi import Step +from sophios.api.pythonapi import Workflow + + +def test_wget_xlsx() -> None: + """Test wget_xlsx.""" + cwl_file_str = "wget_xlsx_0@1@0.cwl" + cwl_file = Path(__file__).resolve().parent.parent / Path(cwl_file_str) + + wget_xlsx = Step(clt_path=cwl_file) + wget_xlsx.url = "https://smacc.mml.unc.edu/ncats_target_based_curated.xlsx" + wget_xlsx.output_xlsx_path = "system.xlsx" + + steps = [wget_xlsx] + filename = "wget_xlsx" + viz = Workflow(steps, filename) + + viz.run() + + outdir = Path("outdir") + files = list(outdir.rglob("system.xlsx")) + + assert ( + files + ), f"The file 'system.xlsx' does not exist in any subdirectory of '{outdir}'." diff --git a/utils/wget-xlsx-plugin/wget_xlsx.cwl b/utils/pre-process/data-download/wget-xlsx-tool/wget_xlsx_0@1@0.cwl similarity index 100% rename from utils/wget-xlsx-plugin/wget_xlsx.cwl rename to utils/pre-process/data-download/wget-xlsx-tool/wget_xlsx_0@1@0.cwl diff --git a/utils/wget-xlsx-plugin/tests/test_wget_xlsx.py b/utils/wget-xlsx-plugin/tests/test_wget_xlsx.py deleted file mode 100644 index 7fc1f8a4..00000000 --- a/utils/wget-xlsx-plugin/tests/test_wget_xlsx.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Tests for wget_xlsx.""" -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_wget_xlsx() -> None: - """Test wget_xlsx.""" - cwl_file_str = "wget_xlsx.cwl" - cwl_file = Path(__file__).resolve().parent.parent / Path(cwl_file_str) - input_to_props = parse_cwl_arguments(cwl_file) - input_to_props["url"] = " https://smacc.mml.unc.edu/ncats_target_based_curated.xlsx" - - input_yaml_path = Path("wget_xlsx.yml") - create_input_yaml(input_to_props, input_yaml_path) - - call_cwltool(cwl_file, input_yaml_path) - - assert Path("system.xlsx").exists()