hpcflow 0.1.15__py3-none-any.whl → 0.2.0a271__py3-none-any.whl
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/__init__.py +2 -11
- hpcflow/__pyinstaller/__init__.py +5 -0
- hpcflow/__pyinstaller/hook-hpcflow.py +40 -0
- hpcflow/_version.py +1 -1
- hpcflow/app.py +43 -0
- hpcflow/cli.py +2 -461
- hpcflow/data/demo_data_manifest/__init__.py +3 -0
- hpcflow/data/demo_data_manifest/demo_data_manifest.json +6 -0
- hpcflow/data/jinja_templates/test/test_template.txt +8 -0
- hpcflow/data/programs/hello_world/README.md +1 -0
- hpcflow/data/programs/hello_world/hello_world.c +87 -0
- hpcflow/data/programs/hello_world/linux/hello_world +0 -0
- hpcflow/data/programs/hello_world/macos/hello_world +0 -0
- hpcflow/data/programs/hello_world/win/hello_world.exe +0 -0
- hpcflow/data/scripts/__init__.py +1 -0
- hpcflow/data/scripts/bad_script.py +2 -0
- hpcflow/data/scripts/demo_task_1_generate_t1_infile_1.py +8 -0
- hpcflow/data/scripts/demo_task_1_generate_t1_infile_2.py +8 -0
- hpcflow/data/scripts/demo_task_1_parse_p3.py +7 -0
- hpcflow/data/scripts/do_nothing.py +2 -0
- hpcflow/data/scripts/env_specifier_test/input_file_generator_pass_env_spec.py +4 -0
- hpcflow/data/scripts/env_specifier_test/main_script_test_pass_env_spec.py +8 -0
- hpcflow/data/scripts/env_specifier_test/output_file_parser_pass_env_spec.py +4 -0
- hpcflow/data/scripts/env_specifier_test/v1/input_file_generator_basic.py +4 -0
- hpcflow/data/scripts/env_specifier_test/v1/main_script_test_direct_in_direct_out.py +7 -0
- hpcflow/data/scripts/env_specifier_test/v1/output_file_parser_basic.py +4 -0
- hpcflow/data/scripts/env_specifier_test/v2/main_script_test_direct_in_direct_out.py +7 -0
- hpcflow/data/scripts/generate_t1_file_01.py +7 -0
- hpcflow/data/scripts/import_future_script.py +7 -0
- hpcflow/data/scripts/input_file_generator_basic.py +3 -0
- hpcflow/data/scripts/input_file_generator_basic_FAIL.py +3 -0
- hpcflow/data/scripts/input_file_generator_test_stdout_stderr.py +8 -0
- hpcflow/data/scripts/main_script_test_direct_in.py +3 -0
- hpcflow/data/scripts/main_script_test_direct_in_direct_out.py +6 -0
- hpcflow/data/scripts/main_script_test_direct_in_direct_out_2.py +6 -0
- hpcflow/data/scripts/main_script_test_direct_in_direct_out_2_fail_allowed.py +6 -0
- hpcflow/data/scripts/main_script_test_direct_in_direct_out_2_fail_allowed_group.py +7 -0
- hpcflow/data/scripts/main_script_test_direct_in_direct_out_3.py +6 -0
- hpcflow/data/scripts/main_script_test_direct_in_direct_out_all_iters_test.py +15 -0
- hpcflow/data/scripts/main_script_test_direct_in_direct_out_env_spec.py +7 -0
- hpcflow/data/scripts/main_script_test_direct_in_direct_out_labels.py +8 -0
- hpcflow/data/scripts/main_script_test_direct_in_group_direct_out_3.py +6 -0
- hpcflow/data/scripts/main_script_test_direct_in_group_one_fail_direct_out_3.py +6 -0
- hpcflow/data/scripts/main_script_test_direct_sub_param_in_direct_out.py +6 -0
- hpcflow/data/scripts/main_script_test_hdf5_in_obj.py +12 -0
- hpcflow/data/scripts/main_script_test_hdf5_in_obj_2.py +12 -0
- hpcflow/data/scripts/main_script_test_hdf5_in_obj_group.py +12 -0
- hpcflow/data/scripts/main_script_test_hdf5_out_obj.py +11 -0
- hpcflow/data/scripts/main_script_test_json_and_direct_in_json_out.py +14 -0
- hpcflow/data/scripts/main_script_test_json_in_json_and_direct_out.py +17 -0
- hpcflow/data/scripts/main_script_test_json_in_json_out.py +14 -0
- hpcflow/data/scripts/main_script_test_json_in_json_out_labels.py +16 -0
- hpcflow/data/scripts/main_script_test_json_in_obj.py +12 -0
- hpcflow/data/scripts/main_script_test_json_out_FAIL.py +3 -0
- hpcflow/data/scripts/main_script_test_json_out_obj.py +10 -0
- hpcflow/data/scripts/main_script_test_json_sub_param_in_json_out_labels.py +16 -0
- hpcflow/data/scripts/main_script_test_shell_env_vars.py +12 -0
- hpcflow/data/scripts/main_script_test_std_out_std_err.py +6 -0
- hpcflow/data/scripts/output_file_parser_basic.py +3 -0
- hpcflow/data/scripts/output_file_parser_basic_FAIL.py +7 -0
- hpcflow/data/scripts/output_file_parser_test_stdout_stderr.py +8 -0
- hpcflow/data/scripts/parse_t1_file_01.py +4 -0
- hpcflow/data/scripts/script_exit_test.py +5 -0
- hpcflow/data/template_components/__init__.py +1 -0
- hpcflow/data/template_components/command_files.yaml +26 -0
- hpcflow/data/template_components/environments.yaml +13 -0
- hpcflow/data/template_components/parameters.yaml +14 -0
- hpcflow/data/template_components/task_schemas.yaml +139 -0
- hpcflow/data/workflows/workflow_1.yaml +5 -0
- hpcflow/examples.ipynb +1037 -0
- hpcflow/sdk/__init__.py +149 -0
- hpcflow/sdk/app.py +4266 -0
- hpcflow/sdk/cli.py +1479 -0
- hpcflow/sdk/cli_common.py +385 -0
- hpcflow/sdk/config/__init__.py +5 -0
- hpcflow/sdk/config/callbacks.py +246 -0
- hpcflow/sdk/config/cli.py +388 -0
- hpcflow/sdk/config/config.py +1410 -0
- hpcflow/sdk/config/config_file.py +501 -0
- hpcflow/sdk/config/errors.py +272 -0
- hpcflow/sdk/config/types.py +150 -0
- hpcflow/sdk/core/__init__.py +38 -0
- hpcflow/sdk/core/actions.py +3857 -0
- hpcflow/sdk/core/app_aware.py +25 -0
- hpcflow/sdk/core/cache.py +224 -0
- hpcflow/sdk/core/command_files.py +814 -0
- hpcflow/sdk/core/commands.py +424 -0
- hpcflow/sdk/core/element.py +2071 -0
- hpcflow/sdk/core/enums.py +221 -0
- hpcflow/sdk/core/environment.py +256 -0
- hpcflow/sdk/core/errors.py +1043 -0
- hpcflow/sdk/core/execute.py +207 -0
- hpcflow/sdk/core/json_like.py +809 -0
- hpcflow/sdk/core/loop.py +1320 -0
- hpcflow/sdk/core/loop_cache.py +282 -0
- hpcflow/sdk/core/object_list.py +933 -0
- hpcflow/sdk/core/parameters.py +3371 -0
- hpcflow/sdk/core/rule.py +196 -0
- hpcflow/sdk/core/run_dir_files.py +57 -0
- hpcflow/sdk/core/skip_reason.py +7 -0
- hpcflow/sdk/core/task.py +3792 -0
- hpcflow/sdk/core/task_schema.py +993 -0
- hpcflow/sdk/core/test_utils.py +538 -0
- hpcflow/sdk/core/types.py +447 -0
- hpcflow/sdk/core/utils.py +1207 -0
- hpcflow/sdk/core/validation.py +87 -0
- hpcflow/sdk/core/values.py +477 -0
- hpcflow/sdk/core/workflow.py +4820 -0
- hpcflow/sdk/core/zarr_io.py +206 -0
- hpcflow/sdk/data/__init__.py +13 -0
- hpcflow/sdk/data/config_file_schema.yaml +34 -0
- hpcflow/sdk/data/config_schema.yaml +260 -0
- hpcflow/sdk/data/environments_spec_schema.yaml +21 -0
- hpcflow/sdk/data/files_spec_schema.yaml +5 -0
- hpcflow/sdk/data/parameters_spec_schema.yaml +7 -0
- hpcflow/sdk/data/task_schema_spec_schema.yaml +3 -0
- hpcflow/sdk/data/workflow_spec_schema.yaml +22 -0
- hpcflow/sdk/demo/__init__.py +3 -0
- hpcflow/sdk/demo/cli.py +242 -0
- hpcflow/sdk/helper/__init__.py +3 -0
- hpcflow/sdk/helper/cli.py +137 -0
- hpcflow/sdk/helper/helper.py +300 -0
- hpcflow/sdk/helper/watcher.py +192 -0
- hpcflow/sdk/log.py +288 -0
- hpcflow/sdk/persistence/__init__.py +18 -0
- hpcflow/sdk/persistence/base.py +2817 -0
- hpcflow/sdk/persistence/defaults.py +6 -0
- hpcflow/sdk/persistence/discovery.py +39 -0
- hpcflow/sdk/persistence/json.py +954 -0
- hpcflow/sdk/persistence/pending.py +948 -0
- hpcflow/sdk/persistence/store_resource.py +203 -0
- hpcflow/sdk/persistence/types.py +309 -0
- hpcflow/sdk/persistence/utils.py +73 -0
- hpcflow/sdk/persistence/zarr.py +2388 -0
- hpcflow/sdk/runtime.py +320 -0
- hpcflow/sdk/submission/__init__.py +3 -0
- hpcflow/sdk/submission/enums.py +70 -0
- hpcflow/sdk/submission/jobscript.py +2379 -0
- hpcflow/sdk/submission/schedulers/__init__.py +281 -0
- hpcflow/sdk/submission/schedulers/direct.py +233 -0
- hpcflow/sdk/submission/schedulers/sge.py +376 -0
- hpcflow/sdk/submission/schedulers/slurm.py +598 -0
- hpcflow/sdk/submission/schedulers/utils.py +25 -0
- hpcflow/sdk/submission/shells/__init__.py +52 -0
- hpcflow/sdk/submission/shells/base.py +229 -0
- hpcflow/sdk/submission/shells/bash.py +504 -0
- hpcflow/sdk/submission/shells/os_version.py +115 -0
- hpcflow/sdk/submission/shells/powershell.py +352 -0
- hpcflow/sdk/submission/submission.py +1402 -0
- hpcflow/sdk/submission/types.py +140 -0
- hpcflow/sdk/typing.py +194 -0
- hpcflow/sdk/utils/arrays.py +69 -0
- hpcflow/sdk/utils/deferred_file.py +55 -0
- hpcflow/sdk/utils/hashing.py +16 -0
- hpcflow/sdk/utils/patches.py +31 -0
- hpcflow/sdk/utils/strings.py +69 -0
- hpcflow/tests/api/test_api.py +32 -0
- hpcflow/tests/conftest.py +123 -0
- hpcflow/tests/data/__init__.py +0 -0
- hpcflow/tests/data/benchmark_N_elements.yaml +6 -0
- hpcflow/tests/data/benchmark_script_runner.yaml +26 -0
- hpcflow/tests/data/multi_path_sequences.yaml +29 -0
- hpcflow/tests/data/workflow_1.json +10 -0
- hpcflow/tests/data/workflow_1.yaml +5 -0
- hpcflow/tests/data/workflow_1_slurm.yaml +8 -0
- hpcflow/tests/data/workflow_1_wsl.yaml +8 -0
- hpcflow/tests/data/workflow_test_run_abort.yaml +42 -0
- hpcflow/tests/jinja_templates/test_jinja_templates.py +161 -0
- hpcflow/tests/programs/test_programs.py +180 -0
- hpcflow/tests/schedulers/direct_linux/test_direct_linux_submission.py +12 -0
- hpcflow/tests/schedulers/sge/test_sge_submission.py +36 -0
- hpcflow/tests/schedulers/slurm/test_slurm_submission.py +14 -0
- hpcflow/tests/scripts/test_input_file_generators.py +282 -0
- hpcflow/tests/scripts/test_main_scripts.py +1361 -0
- hpcflow/tests/scripts/test_non_snippet_script.py +46 -0
- hpcflow/tests/scripts/test_ouput_file_parsers.py +353 -0
- hpcflow/tests/shells/wsl/test_wsl_submission.py +14 -0
- hpcflow/tests/unit/test_action.py +1066 -0
- hpcflow/tests/unit/test_action_rule.py +24 -0
- hpcflow/tests/unit/test_app.py +132 -0
- hpcflow/tests/unit/test_cache.py +46 -0
- hpcflow/tests/unit/test_cli.py +172 -0
- hpcflow/tests/unit/test_command.py +377 -0
- hpcflow/tests/unit/test_config.py +195 -0
- hpcflow/tests/unit/test_config_file.py +162 -0
- hpcflow/tests/unit/test_element.py +666 -0
- hpcflow/tests/unit/test_element_iteration.py +88 -0
- hpcflow/tests/unit/test_element_set.py +158 -0
- hpcflow/tests/unit/test_group.py +115 -0
- hpcflow/tests/unit/test_input_source.py +1479 -0
- hpcflow/tests/unit/test_input_value.py +398 -0
- hpcflow/tests/unit/test_jobscript_unit.py +757 -0
- hpcflow/tests/unit/test_json_like.py +1247 -0
- hpcflow/tests/unit/test_loop.py +2674 -0
- hpcflow/tests/unit/test_meta_task.py +325 -0
- hpcflow/tests/unit/test_multi_path_sequences.py +259 -0
- hpcflow/tests/unit/test_object_list.py +116 -0
- hpcflow/tests/unit/test_parameter.py +243 -0
- hpcflow/tests/unit/test_persistence.py +664 -0
- hpcflow/tests/unit/test_resources.py +243 -0
- hpcflow/tests/unit/test_run.py +286 -0
- hpcflow/tests/unit/test_run_directories.py +29 -0
- hpcflow/tests/unit/test_runtime.py +9 -0
- hpcflow/tests/unit/test_schema_input.py +372 -0
- hpcflow/tests/unit/test_shell.py +129 -0
- hpcflow/tests/unit/test_slurm.py +39 -0
- hpcflow/tests/unit/test_submission.py +502 -0
- hpcflow/tests/unit/test_task.py +2560 -0
- hpcflow/tests/unit/test_task_schema.py +182 -0
- hpcflow/tests/unit/test_utils.py +616 -0
- hpcflow/tests/unit/test_value_sequence.py +549 -0
- hpcflow/tests/unit/test_values.py +91 -0
- hpcflow/tests/unit/test_workflow.py +827 -0
- hpcflow/tests/unit/test_workflow_template.py +186 -0
- hpcflow/tests/unit/utils/test_arrays.py +40 -0
- hpcflow/tests/unit/utils/test_deferred_file_writer.py +34 -0
- hpcflow/tests/unit/utils/test_hashing.py +65 -0
- hpcflow/tests/unit/utils/test_patches.py +5 -0
- hpcflow/tests/unit/utils/test_redirect_std.py +50 -0
- hpcflow/tests/unit/utils/test_strings.py +97 -0
- hpcflow/tests/workflows/__init__.py +0 -0
- hpcflow/tests/workflows/test_directory_structure.py +31 -0
- hpcflow/tests/workflows/test_jobscript.py +355 -0
- hpcflow/tests/workflows/test_run_status.py +198 -0
- hpcflow/tests/workflows/test_skip_downstream.py +696 -0
- hpcflow/tests/workflows/test_submission.py +140 -0
- hpcflow/tests/workflows/test_workflows.py +564 -0
- hpcflow/tests/workflows/test_zip.py +18 -0
- hpcflow/viz_demo.ipynb +6794 -0
- hpcflow-0.2.0a271.dist-info/LICENSE +375 -0
- hpcflow-0.2.0a271.dist-info/METADATA +65 -0
- hpcflow-0.2.0a271.dist-info/RECORD +237 -0
- {hpcflow-0.1.15.dist-info → hpcflow-0.2.0a271.dist-info}/WHEEL +4 -5
- hpcflow-0.2.0a271.dist-info/entry_points.txt +6 -0
- hpcflow/api.py +0 -490
- hpcflow/archive/archive.py +0 -307
- hpcflow/archive/cloud/cloud.py +0 -45
- hpcflow/archive/cloud/errors.py +0 -9
- hpcflow/archive/cloud/providers/dropbox.py +0 -427
- hpcflow/archive/errors.py +0 -5
- hpcflow/base_db.py +0 -4
- hpcflow/config.py +0 -233
- hpcflow/copytree.py +0 -66
- hpcflow/data/examples/_config.yml +0 -14
- hpcflow/data/examples/damask/demo/1.run.yml +0 -4
- hpcflow/data/examples/damask/demo/2.process.yml +0 -29
- hpcflow/data/examples/damask/demo/geom.geom +0 -2052
- hpcflow/data/examples/damask/demo/load.load +0 -1
- hpcflow/data/examples/damask/demo/material.config +0 -185
- hpcflow/data/examples/damask/inputs/geom.geom +0 -2052
- hpcflow/data/examples/damask/inputs/load.load +0 -1
- hpcflow/data/examples/damask/inputs/material.config +0 -185
- hpcflow/data/examples/damask/profiles/_variable_lookup.yml +0 -21
- hpcflow/data/examples/damask/profiles/damask.yml +0 -4
- hpcflow/data/examples/damask/profiles/damask_process.yml +0 -8
- hpcflow/data/examples/damask/profiles/damask_run.yml +0 -5
- hpcflow/data/examples/damask/profiles/default.yml +0 -6
- hpcflow/data/examples/thinking.yml +0 -177
- hpcflow/errors.py +0 -2
- hpcflow/init_db.py +0 -37
- hpcflow/models.py +0 -2595
- hpcflow/nesting.py +0 -9
- hpcflow/profiles.py +0 -455
- hpcflow/project.py +0 -81
- hpcflow/scheduler.py +0 -322
- hpcflow/utils.py +0 -103
- hpcflow/validation.py +0 -166
- hpcflow/variables.py +0 -543
- hpcflow-0.1.15.dist-info/METADATA +0 -168
- hpcflow-0.1.15.dist-info/RECORD +0 -45
- hpcflow-0.1.15.dist-info/entry_points.txt +0 -8
- hpcflow-0.1.15.dist-info/top_level.txt +0 -1
- /hpcflow/{archive → data/jinja_templates}/__init__.py +0 -0
- /hpcflow/{archive/cloud → data/programs}/__init__.py +0 -0
- /hpcflow/{archive/cloud/providers → data/workflows}/__init__.py +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
def main_script_test_direct_in_direct_out_all_iters_test(p1):
|
|
2
|
+
"""Used for a simple loop test, where we pass all iterations to the script."""
|
|
3
|
+
|
|
4
|
+
# sum over all iterations:
|
|
5
|
+
all_p1_vals = []
|
|
6
|
+
for key, val in p1.items():
|
|
7
|
+
print(f"\nkey: {key}")
|
|
8
|
+
print(f"loop_idx: {val['loop_idx']}")
|
|
9
|
+
print(f"value: {val['value']}")
|
|
10
|
+
all_p1_vals.append(val["value"])
|
|
11
|
+
|
|
12
|
+
p1 = sum(all_p1_vals) + 1
|
|
13
|
+
|
|
14
|
+
# return outputs
|
|
15
|
+
return {"p1": p1}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import h5py # type: ignore[import-untyped]
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def main_script_test_hdf5_in_obj_group(_input_files):
|
|
5
|
+
# read inputs
|
|
6
|
+
with h5py.File(_input_files["hdf5"], mode="r") as fh:
|
|
7
|
+
all_a = [p1c_dat.attrs["a"].item() for p1c_dat in fh["p1c"].values()]
|
|
8
|
+
|
|
9
|
+
# process
|
|
10
|
+
p2 = sum(all_a) + 100
|
|
11
|
+
|
|
12
|
+
return {"p2": p2}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import h5py # type: ignore[import-untyped]
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def main_script_test_hdf5_out_obj(p1, _output_files):
|
|
5
|
+
# process
|
|
6
|
+
p1c = {"a": p1 + 100}
|
|
7
|
+
|
|
8
|
+
# write outputs
|
|
9
|
+
with h5py.File(_output_files["hdf5"], mode="w") as fh:
|
|
10
|
+
p1c_grp = fh.create_group("p1c")
|
|
11
|
+
p1c_grp.attrs["a"] = p1c["a"]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def main_script_test_json_and_direct_in_json_out(p2, _input_files, _output_files):
|
|
5
|
+
# read inputs
|
|
6
|
+
with _input_files["json"].open("rt") as fh:
|
|
7
|
+
p1 = int(json.load(fh)["p1"])
|
|
8
|
+
|
|
9
|
+
# process
|
|
10
|
+
p3 = p1 + p2
|
|
11
|
+
|
|
12
|
+
# save outputs
|
|
13
|
+
with _output_files["json"].open("wt") as fh:
|
|
14
|
+
json.dump({"p3": p3}, fh)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def main_script_test_json_in_json_and_direct_out(_input_files, _output_files):
|
|
5
|
+
# read inputs
|
|
6
|
+
with _input_files["json"].open("rt") as fh:
|
|
7
|
+
p1 = int(json.load(fh)["p1"])
|
|
8
|
+
|
|
9
|
+
# process
|
|
10
|
+
p2 = p1 + 100
|
|
11
|
+
p3 = p1 + 200
|
|
12
|
+
|
|
13
|
+
# save outputs
|
|
14
|
+
with _output_files["json"].open("wt") as fh:
|
|
15
|
+
json.dump({"p2": p2}, fh)
|
|
16
|
+
|
|
17
|
+
return {"p3": p3}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def main_script_test_json_in_json_out(_input_files, _output_files):
|
|
5
|
+
# read inputs
|
|
6
|
+
with _input_files["json"].open("rt") as fh:
|
|
7
|
+
p1 = int(json.load(fh)["p1"])
|
|
8
|
+
|
|
9
|
+
# process
|
|
10
|
+
p2 = p1 + 100
|
|
11
|
+
|
|
12
|
+
# save outputs
|
|
13
|
+
with _output_files["json"].open("wt") as fh:
|
|
14
|
+
json.dump({"p2": p2}, fh)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def main_script_test_json_in_json_out_labels(_input_files, _output_files):
|
|
5
|
+
# read inputs
|
|
6
|
+
with _input_files["json"].open("rt") as fh:
|
|
7
|
+
inp_dat = json.load(fh)
|
|
8
|
+
p1_1 = int(inp_dat["p1[one]"])
|
|
9
|
+
p1_2 = int(inp_dat["p1[two]"])
|
|
10
|
+
|
|
11
|
+
# process
|
|
12
|
+
p2 = p1_1 + p1_2
|
|
13
|
+
|
|
14
|
+
# save outputs
|
|
15
|
+
with _output_files["json"].open("wt") as fh:
|
|
16
|
+
json.dump({"p2": p2}, fh)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def main_script_test_json_sub_param_in_json_out_labels(_input_files, _output_files):
|
|
5
|
+
# read inputs
|
|
6
|
+
with _input_files["json"].open("rt") as fh:
|
|
7
|
+
inp_dat = json.load(fh)
|
|
8
|
+
a = int(inp_dat["a"])
|
|
9
|
+
p1_2 = int(inp_dat["p1[two]"])
|
|
10
|
+
|
|
11
|
+
# process
|
|
12
|
+
p2 = a + p1_2
|
|
13
|
+
|
|
14
|
+
# save outputs
|
|
15
|
+
with _output_files["json"].open("wt") as fh:
|
|
16
|
+
json.dump({"p2": p2}, fh)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
def output_file_parser_basic_FAIL(my_output_file):
|
|
2
|
+
# parse the output file, but then delete it, so it cannot be saved (when run with
|
|
3
|
+
# `OFP.save_files=True`):
|
|
4
|
+
with my_output_file.open("r") as fp:
|
|
5
|
+
out = int(fp.read().strip())
|
|
6
|
+
my_output_file.unlink()
|
|
7
|
+
return out
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""YAML files containing built-in template components, used for demonstrations."""
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
- label: t1_infile_1
|
|
2
|
+
name:
|
|
3
|
+
name: t1_infile_1.txt
|
|
4
|
+
doc: Input file for demonstration task t1.
|
|
5
|
+
- label: t1_infile_2
|
|
6
|
+
name:
|
|
7
|
+
name: t1_infile_2.txt
|
|
8
|
+
doc: Input file for demonstration task t1.
|
|
9
|
+
- label: t1_outfile_1
|
|
10
|
+
name:
|
|
11
|
+
name: outfile.txt
|
|
12
|
+
doc: Output file for demonstration task t1.
|
|
13
|
+
- label: lammps_atoms_file
|
|
14
|
+
name:
|
|
15
|
+
name: atoms.lammps
|
|
16
|
+
doc: The file of atoms processed by LAMMPS.
|
|
17
|
+
- label: lammps_input_script
|
|
18
|
+
name:
|
|
19
|
+
name: in.lammps
|
|
20
|
+
doc: The LAMMPS control file.
|
|
21
|
+
- label: lammps_dump_files
|
|
22
|
+
name:
|
|
23
|
+
name: (dump.\d+.txt)
|
|
24
|
+
is_regex: true
|
|
25
|
+
doc: >
|
|
26
|
+
A regular expression pattern that matches all the dump files generated by a LAMMPS run.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
- name: null_env
|
|
2
|
+
doc: The default system environment.
|
|
3
|
+
|
|
4
|
+
- name: python_env
|
|
5
|
+
executables:
|
|
6
|
+
- label: python_script
|
|
7
|
+
instances:
|
|
8
|
+
- command: python <<script_path>> <<args>>
|
|
9
|
+
num_cores: 1
|
|
10
|
+
parallel_mode: null
|
|
11
|
+
doc: |
|
|
12
|
+
An environment for running Python, typically with access to hpcflow and matflow modules and their dependencies.
|
|
13
|
+
May be a Python virtual environment.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# These are only documented when their schemas are documented.
|
|
2
|
+
- type: p1
|
|
3
|
+
- type: p1c
|
|
4
|
+
- type: p2
|
|
5
|
+
- type: p3
|
|
6
|
+
- type: p4
|
|
7
|
+
- type: p5
|
|
8
|
+
- type: orientations
|
|
9
|
+
- type: number_atoms
|
|
10
|
+
- type: box
|
|
11
|
+
- type: atoms
|
|
12
|
+
- type: empirical_potential
|
|
13
|
+
- type: optimised_atoms
|
|
14
|
+
- type: test_UPPER_case
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
- objective: test_t1_bash
|
|
2
|
+
doc: >
|
|
3
|
+
Simple echo test using bash.
|
|
4
|
+
<code>p1</code> → <code>p2</code>
|
|
5
|
+
inputs:
|
|
6
|
+
- parameter: p1
|
|
7
|
+
outputs:
|
|
8
|
+
- parameter: p2
|
|
9
|
+
actions:
|
|
10
|
+
- environments:
|
|
11
|
+
any: null_env
|
|
12
|
+
commands:
|
|
13
|
+
- command: echo "$((<<parameter:p1>> + 100))"
|
|
14
|
+
stdout: <<parameter:p2>>
|
|
15
|
+
|
|
16
|
+
- objective: test_t1_ps
|
|
17
|
+
doc: >
|
|
18
|
+
Simple echo test using powershell.
|
|
19
|
+
<code>p1</code> → <code>p2</code>
|
|
20
|
+
inputs:
|
|
21
|
+
- parameter: p1
|
|
22
|
+
outputs:
|
|
23
|
+
- parameter: p2
|
|
24
|
+
actions:
|
|
25
|
+
- environments:
|
|
26
|
+
any: null_env
|
|
27
|
+
commands:
|
|
28
|
+
- command: Write-Output ((<<parameter:p1>> + 100))
|
|
29
|
+
stdout: <<parameter:p2>>
|
|
30
|
+
|
|
31
|
+
- objective: test_t1_conditional_OS
|
|
32
|
+
doc: >
|
|
33
|
+
Simple echo test showing conditional enactment schemes.
|
|
34
|
+
<code>p1</code> → <code>p2</code>
|
|
35
|
+
inputs:
|
|
36
|
+
- parameter: p1
|
|
37
|
+
outputs:
|
|
38
|
+
- parameter: p2
|
|
39
|
+
actions:
|
|
40
|
+
- rules:
|
|
41
|
+
- path: resources.os_name
|
|
42
|
+
condition: { value.equal_to: posix }
|
|
43
|
+
environments:
|
|
44
|
+
any: null_env
|
|
45
|
+
commands:
|
|
46
|
+
- command: echo "$((<<parameter:p1>> + 100))"
|
|
47
|
+
stdout: <<parameter:p2>>
|
|
48
|
+
- rules:
|
|
49
|
+
- path: resources.os_name
|
|
50
|
+
condition: { value.equal_to: nt }
|
|
51
|
+
environments:
|
|
52
|
+
any: null_env
|
|
53
|
+
commands:
|
|
54
|
+
- command: Write-Output ((<<parameter:p1>> + 100))
|
|
55
|
+
stdout: <<parameter:p2>>
|
|
56
|
+
|
|
57
|
+
- objective: test_t2_bash
|
|
58
|
+
doc: >
|
|
59
|
+
Simple echo test using bash.
|
|
60
|
+
<code>p2</code> → <code>p3</code>
|
|
61
|
+
inputs:
|
|
62
|
+
- parameter: p2
|
|
63
|
+
outputs:
|
|
64
|
+
- parameter: p3
|
|
65
|
+
actions:
|
|
66
|
+
- environments:
|
|
67
|
+
any: null_env
|
|
68
|
+
commands:
|
|
69
|
+
- command: echo "$((<<parameter:p2>> + 100))"
|
|
70
|
+
stdout: <<parameter:p3>>
|
|
71
|
+
|
|
72
|
+
- objective: test_t2_ps
|
|
73
|
+
doc: >
|
|
74
|
+
Simple echo test using powershell.
|
|
75
|
+
<code>p2</code> → <code>p3</code>
|
|
76
|
+
inputs:
|
|
77
|
+
- parameter: p2
|
|
78
|
+
outputs:
|
|
79
|
+
- parameter: p3
|
|
80
|
+
actions:
|
|
81
|
+
- environments:
|
|
82
|
+
any: null_env
|
|
83
|
+
commands:
|
|
84
|
+
- command: Write-Output ((<<parameter:p2>> + 100))
|
|
85
|
+
stdout: <<parameter:p3>>
|
|
86
|
+
|
|
87
|
+
# - objective: demo_task_2
|
|
88
|
+
# inputs:
|
|
89
|
+
# - parameter: p3
|
|
90
|
+
# - parameter: orientations
|
|
91
|
+
# outputs:
|
|
92
|
+
# - parameter: p4
|
|
93
|
+
# actions:
|
|
94
|
+
# - environments:
|
|
95
|
+
# any: demo_env_1
|
|
96
|
+
# commands:
|
|
97
|
+
# - command: >
|
|
98
|
+
# echo "hello! p3=<<parameter:p3>> orientations=<<parameter:orientations>>"
|
|
99
|
+
# output_file_parsers:
|
|
100
|
+
# p4:
|
|
101
|
+
# from_files: [t1_outfile_1]
|
|
102
|
+
|
|
103
|
+
- objective: dummy_task_1
|
|
104
|
+
doc: >
|
|
105
|
+
A dummy task showing simple output file parsing.
|
|
106
|
+
<code>(p1, p2, p5)</code> → <code>p3</code>
|
|
107
|
+
inputs:
|
|
108
|
+
- parameter: p1
|
|
109
|
+
- parameter: p2
|
|
110
|
+
- parameter: p5
|
|
111
|
+
outputs:
|
|
112
|
+
- parameter: p3
|
|
113
|
+
actions:
|
|
114
|
+
- environments:
|
|
115
|
+
any: null_env
|
|
116
|
+
commands:
|
|
117
|
+
- command: >-
|
|
118
|
+
Set-Content -Path .\test.txt -Value "hello from ${pwd}; p1=<<parameter:p1>> p2=<<parameter:p2>> p5=<<parameter:p5>>"
|
|
119
|
+
output_file_parsers:
|
|
120
|
+
p3:
|
|
121
|
+
from_files: [t1_outfile_1]
|
|
122
|
+
|
|
123
|
+
- objective: dummy_task_2
|
|
124
|
+
doc: >
|
|
125
|
+
A dummy task showing simple output file parsing.
|
|
126
|
+
<code>(p3, orientations)</code> → <code>p4</code>
|
|
127
|
+
inputs:
|
|
128
|
+
- parameter: p3
|
|
129
|
+
- parameter: orientations
|
|
130
|
+
outputs:
|
|
131
|
+
- parameter: p4
|
|
132
|
+
actions:
|
|
133
|
+
- environments:
|
|
134
|
+
any: null_env
|
|
135
|
+
commands:
|
|
136
|
+
- command: Start-Sleep 1; echo "p3=<<parameter:p3>>; orientations=<<parameter:orientations>>"
|
|
137
|
+
output_file_parsers:
|
|
138
|
+
p4:
|
|
139
|
+
from_files: [t1_outfile_1]
|