math-spec-mapping 0.3.9.1__tar.gz → 0.3.10__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {math_spec_mapping-0.3.9.1/src/math_spec_mapping.egg-info → math_spec_mapping-0.3.10}/PKG-INFO +1 -1
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/pyproject.toml +1 -1
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/MathSpec.py +18 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Metric.py +1 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/metrics.py +11 -1
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/spaces.py +4 -2
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10/src/math_spec_mapping.egg-info}/PKG-INFO +1 -1
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/LICENSE +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/README.md +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/setup.cfg +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/ActionTransmissionChannel.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Block.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/BoundaryAction.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/ControlAction.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Entity.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Mechanism.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Parameter.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Policy.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Space.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/State.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/StateUpdateTransmissionChannel.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/StatefulMetric.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Type.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/__init__.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Convenience/__init__.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Convenience/documentation.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Convenience/starter.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/__init__.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/action_transmission_channel.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/boundary_actions.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/control_actions.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/displays.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/entities.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/general.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/implementations.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/load.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/mechanism.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/parameters.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/policy.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/state_update_transmission_channels.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/stateful_metrics.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/states.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/type.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/wiring.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/__init__.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/boundary_actions.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/control_actions.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/general.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/html.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/markdown.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/mechanisms.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/node_map.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/parameters.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/policies.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/spaces.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/state.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/tables.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/wiring.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/__init__.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/schema.py +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/schema.schema.json +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping.egg-info/SOURCES.txt +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping.egg-info/dependency_links.txt +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping.egg-info/requires.txt +0 -0
- {math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping.egg-info/top_level.txt +0 -0
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/MathSpec.py
RENAMED
@@ -775,6 +775,7 @@ class MathSpecImplementation:
|
|
775
775
|
self.policies = self.load_policies()
|
776
776
|
self.mechanisms = self.load_mechanisms()
|
777
777
|
self.stateful_metrics = self.load_stateful_metrics()
|
778
|
+
self.metrics = self.load_metrics()
|
778
779
|
self.load_wiring()
|
779
780
|
self.load_components()
|
780
781
|
|
@@ -951,6 +952,22 @@ class MathSpecImplementation:
|
|
951
952
|
|
952
953
|
return stateful_metrics
|
953
954
|
|
955
|
+
def load_metrics(self):
|
956
|
+
metrics = {}
|
957
|
+
|
958
|
+
for m in self.ms.metrics:
|
959
|
+
m = self.ms.metrics[m]
|
960
|
+
if "python" not in m.implementations:
|
961
|
+
print(
|
962
|
+
"No python implementation for {}. To fix this, go to Implementations/Python/Metrics and add {}".format(
|
963
|
+
m.name, m.name
|
964
|
+
)
|
965
|
+
)
|
966
|
+
else:
|
967
|
+
metrics[m.name] = m.implementations["python"]
|
968
|
+
|
969
|
+
return metrics
|
970
|
+
|
954
971
|
def load_wiring(
|
955
972
|
self,
|
956
973
|
):
|
@@ -1026,6 +1043,7 @@ class MathSpecImplementation:
|
|
1026
1043
|
state = deepcopy(state)
|
1027
1044
|
params = deepcopy(params)
|
1028
1045
|
state["Stateful Metrics"] = self.stateful_metrics
|
1046
|
+
state["Metrics"] = self.metrics
|
1029
1047
|
if state_preperation_functions:
|
1030
1048
|
for f in state_preperation_functions:
|
1031
1049
|
state = f(state)
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/metrics.py
RENAMED
@@ -50,6 +50,14 @@ def convert_metric(ms, data: Dict, stateful_metrics_map) -> Metric:
|
|
50
50
|
for x in data["metrics_used"]
|
51
51
|
)
|
52
52
|
|
53
|
+
data["implementations"] = {}
|
54
|
+
if "python" in ms["Implementations"]:
|
55
|
+
if "metrics" in ms["Implementations"]["python"]:
|
56
|
+
if data["name"] in ms["Implementations"]["python"]["metrics"]:
|
57
|
+
data["implementations"]["python"] = ms["Implementations"]["python"][
|
58
|
+
"metrics"
|
59
|
+
][data["name"]]
|
60
|
+
|
53
61
|
# Build the metric object
|
54
62
|
return Metric(data)
|
55
63
|
|
@@ -91,7 +99,9 @@ def load_metrics(ms: Dict, json: Dict, stateful_metrics_map) -> None:
|
|
91
99
|
for z in y["metrics_used"]:
|
92
100
|
assert (
|
93
101
|
z in ms["Metrics"] or z in names or z in stateful_metrics_map
|
94
|
-
), "{} is not defined in the spec".format(
|
102
|
+
), "{} is not defined in the spec, but it is referenced in {}".format(
|
103
|
+
z, y["name"]
|
104
|
+
)
|
95
105
|
assert len(metrics) == 0, "There are circular references"
|
96
106
|
|
97
107
|
# Load the metrics into the policies
|
@@ -13,8 +13,10 @@ def convert_space(ms, data: Dict) -> Space:
|
|
13
13
|
data = data.copy()
|
14
14
|
|
15
15
|
for x in data["schema"]:
|
16
|
-
assert
|
17
|
-
data["schema"][x]
|
16
|
+
assert (
|
17
|
+
data["schema"][x] in ms["Types"]
|
18
|
+
), "Type {} not in ms for space {} at attribute {}".format(
|
19
|
+
data["schema"][x], data["name"], x
|
18
20
|
)
|
19
21
|
data["schema"][x] = ms["Types"][data["schema"][x]]
|
20
22
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Block.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Entity.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Mechanism.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Parameter.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Policy.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Space.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/State.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/Type.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Classes/__init__.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Convenience/__init__.py
RENAMED
File without changes
|
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Convenience/starter.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/control_actions.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/displays.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/entities.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/general.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/implementations.py
RENAMED
File without changes
|
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/mechanism.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Load/parameters.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/general.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/html.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/markdown.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/mechanisms.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/node_map.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/parameters.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/policies.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/spaces.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/state.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/tables.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/Reports/wiring.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping/schema.schema.json
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping.egg-info/requires.txt
RENAMED
File without changes
|
{math_spec_mapping-0.3.9.1 → math_spec_mapping-0.3.10}/src/math_spec_mapping.egg-info/top_level.txt
RENAMED
File without changes
|