math-spec-mapping 0.3.4__tar.gz → 0.3.5__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. {math_spec_mapping-0.3.4/src/math_spec_mapping.egg-info → math_spec_mapping-0.3.5}/PKG-INFO +1 -1
  2. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/pyproject.toml +1 -1
  3. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/MathSpec.py +31 -3
  4. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/html.py +8 -2
  5. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5/src/math_spec_mapping.egg-info}/PKG-INFO +1 -1
  6. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/LICENSE +0 -0
  7. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/README.md +0 -0
  8. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/setup.cfg +0 -0
  9. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/ActionTransmissionChannel.py +0 -0
  10. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/Block.py +0 -0
  11. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/BoundaryAction.py +0 -0
  12. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/ControlAction.py +0 -0
  13. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/Entity.py +0 -0
  14. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/Mechanism.py +0 -0
  15. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/Metric.py +0 -0
  16. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/Parameter.py +0 -0
  17. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/Policy.py +0 -0
  18. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/Space.py +0 -0
  19. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/State.py +0 -0
  20. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/StateUpdateTransmissionChannel.py +0 -0
  21. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/StatefulMetric.py +0 -0
  22. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/Type.py +0 -0
  23. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Classes/__init__.py +0 -0
  24. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Convenience/__init__.py +0 -0
  25. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Convenience/documentation.py +0 -0
  26. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Convenience/starter.py +0 -0
  27. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/__init__.py +0 -0
  28. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/action_transmission_channel.py +0 -0
  29. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/boundary_actions.py +0 -0
  30. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/control_actions.py +0 -0
  31. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/displays.py +0 -0
  32. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/entities.py +0 -0
  33. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/general.py +0 -0
  34. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/implementations.py +0 -0
  35. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/load.py +0 -0
  36. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/mechanism.py +0 -0
  37. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/metrics.py +0 -0
  38. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/parameters.py +0 -0
  39. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/policy.py +0 -0
  40. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/spaces.py +0 -0
  41. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/state_update_transmission_channels.py +0 -0
  42. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/stateful_metrics.py +0 -0
  43. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/states.py +0 -0
  44. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/type.py +0 -0
  45. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Load/wiring.py +0 -0
  46. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/__init__.py +0 -0
  47. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/boundary_actions.py +0 -0
  48. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/control_actions.py +0 -0
  49. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/general.py +0 -0
  50. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/markdown.py +0 -0
  51. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/mechanisms.py +0 -0
  52. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/node_map.py +0 -0
  53. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/parameters.py +0 -0
  54. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/policies.py +0 -0
  55. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/spaces.py +0 -0
  56. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/state.py +0 -0
  57. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/tables.py +0 -0
  58. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/Reports/wiring.py +0 -0
  59. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/__init__.py +0 -0
  60. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/schema.py +0 -0
  61. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping/schema.schema.json +0 -0
  62. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping.egg-info/SOURCES.txt +0 -0
  63. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping.egg-info/dependency_links.txt +0 -0
  64. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping.egg-info/requires.txt +0 -0
  65. {math_spec_mapping-0.3.4 → math_spec_mapping-0.3.5}/src/math_spec_mapping.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: math-spec-mapping
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Summary: A library for easy mapping of mathematical specifications.
5
5
  Author-email: Sean McOwen <Sean@Block.Science>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.0"]
3
3
  build-backend = "setuptools.build_meta"
4
4
  [project]
5
5
  name = "math-spec-mapping"
6
- version = "0.3.4"
6
+ version = "0.3.5"
7
7
  authors = [
8
8
  { name="Sean McOwen", email="Sean@Block.Science" },
9
9
  ]
@@ -371,7 +371,7 @@ class MathSpec:
371
371
  )
