math-spec-mapping 0.3.12__tar.gz → 0.3.14__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. {math_spec_mapping-0.3.12/src/math_spec_mapping.egg-info → math_spec_mapping-0.3.14}/PKG-INFO +1 -1
  2. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/pyproject.toml +1 -1
  3. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Convenience/__init__.py +1 -0
  4. math_spec_mapping-0.3.14/src/math_spec_mapping/Convenience/github.py +34 -0
  5. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/implementations.py +2 -1
  6. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/type.py +10 -0
  7. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/html.py +12 -1
  8. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/markdown.py +7 -0
  9. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/__init__.py +1 -1
  10. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14/src/math_spec_mapping.egg-info}/PKG-INFO +1 -1
  11. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping.egg-info/SOURCES.txt +1 -0
  12. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/LICENSE +0 -0
  13. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/README.md +0 -0
  14. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/setup.cfg +0 -0
  15. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/ActionTransmissionChannel.py +0 -0
  16. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/Block.py +0 -0
  17. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/BoundaryAction.py +0 -0
  18. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/ControlAction.py +0 -0
  19. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/Entity.py +0 -0
  20. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/MathSpec.py +0 -0
  21. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/Mechanism.py +0 -0
  22. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/Metric.py +0 -0
  23. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/Parameter.py +0 -0
  24. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/Policy.py +0 -0
  25. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/Space.py +0 -0
  26. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/State.py +0 -0
  27. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/StateUpdateTransmissionChannel.py +0 -0
  28. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/StatefulMetric.py +0 -0
  29. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/Type.py +0 -0
  30. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Classes/__init__.py +0 -0
  31. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Convenience/documentation.py +0 -0
  32. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Convenience/starter.py +0 -0
  33. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/__init__.py +0 -0
  34. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/action_transmission_channel.py +0 -0
  35. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/boundary_actions.py +0 -0
  36. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/control_actions.py +0 -0
  37. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/displays.py +0 -0
  38. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/entities.py +0 -0
  39. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/general.py +0 -0
  40. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/load.py +0 -0
  41. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/mechanism.py +0 -0
  42. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/metrics.py +0 -0
  43. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/parameters.py +0 -0
  44. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/policy.py +0 -0
  45. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/spaces.py +0 -0
  46. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/state_update_transmission_channels.py +0 -0
  47. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/stateful_metrics.py +0 -0
  48. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/states.py +0 -0
  49. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Load/wiring.py +0 -0
  50. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/__init__.py +0 -0
  51. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/boundary_actions.py +0 -0
  52. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/control_actions.py +0 -0
  53. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/general.py +0 -0
  54. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/mechanisms.py +0 -0
  55. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/node_map.py +0 -0
  56. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/parameters.py +0 -0
  57. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/policies.py +0 -0
  58. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/spaces.py +0 -0
  59. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/state.py +0 -0
  60. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/tables.py +0 -0
  61. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/Reports/wiring.py +0 -0
  62. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/schema.py +0 -0
  63. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping/schema.schema.json +0 -0
  64. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping.egg-info/dependency_links.txt +0 -0
  65. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/src/math_spec_mapping.egg-info/requires.txt +0 -0
  66. {math_spec_mapping-0.3.12 → math_spec_mapping-0.3.14}/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.12
3
+ Version: 0.3.14
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.12"
6
+ version = "0.3.14"
7
7
  authors = [
8
8
  { name="Sean McOwen", email="Sean@Block.Science" },
9
9
  ]
@@ -1,2 +1,3 @@
1
1
  # from .documentation import write_top_level_json_description
2
2
  from .starter import remove_dummy_repo_components
3
+ from .github import write_scaffold_to_github_issues
@@ -0,0 +1,34 @@
1
+ import os
2
+ import requests
3
+
4
+
5
+ def write_scaffold_to_github_issues(
6
+ scaffolder_folder, repo_owner, repository_name, access_token
7
+ ):
8
+ folders = [
9
+ x
10
+ for x in os.listdir(scaffolder_folder)
11
+ if os.path.isdir(scaffolder_folder + "/" + x)
12
+ ]
13
+ headers = {
14
+ "Accept": "application/vnd.github+json",
15
+ "X-GitHub-Api-Version": "2022-11-28",
16
+ "Authorization": "Bearer {}".format(access_token),
17
+ }
18
+ for folder in folders:
19
+ issue_name = "Write {} from MSML Scaffold".format(folder)
20
+ checklist = [
21
+ x[:-3]
22
+ for x in os.listdir(scaffolder_folder + "/" + folder)
23
+ if x.endswith(".md")
24
+ ]
25
+ checklist = ["- [ ] " + x for x in checklist]
26
+ checklist = "\n".join(checklist)
27
+
28
+ requests.post(
29
+ "https://api.github.com/repos/{}/{}/issues".format(
30
+ repo_owner, repository_name
31
+ ),
32
+ headers=headers,
33
+ json={"title": issue_name, "body": checklist},
34
+ )
@@ -4,7 +4,8 @@ import os
4
4
  def load_implementations(ms):
