yuclid 0.1.4__py3-none-any.whl → 0.1.7__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.
- yuclid/__init__.py +1 -1
- yuclid/run.py +64 -56
- {yuclid-0.1.4.dist-info → yuclid-0.1.7.dist-info}/METADATA +1 -1
- yuclid-0.1.7.dist-info/RECORD +11 -0
- yuclid-0.1.4.dist-info/RECORD +0 -11
- {yuclid-0.1.4.dist-info → yuclid-0.1.7.dist-info}/WHEEL +0 -0
- {yuclid-0.1.4.dist-info → yuclid-0.1.7.dist-info}/entry_points.txt +0 -0
- {yuclid-0.1.4.dist-info → yuclid-0.1.7.dist-info}/top_level.txt +0 -0
yuclid/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.1.
|
1
|
+
__version__ = "0.1.7"
|
yuclid/run.py
CHANGED
@@ -13,6 +13,14 @@ def substitute_point_yvars(x, point_map, point_id):
|
|
13
13
|
# replace ${yuclid.<name>} and ${yuclid.@} with point values
|
14
14
|
value_pattern = r"\$\{yuclid\.([a-zA-Z0-9_]+)(?:\.value)?\}"
|
15
15
|
name_pattern = r"\$\{yuclid\.([a-zA-Z0-9_]+)\.name\}"
|
16
|
+
matches = re.findall(name_pattern, x)
|
17
|
+
for name in matches:
|
18
|
+
if name not in point_map:
|
19
|
+
report(
|
20
|
+
LogLevel.FATAL,
|
21
|
+
f"point variable '{name}' not found in point_map",
|
22
|
+
hint=f"available variables: {', '.join(point_map.keys())}",
|
23
|
+
)
|
16
24
|
y = re.sub(value_pattern, lambda m: str(point_map[m.group(1)]["value"]), x)
|
17
25
|
y = re.sub(name_pattern, lambda m: str(point_map[m.group(1)]["name"]), y)
|
18
26
|
if point_id is not None:
|
@@ -32,69 +40,56 @@ def substitute_global_yvars(x, subspace):
|
|
32
40
|
return y
|
33
41
|
|
34
42
|
|
35
|
-
def
|
36
|
-
|
43
|
+
def validate_point_yvars(space, exps):
|
44
|
+
for exp in exps:
|
45
|
+
matches = re.findall(
|
46
|
+
r"\$\{yuclid\.([a-zA-Z0-9_@]+)(?:\.(?:name|value|names|values))?\}", exp
|
47
|
+
)
|
48
|
+
for dim in matches:
|
49
|
+
if dim not in space and dim != "@":
|
50
|
+
report(LogLevel.FATAL, f"invalid variable 'yuclid.{dim}'", exp)
|
37
51
|
|
38
52
|
|
39
|
-
def
|
40
|
-
for
|
41
|
-
|
53
|
+
def validate_global_yvars(space, exps):
|
54
|
+
for exp in exps:
|
55
|
+
exp = str(exp)
|
56
|
+
point_matches = re.findall(
|
57
|
+
r"\$\{yuclid\.([a-zA-Z0-9_@]+)(?:\.(?:name|value))?\}", exp
|
58
|
+
)
|
59
|
+
for dim in point_matches:
|
42
60
|
hint = (
|
43
61
|
"maybe you meant ${{yuclid.{}.names}} or ${{yuclid.{}.values}}?".format(
|
44
|
-
|
62
|
+
dim, dim
|
45
63
|
)
|
46
64
|
)
|
47
65
|
report(
|
48
66
|
LogLevel.FATAL,
|
49
|
-
|
50
|
-
value,
|
67
|
+
"wrong use of yuclid point variable 'yuclid.{}'".format(dim),
|
51
68
|
hint=hint,
|
52
69
|
)
|
70
|
+
global_matches = re.findall(
|
71
|
+
r"\$\{yuclid\.([a-zA-Z0-9_@]+)\.(?:names|values)\}", exp
|
72
|
+
)
|
73
|
+
for dim in global_matches:
|
74
|
+
if dim not in space:
|
75
|
+
breakpoint()
|
76
|
+
report(LogLevel.FATAL, f"invalid variable 'yuclid.{dim}'", exp)
|
53
77
|
|
54
78
|
|
55
|
-
def
|
56
|
-
|
79
|
+
def validate_yvars_in_env(space, env):
|
80
|
+
validate_global_yvars(space, env.values())
|
57
81
|
|
58
|
-
# global setup
|
59
|
-
for command in setup["global"]:
|
60
|
-
# match ${yuclid.<name>}
|
61
|
-
# for all matches, check if the name is in on_dims
|
62
|
-
names = re.findall(get_yvar_pattern(), command)
|
63
|
-
for name in names:
|
64
|
-
hint = (
|
65
|
-
"maybe you meant ${{yuclid.{}.names}} or ${{yuclid.{}.values}}?".format(
|
66
|
-
name, name
|
67
|
-
)
|
68
|
-
)
|
69
|
-
report(
|
70
|
-
LogLevel.FATAL,
|
71
|
-
f"cannot use yuclid point variables in global setup",
|
72
|
-
command,
|
73
|
-
hint=hint,
|
74
|
-
)
|
75
82
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
if name not in on_dims:
|
87
|
-
hint = "available variables: {}".format(
|
88
|
-
", ".join(["${{yuclid.{}}}".format(d) for d in on_dims])
|
89
|
-
)
|
90
|
-
if name == "@":
|
91
|
-
hint = ". ${yuclid.@} is reserved for trial commands"
|
92
|
-
report(
|
93
|
-
LogLevel.FATAL,
|
94
|
-
f"invalid yuclid variable '{name}' in point setup",
|
95
|
-
command,
|
96
|
-
hint=hint,
|
97
|
-
)
|
83
|
+
def validate_yvars_in_setup(space, setup):
|
84
|
+
validate_global_yvars(space, setup["global"])
|
85
|
+
|
86
|
+
for point in setup["point"]:
|
87
|
+
validate_point_yvars(space, point["commands"])
|
88
|
+
|
89
|
+
|
90
|
+
def validate_yvars_in_trials(space, trials):
|
91
|
+
commands = [trial["command"] for trial in trials]
|
92
|
+
validate_point_yvars(space, commands)
|
98
93
|
|
99
94
|
|
100
95
|
def load_json(f):
|
@@ -1158,12 +1153,23 @@ def normalize_point_setup(point_setup, space):
|
|
1158
1153
|
# check validity of 'parallel' fields
|
1159
1154
|
for item in normalized_items:
|
1160
1155
|
parallel = item["parallel"]
|
1161
|
-
if not isinstance(parallel, (bool, list))
|
1162
|
-
|
1156
|
+
if not isinstance(parallel, (bool, list)) or (
|
1157
|
+
isinstance(parallel, list) and any(not isinstance(x, str) for x in parallel)
|
1158
|
+
):
|
1159
|
+
report(
|
1160
|
+
LogLevel.FATAL,
|
1161
|
+
"point setup 'parallel' must be a boolean or a list of strings",
|
1162
|
+
)
|
1163
1163
|
if isinstance(parallel, list):
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1164
|
+
for x in parallel:
|
1165
|
+
if x not in space:
|
1166
|
+
report(
|
1167
|
+
LogLevel.FATAL,
|
1168
|
+
"point setup 'parallel' dimension not in space",
|
1169
|
+
x,
|
1170
|
+
hint="available dimensions: {}".format(", ".join(space.keys())),
|
1171
|
+
)
|
1172
|
+
wrong = [x for x in parallel if x + ".values" not in item["on"]]
|
1167
1173
|
if len(wrong) > 0:
|
1168
1174
|
hint = "available dimensions: {}".format(", ".join(item["on"]))
|
1169
1175
|
report(
|
@@ -1234,8 +1240,10 @@ def launch(args):
|
|
1234
1240
|
validate_settings(data, settings)
|
1235
1241
|
env = build_environment(settings, data)
|
1236
1242
|
order = define_order(settings, data)
|
1237
|
-
validate_yvars_in_env(env)
|
1238
|
-
validate_yvars_in_setup(data)
|
1243
|
+
validate_yvars_in_env(data["space"], data["env"])
|
1244
|
+
validate_yvars_in_setup(data["space"], data["setup"])
|
1245
|
+
validate_yvars_in_trials(data["space"], data["trials"])
|
1246
|
+
|
1239
1247
|
validate_presets(settings, data)
|
1240
1248
|
|
1241
1249
|
if len(settings["presets"]) > 0:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: yuclid
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.7
|
4
4
|
Summary: Run experiments and interactively plot results across combinations of user-specified dimensions
|
5
5
|
Author-email: Federico Sossai <federico.sossai@gmail.com>
|
6
6
|
Project-URL: Homepage, https://github.com/fsossai/yuclid
|
@@ -0,0 +1,11 @@
|
|
1
|
+
yuclid/__init__.py,sha256=GmypIHlw9-BaSEaoucCIwm0ut1DUut0hUvsyTCr17qk,21
|
2
|
+
yuclid/cli.py,sha256=YZzxJty5wlUhCOEELvEcJeQb_lQ1Qc89RG4_s5IyKWU,6224
|
3
|
+
yuclid/log.py,sha256=GR_FVfNroumuonKguAPd6H1rKjxJKRc8tAS2sVNTbzE,1655
|
4
|
+
yuclid/plot.py,sha256=R6IXw6hHuXYFx1MjTKLCIqBfdNORStVEoDidAr-jEuE,29697
|
5
|
+
yuclid/run.py,sha256=0zrQS6b_o-NkB1ijRPkSP4hI_qh3SkenXK2Oy72DK4g,44954
|
6
|
+
yuclid/spread.py,sha256=4Ci3nsu8n_dhG-AK2IWHKRElQ8oaGdw14LrgNu79biM,4938
|
7
|
+
yuclid-0.1.7.dist-info/METADATA,sha256=uV-39IZ2q1xV5dLMu_v99dMfIh9-h_dRKAOlfASMKS4,673
|
8
|
+
yuclid-0.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
9
|
+
yuclid-0.1.7.dist-info/entry_points.txt,sha256=2AvTtyt5iBnjr6HnjqH_3PeSoq9UzIbT92qivmEbOYA,43
|
10
|
+
yuclid-0.1.7.dist-info/top_level.txt,sha256=cL5mb4h_4etwTsqhPvSnoVBXImIzPFGd3rINV1nEjPo,7
|
11
|
+
yuclid-0.1.7.dist-info/RECORD,,
|
yuclid-0.1.4.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
yuclid/__init__.py,sha256=JMD28FXYHc_TM03visyUSd3UA9FZAaJMRStnfZoq50Y,21
|
2
|
-
yuclid/cli.py,sha256=YZzxJty5wlUhCOEELvEcJeQb_lQ1Qc89RG4_s5IyKWU,6224
|
3
|
-
yuclid/log.py,sha256=GR_FVfNroumuonKguAPd6H1rKjxJKRc8tAS2sVNTbzE,1655
|
4
|
-
yuclid/plot.py,sha256=R6IXw6hHuXYFx1MjTKLCIqBfdNORStVEoDidAr-jEuE,29697
|
5
|
-
yuclid/run.py,sha256=s1BGCmYckO2s5TSoKNCb4llZpUouxyooxtVlbqsQNTs,44641
|
6
|
-
yuclid/spread.py,sha256=4Ci3nsu8n_dhG-AK2IWHKRElQ8oaGdw14LrgNu79biM,4938
|
7
|
-
yuclid-0.1.4.dist-info/METADATA,sha256=Qm5Sw-K-L1VGSEJVBwE_C6Ubjp6JNa55SiH7snsWdPM,673
|
8
|
-
yuclid-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
9
|
-
yuclid-0.1.4.dist-info/entry_points.txt,sha256=2AvTtyt5iBnjr6HnjqH_3PeSoq9UzIbT92qivmEbOYA,43
|
10
|
-
yuclid-0.1.4.dist-info/top_level.txt,sha256=cL5mb4h_4etwTsqhPvSnoVBXImIzPFGd3rINV1nEjPo,7
|
11
|
-
yuclid-0.1.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|