math-spec-mapping 0.3.12__py3-none-any.whl → 0.3.14__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -1,4 +1,4 @@
1
- math_spec_mapping/__init__.py,sha256=5n9PbwtdXymhFpL0uUOmcpCBfCEgDp2T93QIASC73ts,1107
1
+ math_spec_mapping/__init__.py,sha256=LvuIbfILQf3UGyHympLJyncfnnpZpEyvN5UDOpi8bWw,1140
2
2
  math_spec_mapping/schema.py,sha256=6mrRqzEnTTSXjb19xJ63MBp0KjKH0s7i6TfT4MkAY9k,233
3
3
  math_spec_mapping/schema.schema.json,sha256=hJP2TcV5WPFPmx4u_A5U1xtnpkE1LeYaTeYOXadTot0,30916
4
4
  math_spec_mapping/Classes/ActionTransmissionChannel.py,sha256=zWMo5QsgPh5WGIWXl-xOrZNMXYJXmK6Vejw1dQvi0og,246
@@ -17,8 +17,9 @@ math_spec_mapping/Classes/StateUpdateTransmissionChannel.py,sha256=3hBLvD1lE64Pk
17
17
  math_spec_mapping/Classes/StatefulMetric.py,sha256=plMFMAFEk1y2t4DR5lA2SRC9UrYArsx_W33l3mZSdgE,804
18
18
  math_spec_mapping/Classes/Type.py,sha256=2KFY8d3cv1PzJJ7SSMHJf1zcfQ3ZbqxotK2KgTaLZdM,289
19
19
  math_spec_mapping/Classes/__init__.py,sha256=0zxgOqns_9JybD74HKMVh6aw8ij8WVbfQ4Q_1uWzof0,761
20
- math_spec_mapping/Convenience/__init__.py,sha256=z2W-E5Wg1CNEkDI5UqH3qIVBqp-3A1e63f3u9fA-N7w,112
20
+ math_spec_mapping/Convenience/__init__.py,sha256=P8WgrbpJkH08GeyOdhF-ITfT4Yd4ny8QJEvZK0fSljc,164
21
21
  math_spec_mapping/Convenience/documentation.py,sha256=1ziWVJznbCUxeAAt03nAdEYtMlXNo5TeedHfgs0vSBU,1625
22
+ math_spec_mapping/Convenience/github.py,sha256=mMOhIH3Nvh_91fNTOPjz1oQq1iDq2m5hNLMhtcrr5FU,1025
22
23
  math_spec_mapping/Convenience/starter.py,sha256=9dBKU3EHscut2wA6Nx1XUmehrFIdr4dCjP9V1BbTF6s,12567
23
24
  math_spec_mapping/Load/__init__.py,sha256=_ga5nHi7U5rY5lCF36_XI9Qmybq4P8R4m5I5mmjLBk8,33
24
25
  math_spec_mapping/Load/action_transmission_channel.py,sha256=9Wer7g2s5SSOcUYuZ0PqSKUVVnW3EvGQJZNXJTwW__0,2561
@@ -27,7 +28,7 @@ math_spec_mapping/Load/control_actions.py,sha256=W7kKLcA0UQ40m1ZExmvu0ujdxvJ8wH-
27
28
  math_spec_mapping/Load/displays.py,sha256=uQvs0Jhp8-9SXGex8SG3ibxHJu7ahAV3xLeBFbT8QEE,480
28
29
  math_spec_mapping/Load/entities.py,sha256=Ds7VQY_govWEn1vSHYVrLa8IadSNyOQzaCK18JPYPKk,1289
29
30
  math_spec_mapping/Load/general.py,sha256=2q6aGKxXhebiHHTZhtACvM4nWIkTben0o5rXuvfv2Vw,4463
30
- math_spec_mapping/Load/implementations.py,sha256=SGKZ_YXeNpJUTnw5fajQTXji7S2bNQo8sh-7YcIO6pk,395
31
+ math_spec_mapping/Load/implementations.py,sha256=a8YvumnyQvrnCo-o52Rv4yU8D7nmkMrV1iIA15fr6Bw,490
31
32
  math_spec_mapping/Load/load.py,sha256=CLprDhJpbwm9RAzKM2Ghwr8eqBu0a-wvGDOCMmc01YE,2484
32
33
  math_spec_mapping/Load/mechanism.py,sha256=JBy-QpB4W0Z2OcNiakONjD4_RtEgxlFKtLXfDqfhR-0,2037
33
34
  math_spec_mapping/Load/metrics.py,sha256=0XL-E7PUZg5PX_ZensoDpT2Z2xq893JncBEYbPzxeGo,3866
@@ -37,14 +38,14 @@ math_spec_mapping/Load/spaces.py,sha256=5nJto38BVMED5KuMXOqavYj8gcSTKiNSTdMOOp5T
37
38
  math_spec_mapping/Load/state_update_transmission_channels.py,sha256=FJWp5n4HdtHAfof5BUQ6BnRakljatL2h8dWCapaVSc0,2238
38
39
  math_spec_mapping/Load/stateful_metrics.py,sha256=3Lq1ZGMaDd5OcGeqR2p5c_znkYw7ETTNPFjUVdZAHKk,2384
