hpcflow-new2 0.2.0a108__tar.gz → 0.2.0a109__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/PKG-INFO +1 -1
- hpcflow_new2-0.2.0a109/hpcflow/_version.py +1 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/actions.py +27 -15
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/command_files.py +6 -12
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/task_schema.py +21 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_action.py +37 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/pyproject.toml +2 -2
- hpcflow_new2-0.2.0a108/hpcflow/_version.py +0 -1
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/README.md +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/__pyinstaller/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/__pyinstaller/hook-hpcflow.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/app.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/cli.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/examples.ipynb +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/app.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/cli.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/cli_common.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/config/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/config/callbacks.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/config/cli.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/config/config.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/config/config_file.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/config/errors.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/commands.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/element.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/environment.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/errors.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/json_like.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/loop.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/object_list.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/parallel.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/parameters.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/rule.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/task.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/test_utils.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/utils.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/validation.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/workflow.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/core/zarr_io.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/config_file_schema.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/config_schema.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/environments_spec_schema.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/files_spec_schema.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/parameters_spec_schema.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/task_schema_spec_schema.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/template_components/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/template_components/command_files.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/template_components/environments.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/template_components/parameters.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/template_components/task_schemas.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/workflow_spec_schema.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/cli.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/data/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/data/workflow_1.json +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/data/workflow_1.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/data/workflow_1_slurm.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/data/workflow_1_wsl.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/data/workflow_test_run_abort.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/scripts/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/scripts/demo_task_1_generate_t1_infile_1.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/scripts/demo_task_1_generate_t1_infile_2.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/scripts/demo_task_1_parse_p3.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/scripts/generate_t1_file_01.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/scripts/parse_t1_file_01.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/scripts/test_main_script.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/workflows/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/workflows/workflow_1.yaml +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/helper/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/helper/cli.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/helper/helper.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/helper/watcher.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/log.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/persistence/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/persistence/base.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/persistence/json.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/persistence/pending.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/persistence/store_resource.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/persistence/utils.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/persistence/zarr.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/runtime.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/scripting/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/jobscript.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/jobscript_info.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/schedulers/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/schedulers/direct.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/schedulers/sge.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/schedulers/slurm.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/schedulers/utils.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/shells/__init__.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/shells/base.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/shells/bash.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/shells/os_version.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/shells/powershell.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/submission.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/typing.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/conftest.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/schedulers/direct_linux/test_direct_linux_submission.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/schedulers/slurm/test_slurm_submission.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/shells/wsl/test_wsl_submission.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_action_rule.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_app.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_cli.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_command.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_config.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_config_file.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_element.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_element_iteration.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_element_set.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_input_source.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_input_value.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_json_like.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_loop.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_object_list.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_parameter.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_persistence.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_resources.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_runtime.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_schema_input.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_shell.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_submission.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_task.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_task_schema.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_utils.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_value_sequence.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_workflow.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_workflow_template.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/workflows/test_workflows.py +0 -0
- {hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/viz_demo.ipynb +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.2.0a109"
|
@@ -513,16 +513,14 @@ class ElementActionRun:
|
|
513
513
|
outputs[out_typ] = self.get(f"outputs.{out_typ}")
|
514
514
|
return outputs
|
515
515
|
|
516
|
-
def compose_source(self) -> str:
|
516
|
+
def compose_source(self, snip_path: Path) -> str:
|
517
517
|
"""Generate the file contents of this source."""
|
518
518
|
|
519
|
-
script_name =
|
520
|
-
|
521
|
-
script_path = self.app.scripts.get(script_key)
|
522
|
-
with script_path.open("rt") as fp:
|
519
|
+
script_name = snip_path.name
|
520
|
+
with snip_path.open("rt") as fp:
|
523
521
|
script_str = fp.read()
|
524
522
|
|
525
|
-
is_python =
|
523
|
+
is_python = snip_path.suffix == ".py"
|
526
524
|
if is_python:
|
527
525
|
py_imports = dedent(
|
528
526
|
"""\
|
@@ -639,10 +637,12 @@ class ElementActionRun:
|
|
639
637
|
|
640
638
|
# write the script if it is specified as a app data script, otherwise we assume
|
641
639
|
# the script already exists in the working directory:
|
642
|
-
|
643
|
-
|
640
|
+
snip_path = self.action.get_snippet_script_path(self.action.script)
|
641
|
+
if snip_path:
|
642
|
+
script_name = snip_path.name
|
643
|
+
source_str = self.compose_source(snip_path)
|
644
644
|
with Path(script_name).open("wt", newline="\n") as fp:
|
645
|
-
fp.write(
|
645
|
+
fp.write(source_str)
|
646
646
|
|
647
647
|
def _param_dump_JSON(self, dump_path: Path):
|
648
648
|
with dump_path.open("wt") as fp:
|
@@ -1358,15 +1358,16 @@ class Action(JSONLike):
|
|
1358
1358
|
)
|
1359
1359
|
|
1360
1360
|
@staticmethod
|
1361
|
-
def
|
1361
|
+
def is_snippet_script(script: str) -> bool:
|
1362
|
+
"""Returns True if the provided script string represents a script snippets that is
|
1363
|
+
to be modified before execution (e.g. to receive and provide parameter data)."""
|
1362
1364
|
return script.startswith("<<script:")
|
1363
1365
|
|
1364
1366
|
@classmethod
|
1365
1367
|
def get_script_name(cls, script: str) -> str:
|
1366
1368
|
"""Return the script name."""
|
1367
|
-
if cls.
|
1368
|
-
|
1369
|
-
pattern = r"\<\<script:(?:.*\/)*(.*:?)\>\>"
|
1369
|
+
if cls.is_snippet_script(script):
|
1370
|
+
pattern = r"\<\<script:(?:.*(?:\/|\\))*(.*)\>\>"
|
1370
1371
|
match_obj = re.match(pattern, script)
|
1371
1372
|
return match_obj.group(1)
|
1372
1373
|
else:
|
@@ -1374,8 +1375,8 @@ class Action(JSONLike):
|
|
1374
1375
|
return script
|
1375
1376
|
|
1376
1377
|
@classmethod
|
1377
|
-
def
|
1378
|
-
if not cls.
|
1378
|
+
def get_snippet_script_str(cls, script) -> str:
|
1379
|
+
if not cls.is_snippet_script(script):
|
1379
1380
|
raise ValueError(
|
1380
1381
|
f"Must be an app-data script name (e.g. "
|
1381
1382
|
f"<<script:path/to/app/data/script.py>>), but received {script}"
|
@@ -1384,6 +1385,17 @@ class Action(JSONLike):
|
|
1384
1385
|
match_obj = re.match(pattern, script)
|
1385
1386
|
return match_obj.group(1)
|
1386
1387
|
|
1388
|
+
@classmethod
|
1389
|
+
def get_snippet_script_path(cls, script_path) -> Path:
|
1390
|
+
if not cls.is_snippet_script(script_path):
|
1391
|
+
return False
|
1392
|
+
|
1393
|
+
path = cls.get_snippet_script_str(script_path)
|
1394
|
+
if path in cls.app.scripts:
|
1395
|
+
path = cls.app.scripts.get(path)
|
1396
|
+
|
1397
|
+
return Path(path)
|
1398
|
+
|
1387
1399
|
@staticmethod
|
1388
1400
|
def get_param_dump_file_stem(js_idx: int, js_act_idx: int):
|
1389
1401
|
return f"js_{js_idx}_act_{js_act_idx}_inputs"
|
@@ -134,12 +134,9 @@ class InputFileGenerator(JSONLike):
|
|
134
134
|
def compose_source(self, action) -> str:
|
135
135
|
"""Generate the file contents of this input file generator source."""
|
136
136
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
script_main_func = Path(script_name).stem
|
141
|
-
|
142
|
-
with script_path.open("rt") as fp:
|
137
|
+
snip_path = action.get_snippet_script_path(self.script)
|
138
|
+
script_main_func = snip_path.stem
|
139
|
+
with snip_path.open("rt") as fp:
|
143
140
|
script_str = fp.read()
|
144
141
|
|
145
142
|
main_block = dedent(
|
@@ -261,12 +258,9 @@ class OutputFileParser(JSONLike):
|
|
261
258
|
def compose_source(self, action) -> str:
|
262
259
|
"""Generate the file contents of this output file parser source."""
|
263
260
|
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
script_main_func = Path(script_name).stem
|
268
|
-
|
269
|
-
with script_path.open("rt") as fp:
|
261
|
+
snip_path = action.get_snippet_script_path(self.script)
|
262
|
+
script_main_func = snip_path.stem
|
263
|
+
with snip_path.open("rt") as fp:
|
270
264
|
script_str = fp.read()
|
271
265
|
|
272
266
|
main_block = dedent(
|
@@ -217,6 +217,27 @@ class TaskSchema(JSONLike):
|
|
217
217
|
tab_cmds_i = Table(show_header=False, box=None)
|
218
218
|
tab_cmds_i.add_column(justify="right")
|
219
219
|
tab_cmds_i.add_column()
|
220
|
+
if act.rules:
|
221
|
+
seen_rules = [] # bug: some rules seem to be repeated
|
222
|
+
for act_rule_j in act.rules:
|
223
|
+
if act_rule_j.rule in seen_rules:
|
224
|
+
continue
|
225
|
+
else:
|
226
|
+
seen_rules.append(act_rule_j.rule)
|
227
|
+
r_path = ""
|
228
|
+
if act_rule_j.rule.check_missing:
|
229
|
+
r_cond = f"check missing: {act_rule_j.rule.check_missing}"
|
230
|
+
elif act_rule_j.rule.check_exists:
|
231
|
+
r_cond = f"check exists: {act_rule_j.rule.check_exists}"
|
232
|
+
elif act_rule_j.rule.condition:
|
233
|
+
r_path = f"{act_rule_j.rule.path}: "
|
234
|
+
r_cond = str(act_rule_j.rule.condition.to_json_like())
|
235
|
+
else:
|
236
|
+
continue
|
237
|
+
tab_cmds_i.add_row(
|
238
|
+
"[italic]rule:[/italic]",
|
239
|
+
escape(f"{r_path}{r_cond}"),
|
240
|
+
)
|
220
241
|
tab_cmds_i.add_row(
|
221
242
|
"[italic]scope:[/italic]",
|
222
243
|
escape(act.get_precise_scope().to_string()),
|
@@ -1,3 +1,4 @@
|
|
1
|
+
from pathlib import Path
|
1
2
|
import pytest
|
2
3
|
|
3
4
|
from hpcflow.app import app as hf
|
@@ -215,3 +216,39 @@ def test_get_command_input_types_label_sub_parameters_false_no_sub_param():
|
|
215
216
|
def test_get_command_input_types_label_sub_parameters_false_with_sub_parameter():
|
216
217
|
act = hf.Action(commands=[hf.Command("Write-Output (<<parameter:p1[one].a>> + 100)")])
|
217
218
|
assert act.get_command_input_types(sub_parameters=False) == ("p1[one]",)
|
219
|
+
|
220
|
+
|
221
|
+
def test_get_script_name(null_config):
|
222
|
+
expected = {
|
223
|
+
"<<script:/software/hello.py>>": "hello.py",
|
224
|
+
"<<script:software/hello.py>>": "hello.py",
|
225
|
+
r"<<script:C:\long\path\to\script.py>>": "script.py",
|
226
|
+
"/path/to/script.py": "/path/to/script.py",
|
227
|
+
}
|
228
|
+
for k, v in expected.items():
|
229
|
+
assert hf.Action.get_script_name(k) == v
|
230
|
+
|
231
|
+
|
232
|
+
def test_is_snippet_script(null_config):
|
233
|
+
expected = {
|
234
|
+
"<<script:/software/hello.py>>": True,
|
235
|
+
"<<script:software/hello.py>>": True,
|
236
|
+
r"<<script:C:\long\path\to\script.py>>": True,
|
237
|
+
"/path/to/script.py": False,
|
238
|
+
}
|
239
|
+
for k, v in expected.items():
|
240
|
+
assert hf.Action.is_snippet_script(k) == v
|
241
|
+
|
242
|
+
|
243
|
+
def test_get_snippet_script_path(null_config):
|
244
|
+
expected = {
|
245
|
+
"<<script:/software/hello.py>>": Path("/software/hello.py"),
|
246
|
+
"<<script:software/hello.py>>": Path("software/hello.py"),
|
247
|
+
r"<<script:C:\long\path\to\script.py>>": Path(r"C:\long\path\to\script.py"),
|
248
|
+
}
|
249
|
+
for k, v in expected.items():
|
250
|
+
assert hf.Action.get_snippet_script_path(k) == v
|
251
|
+
|
252
|
+
|
253
|
+
def test_get_snippet_script_path_False(null_config):
|
254
|
+
assert not hf.Action.get_snippet_script_path("/path/to/script.py")
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
[tool.poetry]
|
3
3
|
name = "hpcflow-new2"
|
4
|
-
version = "0.2.
|
4
|
+
version = "0.2.0a109"
|
5
5
|
|
6
6
|
description = "Computational workflow management"
|
7
7
|
authors = ["aplowman <adam.plowman@manchester.ac.uk>"]
|
@@ -68,7 +68,7 @@ hook-dirs = "hpcflow.__pyinstaller:get_hook_dirs"
|
|
68
68
|
|
69
69
|
[tool.commitizen]
|
70
70
|
name = "cz_conventional_commits"
|
71
|
-
version = "0.2.
|
71
|
+
version = "0.2.0a109"
|
72
72
|
tag_format = "v$version"
|
73
73
|
version_files = [
|
74
74
|
"pyproject.toml:version",
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.2.0a108"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/environments_spec_schema.yaml
RENAMED
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/parameters_spec_schema.yaml
RENAMED
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/task_schema_spec_schema.yaml
RENAMED
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/template_components/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/data/workflow_spec_schema.yaml
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/data/workflow_1_slurm.yaml
RENAMED
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/data/workflow_test_run_abort.yaml
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/scripts/demo_task_1_parse_p3.py
RENAMED
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/scripts/generate_t1_file_01.py
RENAMED
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/scripts/parse_t1_file_01.py
RENAMED
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/scripts/test_main_script.py
RENAMED
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/demo/workflows/workflow_1.yaml
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/schedulers/__init__.py
RENAMED
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/schedulers/direct.py
RENAMED
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/schedulers/slurm.py
RENAMED
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/schedulers/utils.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/shells/os_version.py
RENAMED
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/sdk/submission/shells/powershell.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/shells/wsl/test_wsl_submission.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_element_iteration.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hpcflow_new2-0.2.0a108 → hpcflow_new2-0.2.0a109}/hpcflow/tests/unit/test_workflow_template.py
RENAMED
File without changes
|
File without changes
|
File without changes
|