hpcflow-new2 0.2.0a189__py3-none-any.whl → 0.2.0a190__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/__pyinstaller/hook-hpcflow.py +8 -6
- hpcflow/_version.py +1 -1
- hpcflow/app.py +1 -0
- hpcflow/data/scripts/main_script_test_hdf5_in_obj.py +1 -1
- hpcflow/data/scripts/main_script_test_hdf5_out_obj.py +1 -1
- hpcflow/sdk/__init__.py +21 -15
- hpcflow/sdk/app.py +2133 -770
- hpcflow/sdk/cli.py +281 -250
- hpcflow/sdk/cli_common.py +6 -2
- hpcflow/sdk/config/__init__.py +1 -1
- hpcflow/sdk/config/callbacks.py +77 -42
- hpcflow/sdk/config/cli.py +126 -103
- hpcflow/sdk/config/config.py +578 -311
- hpcflow/sdk/config/config_file.py +131 -95
- hpcflow/sdk/config/errors.py +112 -85
- hpcflow/sdk/config/types.py +145 -0
- hpcflow/sdk/core/actions.py +1054 -994
- hpcflow/sdk/core/app_aware.py +24 -0
- hpcflow/sdk/core/cache.py +81 -63
- hpcflow/sdk/core/command_files.py +275 -185
- hpcflow/sdk/core/commands.py +111 -107
- hpcflow/sdk/core/element.py +724 -503
- hpcflow/sdk/core/enums.py +192 -0
- hpcflow/sdk/core/environment.py +74 -93
- hpcflow/sdk/core/errors.py +398 -51
- hpcflow/sdk/core/json_like.py +540 -272
- hpcflow/sdk/core/loop.py +380 -334
- hpcflow/sdk/core/loop_cache.py +160 -43
- hpcflow/sdk/core/object_list.py +370 -207
- hpcflow/sdk/core/parameters.py +728 -600
- hpcflow/sdk/core/rule.py +59 -41
- hpcflow/sdk/core/run_dir_files.py +33 -22
- hpcflow/sdk/core/task.py +1546 -1325
- hpcflow/sdk/core/task_schema.py +240 -196
- hpcflow/sdk/core/test_utils.py +126 -88
- hpcflow/sdk/core/types.py +387 -0
- hpcflow/sdk/core/utils.py +410 -305
- hpcflow/sdk/core/validation.py +82 -9
- hpcflow/sdk/core/workflow.py +1192 -1028
- hpcflow/sdk/core/zarr_io.py +98 -137
- hpcflow/sdk/demo/cli.py +46 -33
- hpcflow/sdk/helper/cli.py +18 -16
- hpcflow/sdk/helper/helper.py +75 -63
- hpcflow/sdk/helper/watcher.py +61 -28
- hpcflow/sdk/log.py +83 -59
- hpcflow/sdk/persistence/__init__.py +8 -31
- hpcflow/sdk/persistence/base.py +988 -586
- hpcflow/sdk/persistence/defaults.py +6 -0
- hpcflow/sdk/persistence/discovery.py +38 -0
- hpcflow/sdk/persistence/json.py +408 -153
- hpcflow/sdk/persistence/pending.py +158 -123
- hpcflow/sdk/persistence/store_resource.py +37 -22
- hpcflow/sdk/persistence/types.py +307 -0
- hpcflow/sdk/persistence/utils.py +14 -11
- hpcflow/sdk/persistence/zarr.py +477 -420
- hpcflow/sdk/runtime.py +44 -41
- hpcflow/sdk/submission/{jobscript_info.py → enums.py} +39 -12
- hpcflow/sdk/submission/jobscript.py +444 -404
- hpcflow/sdk/submission/schedulers/__init__.py +133 -40
- hpcflow/sdk/submission/schedulers/direct.py +97 -71
- hpcflow/sdk/submission/schedulers/sge.py +132 -126
- hpcflow/sdk/submission/schedulers/slurm.py +263 -268
- hpcflow/sdk/submission/schedulers/utils.py +7 -2
- hpcflow/sdk/submission/shells/__init__.py +14 -15
- hpcflow/sdk/submission/shells/base.py +102 -29
- hpcflow/sdk/submission/shells/bash.py +72 -55
- hpcflow/sdk/submission/shells/os_version.py +31 -30
- hpcflow/sdk/submission/shells/powershell.py +37 -29
- hpcflow/sdk/submission/submission.py +203 -257
- hpcflow/sdk/submission/types.py +143 -0
- hpcflow/sdk/typing.py +163 -12
- hpcflow/tests/conftest.py +8 -6
- hpcflow/tests/schedulers/slurm/test_slurm_submission.py +5 -2
- hpcflow/tests/scripts/test_main_scripts.py +60 -30
- hpcflow/tests/shells/wsl/test_wsl_submission.py +6 -4
- hpcflow/tests/unit/test_action.py +86 -75
- hpcflow/tests/unit/test_action_rule.py +9 -4
- hpcflow/tests/unit/test_app.py +13 -6
- hpcflow/tests/unit/test_cli.py +1 -1
- hpcflow/tests/unit/test_command.py +71 -54
- hpcflow/tests/unit/test_config.py +20 -15
- hpcflow/tests/unit/test_config_file.py +21 -18
- hpcflow/tests/unit/test_element.py +58 -62
- hpcflow/tests/unit/test_element_iteration.py +3 -1
- hpcflow/tests/unit/test_element_set.py +29 -19
- hpcflow/tests/unit/test_group.py +4 -2
- hpcflow/tests/unit/test_input_source.py +116 -93
- hpcflow/tests/unit/test_input_value.py +29 -24
- hpcflow/tests/unit/test_json_like.py +44 -35
- hpcflow/tests/unit/test_loop.py +65 -58
- hpcflow/tests/unit/test_object_list.py +17 -12
- hpcflow/tests/unit/test_parameter.py +16 -7
- hpcflow/tests/unit/test_persistence.py +48 -35
- hpcflow/tests/unit/test_resources.py +20 -18
- hpcflow/tests/unit/test_run.py +8 -3
- hpcflow/tests/unit/test_runtime.py +2 -1
- hpcflow/tests/unit/test_schema_input.py +23 -15
- hpcflow/tests/unit/test_shell.py +3 -2
- hpcflow/tests/unit/test_slurm.py +8 -7
- hpcflow/tests/unit/test_submission.py +39 -19
- hpcflow/tests/unit/test_task.py +352 -247
- hpcflow/tests/unit/test_task_schema.py +33 -20
- hpcflow/tests/unit/test_utils.py +9 -11
- hpcflow/tests/unit/test_value_sequence.py +15 -12
- hpcflow/tests/unit/test_workflow.py +114 -83
- hpcflow/tests/unit/test_workflow_template.py +0 -1
- hpcflow/tests/workflows/test_jobscript.py +2 -1
- hpcflow/tests/workflows/test_workflows.py +18 -13
- {hpcflow_new2-0.2.0a189.dist-info → hpcflow_new2-0.2.0a190.dist-info}/METADATA +2 -1
- hpcflow_new2-0.2.0a190.dist-info/RECORD +165 -0
- hpcflow/sdk/core/parallel.py +0 -21
- hpcflow_new2-0.2.0a189.dist-info/RECORD +0 -158
- {hpcflow_new2-0.2.0a189.dist-info → hpcflow_new2-0.2.0a190.dist-info}/LICENSE +0 -0
- {hpcflow_new2-0.2.0a189.dist-info → hpcflow_new2-0.2.0a190.dist-info}/WHEEL +0 -0
- {hpcflow_new2-0.2.0a189.dist-info → hpcflow_new2-0.2.0a190.dist-info}/entry_points.txt +0 -0
hpcflow/sdk/core/validation.py
CHANGED
@@ -2,12 +2,88 @@
|
|
2
2
|
Schema management.
|
3
3
|
"""
|
4
4
|
|
5
|
-
from
|
5
|
+
from __future__ import annotations
|
6
|
+
from collections.abc import Mapping, Sequence
|
7
|
+
from typing import Any, Generic, Protocol, TypeVar
|
8
|
+
from valida import Schema as ValidaSchema # type: ignore
|
9
|
+
from hpcflow.sdk.core.utils import open_text_resource
|
6
10
|
|
7
|
-
|
11
|
+
T = TypeVar("T")
|
8
12
|
|
9
13
|
|
10
|
-
|
14
|
+
class ValidatedData(Protocol, Generic[T]):
|
15
|
+
"""
|
16
|
+
Typed profile of ``valida.ValidatedData``.
|
17
|
+
"""
|
18
|
+
|
19
|
+
@property
|
20
|
+
def is_valid(self) -> bool:
|
21
|
+
...
|
22
|
+
|
23
|
+
def get_failures_string(self) -> str:
|
24
|
+
...
|
25
|
+
|
26
|
+
cast_data: T
|
27
|
+
|
28
|
+
|
29
|
+
class PreparedConditionCallable(Protocol):
|
30
|
+
"""
|
31
|
+
Typed profile of ``valida.PreparedConditionCallable``.
|
32
|
+
"""
|
33
|
+
|
34
|
+
@property
|
35
|
+
def name(self) -> str:
|
36
|
+
...
|
37
|
+
|
38
|
+
@property
|
39
|
+
def args(self) -> tuple[str, ...]:
|
40
|
+
...
|
41
|
+
|
42
|
+
|
43
|
+
class Condition(Protocol):
|
44
|
+
"""
|
45
|
+
Typed profile of ``valida.Condition``.
|
46
|
+
"""
|
47
|
+
|
48
|
+
@property
|
49
|
+
def callable(self) -> PreparedConditionCallable:
|
50
|
+
...
|
51
|
+
|
52
|
+
|
53
|
+
class Rule(Protocol):
|
54
|
+
"""
|
55
|
+
Typed profile of ``valida.Rule``.
|
56
|
+
"""
|
57
|
+
|
58
|
+
@property
|
59
|
+
def condition(self) -> Condition:
|
60
|
+
...
|
61
|
+
|
62
|
+
@property
|
63
|
+
def path(self) -> object:
|
64
|
+
...
|
65
|
+
|
66
|
+
|
67
|
+
class Schema(Protocol):
|
68
|
+
"""
|
69
|
+
Typed profile of ``valida.Schema``.
|
70
|
+
"""
|
71
|
+
|
72
|
+
def validate(self, data: T) -> ValidatedData[T]:
|
73
|
+
...
|
74
|
+
|
75
|
+
@property
|
76
|
+
def rules(self) -> Sequence[Rule]:
|
77
|
+
...
|
78
|
+
|
79
|
+
def add_schema(self, schema: Schema, root_path: Any = None) -> None:
|
80
|
+
...
|
81
|
+
|
82
|
+
def to_tree(self, **kwargs) -> Sequence[Mapping[str, str]]:
|
83
|
+
...
|
84
|
+
|
85
|
+
|
86
|
+
def get_schema(filename) -> Schema:
|
11
87
|
"""
|
12
88
|
Get a valida `Schema` object from the embedded data directory.
|
13
89
|
|
@@ -17,9 +93,6 @@ def get_schema(filename):
|
|
17
93
|
The name of the schema file within the resources package
|
18
94
|
(:py:mod:`hpcflow.sdk.data`).
|
19
95
|
"""
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
fh.close()
|
24
|
-
schema = Schema.from_yaml(schema_dat)
|
25
|
-
return schema
|
96
|
+
with open_text_resource("hpcflow.sdk.data", filename) as fh:
|
97
|
+
schema_dat = fh.read()
|
98
|
+
return ValidaSchema.from_yaml(schema_dat)
|