sm-blueprint-lib 0.0.6__py3-none-any.whl → 0.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ from .barrierblock import *
2
+ from .logicgate import *
3
+ from .sensor import *
4
+ # from .switch import * # not finished
5
+ from .timer import *
@@ -0,0 +1,12 @@
1
+ from .adder import *
2
+ from .barrel_shifter import *
3
+ from .clock40hz import *
4
+ from .comparator import *
5
+ from .counter import *
6
+ from .decoder import *
7
+ from .distance_sensor import *
8
+ from .ram import *
9
+ from .register import *
10
+ from .rom import *
11
+ from .timer_ram_cached import * # not finished
12
+ from .timer_ram_multiclient import *
sm_blueprint_lib/utils.py CHANGED
@@ -1,6 +1,7 @@
1
1
  from dataclasses import asdict
2
2
  from json import load, dump, loads, dumps
3
3
  from math import ceil, log2
4
+ from typing import Sequence
4
5
 
5
6
  from numpy import ndarray
6
7
 
@@ -12,7 +13,7 @@ from .parts.timer import Timer
12
13
  from .pos import Pos
13
14
 
14
15
 
15
- def load_blueprint(path):
16
+ def load_blueprint(path: str):
16
17
  """Load a blueprint from a path file (normally a blueprint.json).
17
18
 
18
19
  Args:
@@ -25,7 +26,7 @@ def load_blueprint(path):
25
26
  return Blueprint(**load(fp))
26
27
 
27
28
 
28
- def save_blueprint(path, bp: Blueprint):
29
+ def save_blueprint(bp: Blueprint, path: str):
29
30
  """Save a blueprint to a file (normally a blueprint.json).
30
31
 
31
32
  Args:
@@ -36,7 +37,7 @@ def save_blueprint(path, bp: Blueprint):
36
37
  return dump(asdict(bp), fp, sort_keys=True, separators=(',', ':'))
37
38
 
38
39
 
39
- def load_string(str):
40
+ def load_blueprint_from_string(str: str):
40
41
  """Load a blueprint from a json string.
41
42
 
42
43
  Args:
@@ -48,7 +49,7 @@ def load_string(str):
48
49
  return Blueprint(**loads(str))
49
50
 
50
51
 
51
- def dump_string(bp: Blueprint):
52
+ def dump_string_from_blueprint(bp: Blueprint):
52
53
  """Dump a blueprint into a json-formatted string.
53
54
 
54
55
  Args:
@@ -110,9 +111,17 @@ def connect(_from, _to, *, parallel=True):
110
111
  connect(_from, subto, parallel=parallel)
111
112
 
112
113
 
113
- def check_pos(pos):
114
+ def check_pos(pos: Sequence) -> Pos:
115
+ """Converts a Sequence into a Pos class if it wasn't already.
116
+
117
+ Args:
118
+ pos (Sequence): The Sequence to be converted.
119
+
120
+ Returns:
121
+ Pos: The converted Pos.
122
+ """
114
123
  if not isinstance(pos, Pos):
115
- pos = Pos(*pos)
124
+ pos = Pos(*list(pos))
116
125
  return pos
117
126
 
118
127
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sm_blueprint_lib
3
- Version: 0.0.6
3
+ Version: 0.0.7
4
4
  Summary: Scrap Mechanic Library for Blueprint manipulation.
5
5
  Project-URL: Homepage, https://github.com/MauriceTZ/sm_blueprint_lib
6
6
  Project-URL: Issues, https://github.com/MauriceTZ/sm_blueprint_lib/issues
@@ -5,7 +5,7 @@ sm_blueprint_lib/bounds.py,sha256=fH-i8PdlZVg8qlEd3FmIf5mbx4RKhdBOFRAe5cSWWiI,18
5
5
  sm_blueprint_lib/constants.py,sha256=mll05HrWLGCETzvQlkDPRMBe5HJLAGn5rRkxs5gJ71E,710
6
6
  sm_blueprint_lib/id.py,sha256=5sBHC8qZJnCaizSBs4KGS1dnZHOSdoq5wkuIpuYNRnw,71
7
7
  sm_blueprint_lib/pos.py,sha256=W0yaIg_nYgRqFwSkHlpd7Tfr69XSVwjTY1DfICHXoDo,411
8
- sm_blueprint_lib/utils.py,sha256=g3psyklJ6D1PvyL-MQPDN1TqW7Q1JVr1eSuoIdJy0Ro,4819
8
+ sm_blueprint_lib/utils.py,sha256=oT4s7kpY7-OSFDFiJt48fr7Yp_dBkGz45iOBiwnNcHE,5109
9
9
  sm_blueprint_lib/bases/controllers/basecontroller.py,sha256=VFS5J7kGQ8vfWBFjiTPVfXXjyMwJ1VqA3mYuh7Z_8ak,624