39
40
  math_spec_mapping/Load/states.py,sha256=3YurI7eTNkN6nrXRFVrc58wH0VfM22XOuWE07HVpR7Y,1365
40
- math_spec_mapping/Load/type.py,sha256=z6cBdBNjWed7cRyA0Bj7Jd5PmtemVVh07n3mWFj_5U4,4356
41
+ math_spec_mapping/Load/type.py,sha256=FbViE3wV1o1JTx7mUYyUpAvgIxDKDQYc6Iw50FrZ4nY,4808
41
42
  math_spec_mapping/Load/wiring.py,sha256=1dR94U5N1W_WI5rL6lYBltH25ZvApB2pIpq9r5Opkug,3083
42
43
  math_spec_mapping/Reports/__init__.py,sha256=P3IuE1wiM1EO_yCSD73D4O0O6j7aVWmiwpKJM58ISEs,1121
43
44
  math_spec_mapping/Reports/boundary_actions.py,sha256=45BPp4QjWdD-3E9ZWwqgj_nI2-YdcI2ZZ19_Qv_K7Qk,1410
44
45
  math_spec_mapping/Reports/control_actions.py,sha256=NksekZKIPFSIkubttFstKFthc5AU9B9PWRLSl9j1wWs,1216
45
46
  math_spec_mapping/Reports/general.py,sha256=WOOn6Wlb8M4fsdN49FlKLwOka6vJPQ9aCUy88TL2ki0,1610
46
- math_spec_mapping/Reports/html.py,sha256=zRo67S81pIRK_sttuFy8Y06qllen_K0lNS1qeHQo5ik,9521
47
- math_spec_mapping/Reports/markdown.py,sha256=SdhgOMpMBnGKWDG0cimk-LI_UqjQDPy87IxTb-PrBQ0,22866
47
+ math_spec_mapping/Reports/html.py,sha256=RpyQQON8pDnMmfcyxOsm8UAD5Ad8VKnnW-OyOarTmzA,9711
48
+ math_spec_mapping/Reports/markdown.py,sha256=ZELi-p51k_sehFDHzDalOJstIi6nD2845DTqHp46hKU,23129
48
49
  math_spec_mapping/Reports/mechanisms.py,sha256=d2Rxt3JBYvqAOAYUynl0buYVoXEHrO8EGq7GK6hK8NA,1322
49
50
  math_spec_mapping/Reports/node_map.py,sha256=FdSMDQG16NX6n9sZcH-T5xwsvgjrV9OqBHc9J_VlNK0,3129
50
51
  math_spec_mapping/Reports/parameters.py,sha256=-ucL71lolqU0xvV7yb0sXl4pFMRl5tXNWdoBfUjLOaQ,1944
@@ -53,8 +54,8 @@ math_spec_mapping/Reports/spaces.py,sha256=-76hR5wQBv4lsG000ypBJ-OprjsNjI-rNRMYd
53
54
  math_spec_mapping/Reports/state.py,sha256=QYeCvX5cHeZBrbvMeDsTqJcUDTuDFJSLvPbasjLspk8,3643
54
55
  math_spec_mapping/Reports/tables.py,sha256=O0CNuqh3LMECq5uLjBOoxMUk5hUvkUK660FNnwWUxDY,1505
55
56
  math_spec_mapping/Reports/wiring.py,sha256=u9SvKWy6T-WJUEgFI6-zgZanoOaTTs_2YwmEceDLsV8,1618
56
- math_spec_mapping-0.3.12.dist-info/LICENSE,sha256=ObyEzSw8kgCaFbEfpu1zP4TrcAKLA0xhqHMZZfyh7N0,1069
57
- math_spec_mapping-0.3.12.dist-info/METADATA,sha256=0vIDBOENySVkVAwdDuRbtZ84uOKAEwWLj9qwaR6-Mh8,6501
58
- math_spec_mapping-0.3.12.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
59
- math_spec_mapping-0.3.12.dist-info/top_level.txt,sha256=AImhn9wgazkdV0a9vfiphtQR8uGe2nq-ZIOp-6yUk9o,18
60
- math_spec_mapping-0.3.12.dist-info/RECORD,,
57
+ math_spec_mapping-0.3.14.dist-info/LICENSE,sha256=ObyEzSw8kgCaFbEfpu1zP4TrcAKLA0xhqHMZZfyh7N0,1069
58
+ math_spec_mapping-0.3.14.dist-info/METADATA,sha256=pgCgjXjeObVD7rjGT4MWcg04e8CCvB6ThIqB9TGAVr0,6501
59
+ math_spec_mapping-0.3.14.dist-info/WHEEL,sha256=a7TGlA-5DaHMRrarXjVbQagU3Man_dCnGIWMJr5kRWo,91
60
+ math_spec_mapping-0.3.14.dist-info/top_level.txt,sha256=AImhn9wgazkdV0a9vfiphtQR8uGe2nq-ZIOp-6yUk9o,18
61
+ math_spec_mapping-0.3.14.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.1.0)
2
+ Generator: setuptools (75.4.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5