372
372
  opts.extend(
373
373
  [
374
- (x, x.control_actions)
374
+ (x, x.control_action_options)
375
375
  for x in self.control_actions.values()
376
376
  if len(x.control_action_options) > 1
377
377
  ]
@@ -729,7 +729,7 @@ class MathSpecImplementation:
729
729
  assert (
730
730
  "FP {}".format(ba.name) in self.params
731
731
  ), "No functional parameterization for {}. To fix this error, add {} to the parameters passed to ms.build_implementation. Option can be: {}".format(
732
- ba.name, ba.name, [x.name for x in opts]
732
+ ba.name, "FP " + ba.name, [x.name for x in opts]
733
733
  )
734
734
 
735
735
  opt = self.ms.functional_parameters["FP {}".format(ba.name)][
@@ -806,7 +806,7 @@ class MathSpecImplementation:
806
806
  assert (
807
807
  "FP {}".format(p.name) in self.params
808
808
  ), "No functional parameterization for {}. To fix this error, add {} to the parameters passed to ms.build_implementation. Option can be: {}".format(
809
- p.name, p.name, [x.name for x in opts]
809
+ p.name, "FP " + p.name, [x.name for x in opts]
810
810
  )
811
811
  opt = self.ms.functional_parameters["FP {}".format(p.name)][
812
812
  self.params["FP {}".format(p.name)]
@@ -857,3 +857,31 @@ class MathSpecImplementation:
857
857
  if len(wiring) > 0:
858
858
  wiring = [x.name for x in wiring]
859
859
  print("The following wirings were not loading: {}".format(wiring))
860
+
861
+ def validate_state_and_params(self, state, parameters):
862
+
863
+ k1 = state.keys()
864
+ k2 = [x.name for x in self.ms.state["Global State"].variables]
865
+
866
+ not_in_state = [x for x in k2 if x not in k1]
867
+ shouldnt_be_in_state = [x for x in k1 if x not in k2]
868
+ assert (
869
+ len(not_in_state) == 0
870
+ ), "The following state variables are missing: {}".format(not_in_state)
871
+ assert (
872
+ len(shouldnt_be_in_state) == 0
873
+ ), "The following state variables are extra: {}".format(shouldnt_be_in_state)
874
+
875
+ k1 = parameters.keys()
876
+ k2 = self.ms.parameters.all_parameters + list(
877
+ self.ms.functional_parameters.keys()
878
+ )
879
+
880
+ not_in_params = [x for x in k2 if x not in k1]
881
+ shouldnt_be_in_params = [x for x in k1 if x not in k2]
882
+ assert (
883
+ len(not_in_params) == 0
884
+ ), "The following parameters are missing: {}".format(not_in_params)
885
+ assert (
886
+ len(shouldnt_be_in_params) == 0
887
+ ), "The following parameters are extra: {}".format(shouldnt_be_in_params)
@@ -164,7 +164,10 @@ cssclasses:
164
164
  else:
165
165
  out += symbol2 + name + "\n"
166
166
  for var in ms.stateful_metrics[name].metrics:
167
- out += symbol3 + "[[{}]]".format(var.name) + "\n"
167
+ if linking:
168
+ out += symbol3 + "[[{}]]".format(var.name) + "\n"
169
+ else:
170
+ out += symbol3 + "{}".format(var.name) + "\n"
168
171
 
169
172
  out += symbol1 + "**Types**\n"
170
173
  for name in ms.types.keys():
@@ -186,7 +189,10 @@ cssclasses:
186
189
  else:
187
190
  out += symbol2 + name + "\n"
188
191
  for param in [x.name for x in ms.parameters.data[name].parameters]:
189
- out += symbol3 + "[[{}]]".format(param) + "\n"
192
+ if linking:
193
+ out += symbol3 + "[[{}]]".format(param) + "\n"
194
+ else:
195
+ out += symbol3 + "{}".format(param) + "\n"
190
196
 
191
197
  out += symbol1 + "**Boundary Actions**\n"
192
198
  for name in ms.boundary_actions.keys():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: math-spec-mapping
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Summary: A library for easy mapping of mathematical specifications.
5
5
  Author-email: Sean McOwen <Sean@Block.Science>
6
6
  Classifier: Programming Language :: Python :: 3