math-spec-mapping 0.3.7__tar.gz → 0.3.9__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {math_spec_mapping-0.3.7/src/math_spec_mapping.egg-info → math_spec_mapping-0.3.9}/PKG-INFO +1 -1
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/pyproject.toml +1 -1
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/MathSpec.py +21 -1
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Convenience/starter.py +45 -11
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/stateful_metrics.py +7 -7
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/__init__.py +6 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/html.py +10 -1
- math_spec_mapping-0.3.9/src/math_spec_mapping/Reports/parameters.py +50 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/state.py +28 -2
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/__init__.py +4 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9/src/math_spec_mapping.egg-info}/PKG-INFO +1 -1
- math_spec_mapping-0.3.7/src/math_spec_mapping/Reports/parameters.py +0 -15
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/LICENSE +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/README.md +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/setup.cfg +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/ActionTransmissionChannel.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/Block.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/BoundaryAction.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/ControlAction.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/Entity.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/Mechanism.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/Metric.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/Parameter.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/Policy.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/Space.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/State.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/StateUpdateTransmissionChannel.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/StatefulMetric.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/Type.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/__init__.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Convenience/__init__.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Convenience/documentation.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/__init__.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/action_transmission_channel.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/boundary_actions.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/control_actions.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/displays.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/entities.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/general.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/implementations.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/load.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/mechanism.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/metrics.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/parameters.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/policy.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/spaces.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/state_update_transmission_channels.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/states.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/type.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/wiring.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/boundary_actions.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/control_actions.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/general.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/markdown.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/mechanisms.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/node_map.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/policies.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/spaces.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/tables.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/wiring.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/schema.py +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/schema.schema.json +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping.egg-info/SOURCES.txt +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping.egg-info/dependency_links.txt +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping.egg-info/requires.txt +0 -0
- {math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping.egg-info/top_level.txt +0 -0
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/MathSpec.py
RENAMED
@@ -477,17 +477,23 @@ class MathSpec:
|
|
477
477
|
state_base,
|
478
478
|
post_processing_function,
|
479
479
|
state_preperation_functions=None,
|
480
|
+
parameter_preperation_functions=None,
|
480
481
|
metrics_functions=None,
|
481
482
|
):
|
482
483
|
if experiment["Param Modifications"]:
|
483
484
|
params_base = deepcopy(params_base)
|
484
485
|
for key in experiment["Param Modifications"]:
|
485
486
|
params_base[key] = experiment["Param Modifications"][key]
|
487
|
+
if experiment["State Modifications"]:
|
488
|
+
state_base = deepcopy(state_base)
|
489
|
+
for key in experiment["State Modifications"]:
|
490
|
+
state_base[key] = experiment["State Modifications"][key]
|
486
491
|
msi = self.build_implementation(params_base)
|
487
492
|
state, params = msi.prepare_state_and_params(
|
488
493
|
state_base,
|
489
494
|
params_base,
|
490
495
|
state_preperation_functions=state_preperation_functions,
|
496
|
+
parameter_preperation_functions=parameter_preperation_functions,
|
491
497
|
)
|
492
498
|
|
493
499
|
state = msi.execute_blocks(state, params, experiment["Blocks"])
|
@@ -510,6 +516,7 @@ class MathSpec:
|
|
510
516
|
state_base,
|
511
517
|
post_processing_function,
|
512
518
|
state_preperation_functions=None,
|
519
|
+
parameter_preperation_functions=None,
|
513
520
|
metrics_functions=None,
|
514
521
|
):
|
515
522
|
state_l = []
|
@@ -524,6 +531,7 @@ class MathSpec:
|
|
524
531
|
state_base,
|
525
532
|
post_processing_function,
|
526
533
|
state_preperation_functions=state_preperation_functions,
|
534
|
+
parameter_preperation_functions=parameter_preperation_functions,
|
527
535
|
metrics_functions=metrics_functions,
|
528
536
|
)
|
529
537
|
df["Monte Carlo Run"] = i + 1
|
@@ -1007,7 +1015,13 @@ class MathSpecImplementation:
|
|
1007
1015
|
len(shouldnt_be_in_params) == 0
|
1008
1016
|
), "The following parameters are extra: {}".format(shouldnt_be_in_params)
|
1009
1017
|
|
1010
|
-
def prepare_state_and_params(
|
1018
|
+
def prepare_state_and_params(
|
1019
|
+
self,
|
1020
|
+
state,
|
1021
|
+
params,
|
1022
|
+
state_preperation_functions=None,
|
1023
|
+
parameter_preperation_functions=None,
|
1024
|
+
):
|
1011
1025
|
self.validate_state_and_params(state, params)
|
1012
1026
|
state = deepcopy(state)
|
1013
1027
|
params = deepcopy(params)
|
@@ -1018,6 +1032,12 @@ class MathSpecImplementation:
|
|
1018
1032
|
assert (
|
1019
1033
|
state is not None
|
1020
1034
|
), "A state must be returned from the state preperation functions"
|
1035
|
+
if parameter_preperation_functions:
|
1036
|
+
for f in parameter_preperation_functions:
|
1037
|
+
params = f(params)
|
1038
|
+
assert (
|
1039
|
+
params is not None
|
1040
|
+
), "A parameter set must be returned from the parameter preperation functions"
|
1021
1041
|
return state, params
|
1022
1042
|
|
1023
1043
|
def load_components(self):
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Convenience/starter.py
RENAMED
@@ -39,19 +39,27 @@ def remove_dummy_repo_components(path):
|
|
39
39
|
with open(path2 + "/__init__.py", "w") as f:
|
40
40
|
f.write(contents)
|
41
41
|
|
42
|
-
|
42
|
+
if "Displays" in directory_folders:
|
43
43
|
path2 = path + "/Displays"
|
44
44
|
contents = os.listdir(path2)
|
45
|
-
if "
|
46
|
-
|
47
|
-
if "__init__.py" in contents:
|
48
|
-
with open(path2 + "/__init__.py", "r") as f:
|
45
|
+
if "wiring.py" in contents:
|
46
|
+
with open(path2 + "/wiring.py", "r") as f:
|
49
47
|
contents = f.read()
|
50
|
-
|
51
|
-
contents = contents.replace("
|
52
|
-
contents = contents.replace("
|
53
|
-
|
54
|
-
|
48
|
+
|
49
|
+
contents = contents.replace('"Dummy Boundary Wiring 2",\n', "")
|
50
|
+
contents = contents.replace('"Dummy Boundary Wiring 2",', "")
|
51
|
+
contents = contents.replace('"Dummy Boundary Wiring 2"', "")
|
52
|
+
|
53
|
+
contents = contents.replace('"Dummy Boundary Wiring",\n', "")
|
54
|
+
contents = contents.replace('"Dummy Boundary Wiring",', "")
|
55
|
+
contents = contents.replace('"Dummy Boundary Wiring"', "")
|
56
|
+
|
57
|
+
contents = contents.replace('"Dummy Control Wiring",\n', "")
|
58
|
+
contents = contents.replace('"Dummy Control Wiring",', "")
|
59
|
+
contents = contents.replace('"Dummy Control Wiring"', "")
|
60
|
+
|
61
|
+
with open(path2 + "/wiring.py", "w") as f:
|
62
|
+
f.write(contents)
|
55
63
|
|
56
64
|
if "Wiring" in directory_folders:
|
57
65
|
path2 = path + "/Wiring"
|
@@ -78,6 +86,8 @@ def remove_dummy_repo_components(path):
|
|
78
86
|
contents = contents.replace("from .Dummy import dummy_mechanisms\n", "")
|
79
87
|
contents = contents.replace("mechanism.extend(dummy_mechanisms)\n", "")
|
80
88
|
contents = contents.replace("mechanism.extend(dummy_mechanisms)", "")
|
89
|
+
contents = contents.replace("mechanisms.extend(dummy_mechanisms)\n", "")
|
90
|
+
contents = contents.replace("mechanisms.extend(dummy_mechanisms)", "")
|
81
91
|
with open(path2 + "/__init__.py", "w") as f:
|
82
92
|
f.write(contents)
|
83
93
|
|
@@ -104,8 +114,23 @@ def remove_dummy_repo_components(path):
|
|
104
114
|
with open(path2 + "/__init__.py", "r") as f:
|
105
115
|
contents = f.read()
|
106
116
|
contents = contents.replace(
|
107
|
-
"from .Dummy import dummy_boundary_action\n",
|
117
|
+
"from .Dummy import dummy_boundary_action, dummy_boundary_action2\n",
|
118
|
+
"",
|
119
|
+
)
|
120
|
+
contents = contents.replace(
|
121
|
+
"from .Dummy import dummy_boundary_actions\n",
|
122
|
+
"",
|
123
|
+
)
|
124
|
+
|
125
|
+
contents = contents.replace(
|
126
|
+
"boundary_actions.extend(dummy_boundary_actions)",
|
127
|
+
"",
|
108
128
|
)
|
129
|
+
|
130
|
+
contents = contents.replace("dummy_boundary_action2,\n", "")
|
131
|
+
contents = contents.replace("dummy_boundary_action2,", "")
|
132
|
+
contents = contents.replace("dummy_boundary_action2", "")
|
133
|
+
|
109
134
|
contents = contents.replace("dummy_boundary_action,\n", "")
|
110
135
|
contents = contents.replace("dummy_boundary_action,", "")
|
111
136
|
contents = contents.replace("dummy_boundary_action", "")
|
@@ -123,6 +148,13 @@ def remove_dummy_repo_components(path):
|
|
123
148
|
contents = contents.replace(
|
124
149
|
"from .Dummy import dummy_control_action\n", ""
|
125
150
|
)
|
151
|
+
contents = contents.replace(
|
152
|
+
"from .Dummy import dummy_control_actions\n", ""
|
153
|
+
)
|
154
|
+
contents = contents.replace(
|
155
|
+
"control_actions.extend(dummy_control_actions)", ""
|
156
|
+
)
|
157
|
+
|
126
158
|
contents = contents.replace("dummy_control_action,\n", "")
|
127
159
|
contents = contents.replace("dummy_control_action,", "")
|
128
160
|
contents = contents.replace("dummy_control_action", "")
|
@@ -200,6 +232,8 @@ def remove_dummy_repo_components(path):
|
|
200
232
|
contents = contents.replace(
|
201
233
|
"from .Dummy import DummyCompoundType, DummyType1, DummyType2\n", ""
|
202
234
|
)
|
235
|
+
contents = contents.replace("from .Dummy import dummy_types\n", "")
|
236
|
+
contents = contents.replace("types.extend(dummy_types)", "")
|
203
237
|
contents = contents.replace(
|
204
238
|
""" DummyType1,
|
205
239
|
DummyType2,
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/stateful_metrics.py
RENAMED
@@ -40,14 +40,14 @@ def convert_stateful_metric(ms, data: Dict) -> StatefulMetricSet:
|
|
40
40
|
x[1]
|
41
41
|
)
|
42
42
|
|
43
|
-
|
43
|
+
var["implementations"] = {}
|
44
|
+
if "python" in ms["Implementations"]:
|
45
|
+
if "stateful_metrics" in ms["Implementations"]["python"]:
|
46
|
+
if var["name"] in ms["Implementations"]["python"]["stateful_metrics"]:
|
47
|
+
var["implementations"]["python"] = ms["Implementations"]["python"][
|
48
|
+
"stateful_metrics"
|
49
|
+
][var["name"]]
|
44
50
|
|
45
|
-
if "python" in ms["Implementations"]:
|
46
|
-
if "stateful_metrics" in ms["Implementations"]["python"]:
|
47
|
-
if var["name"] in ms["Implementations"]["python"]["stateful_metrics"]:
|
48
|
-
var["implementations"]["python"] = ms["Implementations"]["python"][
|
49
|
-
"stateful_metrics"
|
50
|
-
][var["name"]]
|
51
51
|
new_variables.append(StatefulMetric(var))
|
52
52
|
data["metrics"] = new_variables
|
53
53
|
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/__init__.py
RENAMED
@@ -7,6 +7,7 @@ from .html import (
|
|
7
7
|
write_basic_report_full,
|
8
8
|
write_action_chain_reports,
|
9
9
|
write_spec_tree,
|
10
|
+
write_parameter_table,
|
10
11
|
write_entity_reports,
|
11
12
|
write_overview,
|
12
13
|
)
|
@@ -26,3 +27,8 @@ from .markdown import (
|
|
26
27
|
write_stateful_metrics_markdown_report,
|
27
28
|
write_all_markdown_reports,
|
28
29
|
)
|
30
|
+
from .state import (
|
31
|
+
write_state_variable_table_markdown,
|
32
|
+
write_initial_state_variables_tables,
|
33
|
+
)
|
34
|
+
from .parameters import write_parameter_table_markdown
|
@@ -6,7 +6,7 @@ from .policies import write_out_policies
|
|
6
6
|
from .mechanisms import write_out_mechanisms
|
7
7
|
from .general import load_svg_graphviz, write_header
|
8
8
|
from .node_map import create_action_chains_graph
|
9
|
-
from .parameters import write_out_params
|
9
|
+
from .parameters import write_out_params, write_parameter_table_markdown
|
10
10
|
from .state import write_local_state_variable_tables, write_global_state_variable_table
|
11
11
|
from typing import List
|
12
12
|
import os
|
@@ -267,3 +267,12 @@ def write_overview(ms: MathSpec, name: str, file_path: str, summary: str = None)
|
|
267
267
|
out += write_spec_tree(ms, readme=True)
|
268
268
|
with open(file_path, "w") as f:
|
269
269
|
f.write(out)
|
270
|
+
|
271
|
+
|
272
|
+
def write_parameter_table(ms: MathSpec, path=None, linking=False) -> str:
|
273
|
+
out = write_parameter_table_markdown(ms, links=linking)
|
274
|
+
if path:
|
275
|
+
with open("{}/Paramter Table.md".format(path), "w") as f:
|
276
|
+
f.write(out)
|
277
|
+
else:
|
278
|
+
return out
|
@@ -0,0 +1,50 @@
|
|
1
|
+
from ..Classes import MathSpec
|
2
|
+
from typing import List
|
3
|
+
|
4
|
+
|
5
|
+
def write_out_params(ms: MathSpec, params: List[str]) -> str:
|
6
|
+
out = "<h2>Parameters</h2>"
|
7
|
+
for name in params:
|
8
|
+
out += "<h3>{}</h3>".format(name)
|
9
|
+
param = ms.parameters.parameter_map[name]
|
10
|
+
out += "<p>Description: {}</p>".format(param.description)
|
11
|
+
out += "<p>Symbol: {}</p>".format(param.symbol)
|
12
|
+
out += "<p>Domain: {}</p>".format(param.domain)
|
13
|
+
out += "<p>Parameter Class: {}</p>".format(param.parameter_class)
|
14
|
+
|
15
|
+
return out
|
16
|
+
|
17
|
+
|
18
|
+
def write_parameter_table_markdown(ms, initial_values=None, links=False):
|
19
|
+
if initial_values:
|
20
|
+
table = """| Name | Description | Parameter Class | Symbol | Domain | Initial Value |
|
21
|
+
| --- | --- | --- | --- | --- | --- |
|
22
|
+
"""
|
23
|
+
else:
|
24
|
+
table = """| Name | Description | Parameter Class | Symbol | Domain |
|
25
|
+
| --- | --- | --- | --- | --- |
|
26
|
+
"""
|
27
|
+
|
28
|
+
for name in ms.parameters.parameter_map:
|
29
|
+
var = ms.parameters.parameter_map[name]
|
30
|
+
table_vars = [
|
31
|
+
var.name,
|
32
|
+
var.description,
|
33
|
+
var.parameter_class,
|
34
|
+
var.symbol,
|
35
|
+
var.domain,
|
36
|
+
]
|
37
|
+
table += "|"
|
38
|
+
for i, tv in enumerate(table_vars):
|
39
|
+
if tv:
|
40
|
+
if links and i == 0:
|
41
|
+
table += "[[{}\|{}]]".format(tv, tv)
|
42
|
+
else:
|
43
|
+
table += "{}".format(tv)
|
44
|
+
table += "|"
|
45
|
+
if initial_values:
|
46
|
+
table += " {} |".format(initial_values[var.name])
|
47
|
+
|
48
|
+
table += "\n"
|
49
|
+
|
50
|
+
return table
|
@@ -33,8 +33,13 @@ def write_state_variable_table(target_state, links=False):
|
|
33
33
|
return table
|
34
34
|
|
35
35
|
|
36
|
-
def write_state_variable_table_markdown(target_state, links=False):
|
37
|
-
|
36
|
+
def write_state_variable_table_markdown(target_state, initial_values=None, links=False):
|
37
|
+
if initial_values:
|
38
|
+
table = """| Name | Description | Type | Symbol | Domain | Initial Value |
|
39
|
+
| --- | --- | --- | --- | --- | --- |
|
40
|
+
"""
|
41
|
+
else:
|
42
|
+
table = """| Name | Description | Type | Symbol | Domain |
|
38
43
|
| --- | --- | --- | --- | --- |
|
39
44
|
"""
|
40
45
|
|
@@ -56,12 +61,33 @@ def write_state_variable_table_markdown(target_state, links=False):
|
|
56
61
|
else:
|
57
62
|
table += "{}".format(tv)
|
58
63
|
table += "|"
|
64
|
+
if initial_values:
|
65
|
+
table += " {} |".format(initial_values[var.name])
|
59
66
|
|
60
67
|
table += "\n"
|
61
68
|
|
62
69
|
return table
|
63
70
|
|
64
71
|
|
72
|
+
def write_initial_state_variables_tables(ms, initial_values, links=False):
|
73
|
+
out = "### Global State"
|
74
|
+
out += "\n\n"
|
75
|
+
out += write_state_variable_table_markdown(
|
76
|
+
ms.state["Global State"], initial_values=initial_values, links=links
|
77
|
+
)
|
78
|
+
out += "\n"
|
79
|
+
for x in ms.state:
|
80
|
+
if x == "Global State":
|
81
|
+
continue
|
82
|
+
|
83
|
+
out += "### {}".format(x)
|
84
|
+
out += "\n\n"
|
85
|
+
out += write_state_variable_table_markdown(ms.state[x], links=links)
|
86
|
+
out += "\n"
|
87
|
+
|
88
|
+
return out
|
89
|
+
|
90
|
+
|
65
91
|
def write_global_state_variable_table(state):
|
66
92
|
out = ""
|
67
93
|
out += "<h3>Global State</h3>"
|
@@ -8,6 +8,7 @@ from .Reports import (
|
|
8
8
|
write_basic_report_full,
|
9
9
|
write_action_chain_reports,
|
10
10
|
write_spec_tree,
|
11
|
+
write_parameter_table,
|
11
12
|
create_parameter_impact_table,
|
12
13
|
write_entity_reports,
|
13
14
|
write_wiring_report,
|
@@ -24,6 +25,9 @@ from .Reports import (
|
|
24
25
|
write_parameter_markdown_report,
|
25
26
|
write_stateful_metrics_markdown_report,
|
26
27
|
write_all_markdown_reports,
|
28
|
+
write_state_variable_table_markdown,
|
29
|
+
write_initial_state_variables_tables,
|
30
|
+
write_parameter_table_markdown,
|
27
31
|
)
|
28
32
|
from .schema import schema
|
29
33
|
from .Convenience import remove_dummy_repo_components
|
@@ -1,15 +0,0 @@
|
|
1
|
-
from ..Classes import MathSpec
|
2
|
-
from typing import List
|
3
|
-
|
4
|
-
|
5
|
-
def write_out_params(ms: MathSpec, params: List[str]) -> str:
|
6
|
-
out = "<h2>Parameters</h2>"
|
7
|
-
for name in params:
|
8
|
-
out += "<h3>{}</h3>".format(name)
|
9
|
-
param = ms.parameters.parameter_map[name]
|
10
|
-
out += "<p>Description: {}</p>".format(param.description)
|
11
|
-
out += "<p>Symbol: {}</p>".format(param.symbol)
|
12
|
-
out += "<p>Domain: {}</p>".format(param.domain)
|
13
|
-
out += "<p>Parameter Class: {}</p>".format(param.parameter_class)
|
14
|
-
|
15
|
-
return out
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/BoundaryAction.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/ControlAction.py
RENAMED
File without changes
|
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/Mechanism.py
RENAMED
File without changes
|
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/Parameter.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/StatefulMetric.py
RENAMED
File without changes
|
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Classes/__init__.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Convenience/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/boundary_actions.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/control_actions.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Load/implementations.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/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
|
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/control_actions.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/general.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/markdown.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/mechanisms.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/node_map.py
RENAMED
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/Reports/policies.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping/schema.schema.json
RENAMED
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping.egg-info/requires.txt
RENAMED
File without changes
|
{math_spec_mapping-0.3.7 → math_spec_mapping-0.3.9}/src/math_spec_mapping.egg-info/top_level.txt
RENAMED
File without changes
|