5
5
  implementations = {}
6
6
  python_path = "src/Implementations/Python/__init__.py"
7
- if os.path.exists(python_path):
7
+ python_path2 = "../src/Implementations/Python/__init__.py"
8
+ if os.path.exists(python_path) or os.path.exists(python_path2):
8
9
  implementations["python"] = load_python_implementations()
9
10
 
10
11
  ms["Implementations"] = implementations
@@ -134,4 +134,14 @@ def load_type_keys(ms):
134
134
  if os.path.exists(julia_path):
135
135
  type_keys["julia"] = load_julia_type_key(julia_path)
136
136
 
137
+ python_path = "../src/TypeMappings/types.py"
138
+ typescript_path = "../src/TypeMappings/types.ts"
139
+ julia_path = "../src/TypeMappings/types.jl"
140
+ if os.path.exists(python_path):
141
+ type_keys["python"] = load_python_type_key()
142
+ if os.path.exists(typescript_path):
143
+ type_keys["typescript"] = load_typescript_type_key(typescript_path)
144
+ if os.path.exists(julia_path):
145
+ type_keys["julia"] = load_julia_type_key(julia_path)
146
+
137
147
  ms["Type Keys"] = type_keys
@@ -258,11 +258,22 @@ cssclasses:
258
258
  return out
259
259
 
260
260
 
261
- def write_overview(ms: MathSpec, name: str, file_path: str, summary: str = None):
261
+ def write_overview(
262
+ ms: MathSpec,
263
+ name: str,
264
+ file_path: str,
265
+ summary: str = None,
266
+ base_folder: str = None,
267
+ ):
262
268
  out = "<h1>{}</h1>".format(name)
263
269
  if summary:
264
270
  out += "<h2>Summary</h2>"
265
271
  out += "<p>{}</p>".format(summary)
272
+ if base_folder:
273
+ with open(base_folder, "r") as file:
274
+ content = file.read()
275
+ out += content
276
+ out += "\n"
266
277
  out += "<h2>Specification Tree</h2>"
267
278
  out += write_spec_tree(ms, readme=True)
268
279
  with open(file_path, "w") as f:
@@ -374,6 +374,12 @@ def write_control_action_markdown_report(ms, path, control_action, add_metadata=
374
374
  out += "\n"
375
375
  out += "\n"
376
376
 
377
+ out += "## Parameters Used\n"
378
+ for i, x in enumerate(sorted(control_action.parameters_used, key=lambda x: x)):
379
+ out += "{}. [[{}]]".format(i + 1, x)
380
+ out += "\n"
381
+ out += "\n"
382
+
377
383
  if control_action.control_action_options:
378
384
  out += "## Control Action Options:\n"
379
385
  for i, x in enumerate(control_action.control_action_options):
@@ -509,6 +515,7 @@ def write_parameter_markdown_report(ms, path, parameter, add_metadata=True):
509
515
  )
510
516
 
511
517
  out += "Description: {}\n\n".format(param.description)
518
+ out += "Type: [[{}]]\n\n".format(param.variable_type.name)
512
519
  out += "Symbol: {}\n\n".format(param.symbol)
513
520
  out += "Domain: {}\n\n".format(param.domain)
514
521
  out += "Parameter Class: {}\n\n".format(param.parameter_class)
@@ -30,6 +30,6 @@ from .Reports import (
30
30
  write_parameter_table_markdown,
31
31
  )
32
32
  from .schema import schema
33
- from .Convenience import remove_dummy_repo_components
33
+ from .Convenience import remove_dummy_repo_components, write_scaffold_to_github_issues
34
34
 
35
35
  # from .Convenience import write_top_level_json_description
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: math-spec-mapping
3
- Version: 0.3.12
3
+ Version: 0.3.14
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
@@ -27,6 +27,7 @@ src/math_spec_mapping/Classes/Type.py
27
27
  src/math_spec_mapping/Classes/__init__.py
28
28
  src/math_spec_mapping/Convenience/__init__.py
29
29
  src/math_spec_mapping/Convenience/documentation.py
30
+ src/math_spec_mapping/Convenience/github.py
30
31
  src/math_spec_mapping/Convenience/starter.py
31
32
  src/math_spec_mapping/Load/__init__.py
32
33
  src/math_spec_mapping/Load/action_transmission_channel.py