hpcflow-new2 0.2.0a50__py3-none-any.whl → 0.2.0a52__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/_version.py +1 -1
- hpcflow/sdk/__init__.py +1 -1
- hpcflow/sdk/api.py +1 -1
- hpcflow/sdk/app.py +20 -11
- hpcflow/sdk/cli.py +34 -59
- hpcflow/sdk/core/__init__.py +13 -1
- hpcflow/sdk/core/actions.py +235 -126
- hpcflow/sdk/core/command_files.py +32 -24
- hpcflow/sdk/core/element.py +110 -114
- hpcflow/sdk/core/errors.py +57 -0
- hpcflow/sdk/core/loop.py +18 -34
- hpcflow/sdk/core/parameters.py +5 -3
- hpcflow/sdk/core/task.py +135 -131
- hpcflow/sdk/core/task_schema.py +11 -4
- hpcflow/sdk/core/utils.py +110 -2
- hpcflow/sdk/core/workflow.py +964 -676
- hpcflow/sdk/data/template_components/environments.yaml +0 -44
- hpcflow/sdk/data/template_components/task_schemas.yaml +52 -10
- hpcflow/sdk/persistence/__init__.py +21 -33
- hpcflow/sdk/persistence/base.py +1340 -458
- hpcflow/sdk/persistence/json.py +424 -546
- hpcflow/sdk/persistence/pending.py +563 -0
- hpcflow/sdk/persistence/store_resource.py +131 -0
- hpcflow/sdk/persistence/utils.py +57 -0
- hpcflow/sdk/persistence/zarr.py +852 -841
- hpcflow/sdk/submission/jobscript.py +133 -112
- hpcflow/sdk/submission/shells/bash.py +62 -16
- hpcflow/sdk/submission/shells/powershell.py +87 -16
- hpcflow/sdk/submission/submission.py +59 -35
- hpcflow/tests/unit/test_element.py +4 -9
- hpcflow/tests/unit/test_persistence.py +218 -0
- hpcflow/tests/unit/test_task.py +11 -12
- hpcflow/tests/unit/test_utils.py +82 -0
- hpcflow/tests/unit/test_workflow.py +3 -1
- {hpcflow_new2-0.2.0a50.dist-info → hpcflow_new2-0.2.0a52.dist-info}/METADATA +3 -1
- {hpcflow_new2-0.2.0a50.dist-info → hpcflow_new2-0.2.0a52.dist-info}/RECORD +38 -34
- {hpcflow_new2-0.2.0a50.dist-info → hpcflow_new2-0.2.0a52.dist-info}/WHEEL +0 -0
- {hpcflow_new2-0.2.0a50.dist-info → hpcflow_new2-0.2.0a52.dist-info}/entry_points.txt +0 -0
@@ -1,45 +1 @@
|
|
1
|
-
- name: demo_env_1
|
2
|
-
executables:
|
3
|
-
- label: demo
|
4
|
-
instances:
|
5
|
-
- command: matflow --config-dir="../" demo-software
|
6
|
-
num_cores: 1
|
7
|
-
parallel_mode: null
|
8
|
-
- label: python
|
9
|
-
instances:
|
10
|
-
- command: python
|
11
|
-
num_cores: 1
|
12
|
-
parallel_mode: null
|
13
|
-
|
14
1
|
- name: null_env
|
15
|
-
|
16
|
-
- name: lammps_parse_env
|
17
|
-
specifiers:
|
18
|
-
lammps_version: 1.2
|
19
|
-
setup: |
|
20
|
-
conda activate lammps_parse_env
|
21
|
-
executables:
|
22
|
-
- label: python
|
23
|
-
instances:
|
24
|
-
- command: python
|
25
|
-
num_cores: 1
|
26
|
-
parallel_mode: null
|
27
|
-
|
28
|
-
- name: lammps_env
|
29
|
-
specifiers:
|
30
|
-
lammps_version: 1.3
|
31
|
-
gcc_version: 3.0231.321+1
|
32
|
-
executables:
|
33
|
-
- label: lammps
|
34
|
-
instances:
|
35
|
-
- command: lmp_serial
|
36
|
-
num_cores: 1
|
37
|
-
parallel_mode: null
|
38
|
-
|
39
|
-
- name: damask_parse_env
|
40
|
-
executables:
|
41
|
-
- label: python
|
42
|
-
instances:
|
43
|
-
- command: python
|
44
|
-
num_cores: 1
|
45
|
-
parallel_mode: null
|
@@ -1,4 +1,4 @@
|
|
1
|
-
- objective:
|
1
|
+
- objective: test_t1_bash
|
2
2
|
inputs:
|
3
3
|
- parameter: p1
|
4
4
|
outputs:
|
@@ -12,23 +12,65 @@
|
|
12
12
|
- command: echo "$((<<parameter:p1>> + 100))"
|
13
13
|
stdout: <<parameter:p2>>
|
14
14
|
|
15
|
-
- objective:
|
15
|
+
- objective: test_t1_ps
|
16
16
|
inputs:
|
17
|
+
- parameter: p1
|
18
|
+
outputs:
|
19
|
+
- parameter: p2
|
20
|
+
actions:
|
21
|
+
- environments:
|
22
|
+
- scope:
|
23
|
+
type: any
|
24
|
+
environment: null_env
|
25
|
+
commands:
|
26
|
+
- command: Write-Output ((<<parameter:p1>> + 100))
|
27
|
+
stdout: <<parameter:p2>>
|
28
|
+
|
29
|
+
- objective: test_t2_bash
|
30
|
+
inputs:
|
31
|
+
- parameter: p2
|
32
|
+
outputs:
|
17
33
|
- parameter: p3
|
18
|
-
|
34
|
+
actions:
|
35
|
+
- environments:
|
36
|
+
- scope:
|
37
|
+
type: any
|
38
|
+
environment: null_env
|
39
|
+
commands:
|
40
|
+
- command: echo "$((<<parameter:p2>> + 100))"
|
41
|
+
stdout: <<parameter:p3>>
|
42
|
+
|
43
|
+
- objective: test_t2_ps
|
44
|
+
inputs:
|
45
|
+
- parameter: p2
|
19
46
|
outputs:
|
20
|
-
- parameter:
|
47
|
+
- parameter: p3
|
21
48
|
actions:
|
22
49
|
- environments:
|
23
50
|
- scope:
|
24
51
|
type: any
|
25
|
-
environment:
|
52
|
+
environment: null_env
|
26
53
|
commands:
|
27
|
-
- command:
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
54
|
+
- command: Write-Output ((<<parameter:p2>> + 100))
|
55
|
+
stdout: <<parameter:p3>>
|
56
|
+
|
57
|
+
# - objective: demo_task_2
|
58
|
+
# inputs:
|
59
|
+
# - parameter: p3
|
60
|
+
# - parameter: orientations
|
61
|
+
# outputs:
|
62
|
+
# - parameter: p4
|
63
|
+
# actions:
|
64
|
+
# - environments:
|
65
|
+
# - scope:
|
66
|
+
# type: any
|
67
|
+
# environment: demo_env_1
|
68
|
+
# commands:
|
69
|
+
# - command: >
|
70
|
+
# echo "hello! p3=<<parameter:p3>> orientations=<<parameter:orientations>>"
|
71
|
+
# output_file_parsers:
|
72
|
+
# p4:
|
73
|
+
# from_files: [t1_outfile_1]
|
32
74
|
|
33
75
|
- objective: dummy_task_1
|
34
76
|
inputs:
|
@@ -1,43 +1,31 @@
|
|
1
|
+
import copy
|
1
2
|
from pathlib import Path
|
2
3
|
import random
|
3
4
|
import string
|
4
|
-
|
5
|
+
import time
|
6
|
+
from typing import Type, Union
|
5
7
|
|
6
|
-
from
|
8
|
+
from reretry import retry
|
7
9
|
|
8
|
-
from .base import PersistentStore
|
9
|
-
from .json import JSONPersistentStore
|
10
|
-
from .zarr import ZarrPersistentStore
|
10
|
+
from hpcflow.sdk.persistence.base import PersistentStore
|
11
|
+
from hpcflow.sdk.persistence.json import JSONPersistentStore
|
12
|
+
from hpcflow.sdk.persistence.zarr import ZarrPersistentStore, ZarrZipPersistentStore
|
11
13
|
|
12
|
-
|
14
|
+
ALL_STORE_CLS = {
|
15
|
+
"zarr": ZarrPersistentStore,
|
16
|
+
"zip": ZarrZipPersistentStore,
|
17
|
+
"json": JSONPersistentStore,
|
18
|
+
# "json-single": JSONPersistentStore, # TODO
|
19
|
+
}
|
13
20
|
DEFAULT_STORE_FORMAT = "zarr"
|
21
|
+
ALL_STORE_FORMATS = tuple(ALL_STORE_CLS.keys())
|
22
|
+
ALL_CREATE_STORE_FORMATS = tuple(
|
23
|
+
k for k, v in ALL_STORE_CLS.items() if v._features.create
|
24
|
+
)
|
14
25
|
|
15
26
|
|
16
|
-
def
|
17
|
-
|
18
|
-
return
|
19
|
-
|
20
|
-
return JSONPersistentStore
|
21
|
-
else:
|
22
|
-
raise WorkflowNotFoundError(
|
23
|
-
f"No workflow of a known store type found at path: {workflow_path!r}."
|
24
|
-
)
|
25
|
-
|
26
|
-
|
27
|
-
def store_cls_from_str(store_format: str) -> Type[PersistentStore]:
|
28
|
-
if store_format == "zarr":
|
29
|
-
return ZarrPersistentStore
|
30
|
-
elif store_format == "json":
|
31
|
-
return JSONPersistentStore
|
32
|
-
else:
|
27
|
+
def store_cls_from_str_NEW(store_format: str) -> Type[PersistentStore]:
|
28
|
+
try:
|
29
|
+
return ALL_STORE_CLS[store_format]
|
30
|
+
except KeyError:
|
33
31
|
raise ValueError(f"Store format {store_format!r} not known.")
|
34
|
-
|
35
|
-
|
36
|
-
@dropbox_permission_err_retry
|
37
|
-
def temporary_workflow_rename(path):
|
38
|
-
"""Rename an existing same-path workflow directory so we can restore it if workflow
|
39
|
-
creation fails"""
|
40
|
-
temp_ext = "".join(random.choices(string.ascii_letters, k=10))
|
41
|
-
replaced_dir = path.with_suffix(f"{path.suffix}.{temp_ext}")
|
42
|
-
path.rename(replaced_dir)
|
43
|
-
return replaced_dir
|