10
10
  sm_blueprint_lib/bases/controllers/baselogiccontroller.py,sha256=lDoDt9NKFu01CqyJE09_bq9oDeYK7T-fERO54kd-sFA,290
11
11
  sm_blueprint_lib/bases/controllers/logicgatecontroller.py,sha256=wzw8kdt65Zg6ucNNy47V3-okYod_ea2NH8erfjRu7uw,223
@@ -15,11 +15,13 @@ sm_blueprint_lib/bases/parts/baseboundablepart.py,sha256=jNx_btmkCTksT6FcpHQxEVJ
15
15
  sm_blueprint_lib/bases/parts/baseinteractablepart.py,sha256=VXINrObIr6Y2tFIOI59cB_-625rPwtKZdGDmaa3EgQ8,574
16
16
  sm_blueprint_lib/bases/parts/baselogicpart.py,sha256=al9nLCg8YiLKWd_c_ZQmq9f6sazjF6RNbuGGbYROOps,498
17
17
  sm_blueprint_lib/bases/parts/basepart.py,sha256=hzJBcB4uol65THzEZEGq4d2N9SbK1S4XiMghEuB6cuc,1126
18
+ sm_blueprint_lib/parts/__init__.py,sha256=3MW-wlhw2BepJ4bo1_xSAe2DzsfQ1yh-U3UnjWgZm2w,140
18
19
  sm_blueprint_lib/parts/barrierblock.py,sha256=GPI8ArKKvzO6wnHfBfgmU4Ezcrw9SmtKR0p4mWczYiw,267
19
20
  sm_blueprint_lib/parts/logicgate.py,sha256=In7-d-lCx1zJIT-7S0Mh7s32lj7xZ6wxObJMnKJKQQ4,960
20
21
  sm_blueprint_lib/parts/sensor.py,sha256=ZJY5xo0NB6wAwgzS7EO-xgsukXYbwV7ptbGOqLfeBKQ,1008
21
22
  sm_blueprint_lib/parts/switch.py,sha256=3Yo1xMKV5kWnptgnAA1XR_VU2ft-10EuKR62nzvZ0gI,225
22
23
  sm_blueprint_lib/parts/timer.py,sha256=gw9XaWvP2yW3egT72BGowMu-CZFUY-Hke-Dwg0lsxjM,806
24
+ sm_blueprint_lib/prebuilds/__init__.py,sha256=iPrsPMiuoluIDvdLGuQmEJ-I11D5qk563ANKr3md1GM,337
23
25
  sm_blueprint_lib/prebuilds/adder.py,sha256=Rq-006N_oD5ExIwQelgfrBKd7g8zFVxk4tj2lZEp82w,1750
24
26
  sm_blueprint_lib/prebuilds/barrel_shifter.py,sha256=BOvsUg9o6YzVrclmGNzhSbt9eQL23GJHHVyNxkXbcaE,3556
25
27
  sm_blueprint_lib/prebuilds/clock40hz.py,sha256=ygG8ieqpFzGMnuY5CBTs60liAYyAsBx-YIlb0gl3SXM,844
@@ -32,7 +34,7 @@ sm_blueprint_lib/prebuilds/register.py,sha256=MAiplmiA2L_VJaxCX2E8QuancnoqvyLY-v
32
34
  sm_blueprint_lib/prebuilds/rom.py,sha256=4dxAaNxRX60kDW17NKew-TJkPB7EMfHuK_zVIm6N-jo,3700
33
35
  sm_blueprint_lib/prebuilds/timer_ram_cached.py,sha256=PG53hDKYS00fur5vazh7iOs2Gm4G_URJLX7d9xWJOe4,19057
34
36
  sm_blueprint_lib/prebuilds/timer_ram_multiclient.py,sha256=NlQeJB6ilEGJDrIOfkFmPWd7afDR_0CUZH7RQpjyA4s,4200
35
- sm_blueprint_lib-0.0.6.dist-info/METADATA,sha256=PuNO-nrz_OB8Iq0BGapU0yrouBhfC5d0bbkxfkv8yXM,611
36
- sm_blueprint_lib-0.0.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
37
- sm_blueprint_lib-0.0.6.dist-info/licenses/LICENSE,sha256=DWhaodryTSEv07KdWbanCMaEujOXYxnj-IEhmgTkOq0,1084
38
- sm_blueprint_lib-0.0.6.dist-info/RECORD,,
37
+ sm_blueprint_lib-0.0.7.dist-info/METADATA,sha256=QBI7t4D3xRFccTybjqgAnnACBTcg0oQMJX4MuzDD9-0,611
38
+ sm_blueprint_lib-0.0.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
+ sm_blueprint_lib-0.0.7.dist-info/licenses/LICENSE,sha256=DWhaodryTSEv07KdWbanCMaEujOXYxnj-IEhmgTkOq0,1084
40
+ sm_blueprint_lib-0.0.7.dist-info/RECORD,,