sm-blueprint-lib 0.0.3__py3-none-any.whl → 0.0.5__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.
- sm_blueprint_lib/__init__.py +0 -138
- sm_blueprint_lib/bases/controllers/basecontroller.py +2 -2
- sm_blueprint_lib/bases/controllers/baselogiccontroller.py +1 -1
- sm_blueprint_lib/bases/controllers/logicgatecontroller.py +1 -1
- sm_blueprint_lib/bases/controllers/sensorcontroller.py +1 -1
- sm_blueprint_lib/bases/controllers/timercontroller.py +1 -1
- sm_blueprint_lib/blueprint.py +3 -3
- sm_blueprint_lib/body.py +2 -2
- sm_blueprint_lib/prebuilds/adder.py +4 -4
- sm_blueprint_lib/prebuilds/barrel_shifter.py +4 -4
- sm_blueprint_lib/prebuilds/clock40hz.py +4 -4
- sm_blueprint_lib/prebuilds/comparator.py +4 -4
- sm_blueprint_lib/prebuilds/counter.py +4 -4
- sm_blueprint_lib/prebuilds/decoder.py +4 -4
- sm_blueprint_lib/prebuilds/distance_sensor.py +6 -6
- sm_blueprint_lib/prebuilds/ram.py +5 -5
- sm_blueprint_lib/prebuilds/register.py +5 -5
- sm_blueprint_lib/prebuilds/rom.py +6 -6
- sm_blueprint_lib/prebuilds/timer_ram_cached.py +13 -13
- sm_blueprint_lib/prebuilds/timer_ram_multiclient.py +9 -9
- sm_blueprint_lib/utils.py +138 -0
- {sm_blueprint_lib-0.0.3.dist-info → sm_blueprint_lib-0.0.5.dist-info}/METADATA +2 -1
- sm_blueprint_lib-0.0.5.dist-info/RECORD +29 -0
- sm_blueprint_lib-0.0.3.dist-info/RECORD +0 -28
- {sm_blueprint_lib-0.0.3.dist-info → sm_blueprint_lib-0.0.5.dist-info}/WHEEL +0 -0
- {sm_blueprint_lib-0.0.3.dist-info → sm_blueprint_lib-0.0.5.dist-info}/licenses/LICENSE +0 -0
sm_blueprint_lib/__init__.py
CHANGED
@@ -1,138 +0,0 @@
|
|
1
|
-
from dataclasses import asdict
|
2
|
-
from json import load, dump, loads, dumps
|
3
|
-
from math import ceil, log2
|
4
|
-
|
5
|
-
from numpy import ndarray
|
6
|
-
|
7
|
-
from sm_blueprint_lib.bases.parts.baseinteractablepart import BaseInteractablePart
|
8
|
-
from sm_blueprint_lib.blueprint import Blueprint
|
9
|
-
from sm_blueprint_lib.parts.barrierblock import BarrierBlock
|
10
|
-
from sm_blueprint_lib.parts.logicgate import LogicGate
|
11
|
-
from sm_blueprint_lib.parts.timer import Timer
|
12
|
-
from sm_blueprint_lib.pos import Pos
|
13
|
-
|
14
|
-
|
15
|
-
def load_blueprint(path):
|
16
|
-
"""Load a blueprint from a path file (normally a blueprint.json).
|
17
|
-
|
18
|
-
Args:
|
19
|
-
path (str): The path to the json file.
|
20
|
-
|
21
|
-
Returns:
|
22
|
-
Blueprint: The loaded blueprint.
|
23
|
-
"""
|
24
|
-
with open(path) as fp:
|
25
|
-
return Blueprint(**load(fp))
|
26
|
-
|
27
|
-
|
28
|
-
def save_blueprint(path, bp: Blueprint):
|
29
|
-
"""Save a blueprint to a file (normally a blueprint.json).
|
30
|
-
|
31
|
-
Args:
|
32
|
-
path (str): The path to save the json file.
|
33
|
-
bp (Blueprint): The blueprint to be saved.
|
34
|
-
"""
|
35
|
-
with open(path, mode="w") as fp:
|
36
|
-
return dump(asdict(bp), fp, sort_keys=True, separators=(',', ':'))
|
37
|
-
|
38
|
-
|
39
|
-
def load_string(str):
|
40
|
-
"""Load a blueprint from a json string.
|
41
|
-
|
42
|
-
Args:
|
43
|
-
str (str): The string to be loaded.
|
44
|
-
|
45
|
-
Returns:
|
46
|
-
Blueprint: The loaded blueprint.
|
47
|
-
"""
|
48
|
-
return Blueprint(**loads(str))
|
49
|
-
|
50
|
-
|
51
|
-
def dump_string(bp: Blueprint):
|
52
|
-
"""Dump a blueprint into a json-formatted string.
|
53
|
-
|
54
|
-
Args:
|
55
|
-
bp (Blueprint): The blueprint to be dumped.
|
56
|
-
|
57
|
-
Returns:
|
58
|
-
str: The json-formatted string.
|
59
|
-
"""
|
60
|
-
return dumps(asdict(bp), sort_keys=True, separators=(',', ':'))
|
61
|
-
|
62
|
-
|
63
|
-
def connect(_from, _to, *, parallel=True):
|
64
|
-
"""Connect interactable parts together, recursively.
|
65
|
-
|
66
|
-
Args:
|
67
|
-
_from (Any): Must be an instance of BaseInteractablePart or a subclass.
|
68
|
-
Also it can be any nested iterable of instances (list of parts, list of lists of parts, etc).
|
69
|
-
_to (Any): Must be an instance of BaseInteractablePart or a subclass.
|
70
|
-
Also it can be any nested iterable of instances (list of parts, list of lists of parts, etc).
|
71
|
-
parallel (bool, optional): Defines the behaviour of the connections in the following way:
|
72
|
-
|
73
|
-
With parallel=False, everything connects to everything:
|
74
|
-
from1 🔀 to1
|
75
|
-
|
76
|
-
from2 🔀 to2
|
77
|
-
|
78
|
-
With parallel=True, every row is connected respectively:
|
79
|
-
from1 → to1
|
80
|
-
|
81
|
-
from2 → to2
|
82
|
-
|
83
|
-
Also, if the dimensions does not match it tries to adapt (many to one, one to many, etc)
|
84
|
-
|
85
|
-
Defaults to True.
|
86
|
-
"""
|
87
|
-
if isinstance(_from, BaseInteractablePart) and isinstance(_to, BaseInteractablePart):
|
88
|
-
_from.connect(_to)
|
89
|
-
return
|
90
|
-
if parallel: # Try connect things row-by-row if possible (one to one, one to many, many to many)
|
91
|
-
if not isinstance(_from, BaseInteractablePart) and not isinstance(_to, BaseInteractablePart): # Assume both are sequence of parts
|
92
|
-
for subfrom, subto in zip(_from, _to):
|
93
|
-
connect(subfrom, subto, parallel=parallel)
|
94
|
-
elif not isinstance(_from, BaseInteractablePart): # Assume _from is a sequence of parts
|
95
|
-
for subfrom in _from:
|
96
|
-
connect(subfrom, _to, parallel=parallel)
|
97
|
-
else: # Assume _to is a sequence of parts
|
98
|
-
for subto in _to:
|
99
|
-
connect(_from, subto, parallel=parallel)
|
100
|
-
else: # Just connect everything to everything lol
|
101
|
-
if not isinstance(_from, BaseInteractablePart) and not isinstance(_to, BaseInteractablePart): # Assume both are sequence of parts
|
102
|
-
for subfrom in _from:
|
103
|
-
for subto in _to:
|
104
|
-
connect(subfrom, subto, parallel=parallel)
|
105
|
-
elif not isinstance(_from, BaseInteractablePart): # Assume _from is a sequence of parts
|
106
|
-
for subfrom in _from:
|
107
|
-
connect(subfrom, _to, parallel=parallel)
|
108
|
-
else: # Assume _to is a sequence of parts
|
109
|
-
for subto in _to:
|
110
|
-
connect(_from, subto, parallel=parallel)
|
111
|
-
|
112
|
-
|
113
|
-
def check_pos(pos):
|
114
|
-
if not isinstance(pos, Pos):
|
115
|
-
pos = Pos(*pos)
|
116
|
-
return pos
|
117
|
-
|
118
|
-
|
119
|
-
def get_bits_required(number: int | float):
|
120
|
-
"""Calculates how many bits are required to store this number.
|
121
|
-
|
122
|
-
Args:
|
123
|
-
number (int | float): The target number.
|
124
|
-
"""
|
125
|
-
return ceil(log2(number))
|
126
|
-
|
127
|
-
|
128
|
-
def num_to_bit_list(number: int, bit_length: int):
|
129
|
-
"""Converts a number to a numpy array of its bits.
|
130
|
-
|
131
|
-
Args:
|
132
|
-
number (int): The number to convert.
|
133
|
-
bit_length (int): The number of bits the list will have.
|
134
|
-
"""
|
135
|
-
output = ndarray(bit_length, dtype=bool)
|
136
|
-
for b in range(bit_length):
|
137
|
-
output[b] = bool((number >> b) & 1)
|
138
|
-
return output
|
sm_blueprint_lib/blueprint.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
from dataclasses import dataclass, field
|
2
2
|
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
3
|
+
from bases.parts.basepart import BasePart
|
4
|
+
from body import Body
|
5
|
+
from constants import VERSION
|
6
6
|
|
7
7
|
|
8
8
|
@dataclass
|
sm_blueprint_lib/body.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
from typing import Sequence
|
2
2
|
from numpy import ndarray
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
3
|
+
from utils import get_bits_required, check_pos, connect, num_to_bit_list
|
4
|
+
from blueprint import Blueprint
|
5
|
+
from parts.logicgate import LogicGate
|
6
|
+
from pos import Pos
|
7
7
|
|
8
8
|
|
9
9
|
def simple_adder_subtractor(bp: Blueprint,
|
@@ -1,9 +1,9 @@
|
|
1
1
|
from typing import Sequence
|
2
2
|
from numpy import ndarray
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
3
|
+
from utils import get_bits_required, check_pos, connect, num_to_bit_list
|
4
|
+
from blueprint import Blueprint
|
5
|
+
from parts.logicgate import LogicGate
|
6
|
+
from pos import Pos
|
7
7
|
|
8
8
|
|
9
9
|
def barrel_shifter(bp: Blueprint, bit_length: int, num_bit_shift: int, pos: Pos | Sequence = (0, 0, 0)):
|
@@ -1,9 +1,9 @@
|
|
1
1
|
from typing import Sequence
|
2
2
|
from numpy import ndarray
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
3
|
+
from utils import get_bits_required, check_pos, connect, num_to_bit_list
|
4
|
+
from blueprint import Blueprint
|
5
|
+
from parts.logicgate import LogicGate
|
6
|
+
from pos import Pos
|
7
7
|
|
8
8
|
|
9
9
|
def clock40hz(bp: Blueprint, bit_length: int, pos: Pos | Sequence = (0, 0, 0)):
|
@@ -1,9 +1,9 @@
|
|
1
1
|
from typing import Sequence
|
2
2
|
from numpy import ndarray
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
3
|
+
from utils import check_pos, connect
|
4
|
+
from blueprint import Blueprint
|
5
|
+
from parts.logicgate import LogicGate
|
6
|
+
from pos import Pos
|
7
7
|
|
8
8
|
|
9
9
|
def comparator(bp: Blueprint,
|
@@ -1,9 +1,9 @@
|
|
1
1
|
from typing import Sequence
|
2
2
|
from numpy import ndarray
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
3
|
+
from utils import get_bits_required, check_pos, connect, num_to_bit_list
|
4
|
+
from blueprint import Blueprint
|
5
|
+
from parts.logicgate import LogicGate
|
6
|
+
from pos import Pos
|
7
7
|
|
8
8
|
|
9
9
|
def counter(bp: Blueprint,
|
@@ -1,9 +1,9 @@
|
|
1
1
|
from typing import Sequence
|
2
2
|
from numpy import ndarray
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
3
|
+
from utils import get_bits_required, check_pos, connect, num_to_bit_list
|
4
|
+
from blueprint import Blueprint
|
5
|
+
from parts.logicgate import LogicGate
|
6
|
+
from pos import Pos
|
7
7
|
|
8
8
|
|
9
9
|
def decoder(bp: Blueprint, num_address: int, pos: Pos | Sequence = (0, 0, 0),
|
@@ -1,11 +1,11 @@
|
|
1
1
|
from typing import Sequence
|
2
2
|
from numpy import array, ndarray
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from
|
8
|
-
from
|
3
|
+
from utils import get_bits_required, check_pos, connect, num_to_bit_list
|
4
|
+
from blueprint import Blueprint
|
5
|
+
from parts.logicgate import LogicGate
|
6
|
+
from parts.sensor import Sensor5
|
7
|
+
from parts.timer import Timer
|
8
|
+
from pos import Pos
|
9
9
|
|
10
10
|
|
11
11
|
def distance_sensor(bp: Blueprint,
|
@@ -1,11 +1,11 @@
|
|
1
1
|
from itertools import cycle
|
2
2
|
from typing import Sequence
|
3
3
|
from numpy import ndarray
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from
|
8
|
-
from
|
4
|
+
from utils import get_bits_required, check_pos, connect
|
5
|
+
from blueprint import Blueprint
|
6
|
+
from parts.logicgate import LogicGate
|
7
|
+
from pos import Pos
|
8
|
+
from prebuilds.decoder import decoder
|
9
9
|
|
10
10
|
|
11
11
|
def ram(bp: Blueprint, bit_length: int, num_address: int, pos: Pos | Sequence = (0, 0, 0),
|
@@ -1,10 +1,10 @@
|
|
1
1
|
from typing import Sequence
|
2
2
|
from numpy import ndarray
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from
|
3
|
+
from utils import check_pos
|
4
|
+
from blueprint import Blueprint
|
5
|
+
from parts.logicgate import LogicGate
|
6
|
+
from pos import Pos
|
7
|
+
from prebuilds.counter import counter, counter_decrement
|
8
8
|
|
9
9
|
|
10
10
|
def register(bp: Blueprint,
|
@@ -2,12 +2,12 @@ from itertools import batched, cycle
|
|
2
2
|
from math import ceil
|
3
3
|
from typing import Sequence
|
4
4
|
from numpy import ndarray
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from
|
8
|
-
from
|
9
|
-
from
|
10
|
-
from
|
5
|
+
from utils import get_bits_required, check_pos, connect, num_to_bit_list
|
6
|
+
from blueprint import Blueprint
|
7
|
+
from parts.logicgate import LogicGate
|
8
|
+
from prebuilds.decoder import decoder
|
9
|
+
from parts.timer import Timer
|
10
|
+
from pos import Pos
|
11
11
|
|
12
12
|
|
13
13
|
def rom(
|
@@ -1,19 +1,19 @@
|
|
1
1
|
from itertools import cycle
|
2
2
|
from typing import Sequence
|
3
3
|
from numpy import array, clip, ndarray
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from
|
8
|
-
from
|
9
|
-
from
|
10
|
-
from
|
11
|
-
from
|
12
|
-
from
|
13
|
-
from
|
14
|
-
from
|
15
|
-
from
|
16
|
-
from
|
4
|
+
from utils import get_bits_required, check_pos, connect, num_to_bit_list
|
5
|
+
from bases.parts.baseinteractablepart import BaseInteractablePart
|
6
|
+
from bases.parts.baselogicpart import BaseLogicPart
|
7
|
+
from blueprint import Blueprint
|
8
|
+
from constants import TICKS_PER_SECOND
|
9
|
+
from parts.logicgate import LogicGate
|
10
|
+
from parts.timer import Timer
|
11
|
+
from pos import Pos
|
12
|
+
from prebuilds.clock40hz import clock40hz
|
13
|
+
from prebuilds.counter import counter
|
14
|
+
from prebuilds.decoder import decoder
|
15
|
+
from prebuilds.ram import ram
|
16
|
+
from prebuilds.register import register
|
17
17
|
|
18
18
|
|
19
19
|
def timer_ram_cached(
|
@@ -1,14 +1,14 @@
|
|
1
1
|
from typing import Sequence
|
2
2
|
from numpy import ndarray
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from
|
8
|
-
from
|
9
|
-
from
|
10
|
-
from
|
11
|
-
from
|
3
|
+
from utils import get_bits_required, check_pos, connect
|
4
|
+
from blueprint import Blueprint
|
5
|
+
from parts.logicgate import LogicGate
|
6
|
+
from parts.timer import Timer
|
7
|
+
from pos import Pos
|
8
|
+
from prebuilds.clock40hz import clock40hz
|
9
|
+
from prebuilds.decoder import decoder
|
10
|
+
from prebuilds.ram import ram
|
11
|
+
from prebuilds.register import register
|
12
12
|
|
13
13
|
|
14
14
|
def timer_ram_multiclient(bp: Blueprint, bit_length: int, num_address: int, num_clients=1, pos: Pos | Sequence = (0, 0, 0)):
|
@@ -0,0 +1,138 @@
|
|
1
|
+
from dataclasses import asdict
|
2
|
+
from json import load, dump, loads, dumps
|
3
|
+
from math import ceil, log2
|
4
|
+
|
5
|
+
from numpy import ndarray
|
6
|
+
|
7
|
+
from .bases.parts.baseinteractablepart import BaseInteractablePart
|
8
|
+
from .blueprint import Blueprint
|
9
|
+
from .parts.barrierblock import BarrierBlock
|
10
|
+
from .parts.logicgate import LogicGate
|
11
|
+
from .parts.timer import Timer
|
12
|
+
from .pos import Pos
|
13
|
+
|
14
|
+
|
15
|
+
def load_blueprint(path):
|
16
|
+
"""Load a blueprint from a path file (normally a blueprint.json).
|
17
|
+
|
18
|
+
Args:
|
19
|
+
path (str): The path to the json file.
|
20
|
+
|
21
|
+
Returns:
|
22
|
+
Blueprint: The loaded blueprint.
|
23
|
+
"""
|
24
|
+
with open(path) as fp:
|
25
|
+
return Blueprint(**load(fp))
|
26
|
+
|
27
|
+
|
28
|
+
def save_blueprint(path, bp: Blueprint):
|
29
|
+
"""Save a blueprint to a file (normally a blueprint.json).
|
30
|
+
|
31
|
+
Args:
|
32
|
+
path (str): The path to save the json file.
|
33
|
+
bp (Blueprint): The blueprint to be saved.
|
34
|
+
"""
|
35
|
+
with open(path, mode="w") as fp:
|
36
|
+
return dump(asdict(bp), fp, sort_keys=True, separators=(',', ':'))
|
37
|
+
|
38
|
+
|
39
|
+
def load_string(str):
|
40
|
+
"""Load a blueprint from a json string.
|
41
|
+
|
42
|
+
Args:
|
43
|
+
str (str): The string to be loaded.
|
44
|
+
|
45
|
+
Returns:
|
46
|
+
Blueprint: The loaded blueprint.
|
47
|
+
"""
|
48
|
+
return Blueprint(**loads(str))
|
49
|
+
|
50
|
+
|
51
|
+
def dump_string(bp: Blueprint):
|
52
|
+
"""Dump a blueprint into a json-formatted string.
|
53
|
+
|
54
|
+
Args:
|
55
|
+
bp (Blueprint): The blueprint to be dumped.
|
56
|
+
|
57
|
+
Returns:
|
58
|
+
str: The json-formatted string.
|
59
|
+
"""
|
60
|
+
return dumps(asdict(bp), sort_keys=True, separators=(',', ':'))
|
61
|
+
|
62
|
+
|
63
|
+
def connect(_from, _to, *, parallel=True):
|
64
|
+
"""Connect interactable parts together, recursively.
|
65
|
+
|
66
|
+
Args:
|
67
|
+
_from (Any): Must be an instance of BaseInteractablePart or a subclass.
|
68
|
+
Also it can be any nested iterable of instances (list of parts, list of lists of parts, etc).
|
69
|
+
_to (Any): Must be an instance of BaseInteractablePart or a subclass.
|
70
|
+
Also it can be any nested iterable of instances (list of parts, list of lists of parts, etc).
|
71
|
+
parallel (bool, optional): Defines the behaviour of the connections in the following way:
|
72
|
+
|
73
|
+
With parallel=False, everything connects to everything:
|
74
|
+
from1 🔀 to1
|
75
|
+
|
76
|
+
from2 🔀 to2
|
77
|
+
|
78
|
+
With parallel=True, every row is connected respectively:
|
79
|
+
from1 → to1
|
80
|
+
|
81
|
+
from2 → to2
|
82
|
+
|
83
|
+
Also, if the dimensions does not match it tries to adapt (many to one, one to many, etc)
|
84
|
+
|
85
|
+
Defaults to True.
|
86
|
+
"""
|
87
|
+
if isinstance(_from, BaseInteractablePart) and isinstance(_to, BaseInteractablePart):
|
88
|
+
_from.connect(_to)
|
89
|
+
return
|
90
|
+
if parallel: # Try connect things row-by-row if possible (one to one, one to many, many to many)
|
91
|
+
if not isinstance(_from, BaseInteractablePart) and not isinstance(_to, BaseInteractablePart): # Assume both are sequence of parts
|
92
|
+
for subfrom, subto in zip(_from, _to):
|
93
|
+
connect(subfrom, subto, parallel=parallel)
|
94
|
+
elif not isinstance(_from, BaseInteractablePart): # Assume _from is a sequence of parts
|
95
|
+
for subfrom in _from:
|
96
|
+
connect(subfrom, _to, parallel=parallel)
|
97
|
+
else: # Assume _to is a sequence of parts
|
98
|
+
for subto in _to:
|
99
|
+
connect(_from, subto, parallel=parallel)
|
100
|
+
else: # Just connect everything to everything lol
|
101
|
+
if not isinstance(_from, BaseInteractablePart) and not isinstance(_to, BaseInteractablePart): # Assume both are sequence of parts
|
102
|
+
for subfrom in _from:
|
103
|
+
for subto in _to:
|
104
|
+
connect(subfrom, subto, parallel=parallel)
|
105
|
+
elif not isinstance(_from, BaseInteractablePart): # Assume _from is a sequence of parts
|
106
|
+
for subfrom in _from:
|
107
|
+
connect(subfrom, _to, parallel=parallel)
|
108
|
+
else: # Assume _to is a sequence of parts
|
109
|
+
for subto in _to:
|
110
|
+
connect(_from, subto, parallel=parallel)
|
111
|
+
|
112
|
+
|
113
|
+
def check_pos(pos):
|
114
|
+
if not isinstance(pos, Pos):
|
115
|
+
pos = Pos(*pos)
|
116
|
+
return pos
|
117
|
+
|
118
|
+
|
119
|
+
def get_bits_required(number: int | float):
|
120
|
+
"""Calculates how many bits are required to store this number.
|
121
|
+
|
122
|
+
Args:
|
123
|
+
number (int | float): The target number.
|
124
|
+
"""
|
125
|
+
return ceil(log2(number))
|
126
|
+
|
127
|
+
|
128
|
+
def num_to_bit_list(number: int, bit_length: int):
|
129
|
+
"""Converts a number to a numpy array of its bits.
|
130
|
+
|
131
|
+
Args:
|
132
|
+
number (int): The number to convert.
|
133
|
+
bit_length (int): The number of bits the list will have.
|
134
|
+
"""
|
135
|
+
output = ndarray(bit_length, dtype=bool)
|
136
|
+
for b in range(bit_length):
|
137
|
+
output[b] = bool((number >> b) & 1)
|
138
|
+
return output
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: sm_blueprint_lib
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.5
|
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
|
@@ -10,6 +10,7 @@ License-File: LICENSE
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
12
12
|
Requires-Python: >=3.8
|
13
|
+
Requires-Dist: numpy
|
13
14
|
Description-Content-Type: text/markdown
|
14
15
|
|
15
16
|
# sm_blueprint_lib
|
@@ -0,0 +1,29 @@
|
|
1
|
+
sm_blueprint_lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
sm_blueprint_lib/blueprint.py,sha256=Tho8A12jjmRJQ0tImks8h05mF72Mm2TIWiQJoZ13bXg,1077
|
3
|
+
sm_blueprint_lib/body.py,sha256=1WiKyMDUks1oZVZYpWgcGul-QR3uY12zkhovaDPCEcg,363
|
4
|
+
sm_blueprint_lib/bounds.py,sha256=fH-i8PdlZVg8qlEd3FmIf5mbx4RKhdBOFRAe5cSWWiI,183
|
5
|
+
sm_blueprint_lib/constants.py,sha256=mll05HrWLGCETzvQlkDPRMBe5HJLAGn5rRkxs5gJ71E,710
|
6
|
+
sm_blueprint_lib/id.py,sha256=5sBHC8qZJnCaizSBs4KGS1dnZHOSdoq5wkuIpuYNRnw,71
|
7
|
+
sm_blueprint_lib/pos.py,sha256=W0yaIg_nYgRqFwSkHlpd7Tfr69XSVwjTY1DfICHXoDo,411
|
8
|
+
sm_blueprint_lib/utils.py,sha256=g3psyklJ6D1PvyL-MQPDN1TqW7Q1JVr1eSuoIdJy0Ro,4819
|
9
|
+
sm_blueprint_lib/bases/controllers/basecontroller.py,sha256=jYzF8rtPhj1l5VLUd6y4nPrnt339y3v6QeNn-v-WfYI,618
|
10
|
+
sm_blueprint_lib/bases/controllers/baselogiccontroller.py,sha256=N9Vi4D4bn2TAR06JTuIPvTe9FKp_xqx_cKXqOa0TUGU,307
|
11
|
+
sm_blueprint_lib/bases/controllers/logicgatecontroller.py,sha256=AaB_GiFFJPZm0ldezG4iV2KiR7JnkTx2jjgG5fCDM_Q,240
|
12
|
+
sm_blueprint_lib/bases/controllers/sensorcontroller.py,sha256=UHWq7kdO6BV_tZS9mCQxsOba3BN34EA9lPw9nyv7IQo,727
|
13
|
+
sm_blueprint_lib/bases/controllers/timercontroller.py,sha256=GIdqtpkBXajjmA5DYc2th7jbErSLOxt_-dKmZsNR0YE,246
|
14
|
+
sm_blueprint_lib/prebuilds/adder.py,sha256=21mAQiaJ_5iejnT_3j-iv47A9kF--QwRC8qGHzvOl3g,1742
|
15
|
+
sm_blueprint_lib/prebuilds/barrel_shifter.py,sha256=w5uC1ehi1Kdq1X8D9Cl58OBm2ybpH00gGHCicIToWxw,3548
|
16
|
+
sm_blueprint_lib/prebuilds/clock40hz.py,sha256=1d4-AXj3KcYWqwv5PE834hKKkvOQ1E-PeTmflJpvxSg,836
|
17
|
+
sm_blueprint_lib/prebuilds/comparator.py,sha256=eAIWsbL4dIxEk4vqZrNPBzOm5OXNUv4Jsp9nWehLkiI,2197
|
18
|
+
sm_blueprint_lib/prebuilds/counter.py,sha256=EfNmruHBFLJcAtzxv6w2MRH9d5X5qQV9wAReOUe8Mfo,2540
|
19
|
+
sm_blueprint_lib/prebuilds/decoder.py,sha256=U8UvKQlaRkzrPxa2-iqZov6bjKwKMLL2SZqknXI0Re0,2069
|
20
|
+
sm_blueprint_lib/prebuilds/distance_sensor.py,sha256=SLujbaZKIZMEB5wbtmqcASO22XM1UAfKxPjKZZ5m3_I,1725
|
21
|
+
sm_blueprint_lib/prebuilds/ram.py,sha256=6J7YBWl_lisdEtGRvPllSoSF0O2fFGDAx-9FYWXif-E,4202
|
22
|
+
sm_blueprint_lib/prebuilds/register.py,sha256=VYkoAIwgp3GPepea6_MBdTrDlsfxnk7p0QZHRVAk00k,2665
|
23
|
+
sm_blueprint_lib/prebuilds/rom.py,sha256=xdahMSTXu4q0sZXYC_Y1bTmA3J-QE5AqB3_eUUBmVL8,3688
|
24
|
+
sm_blueprint_lib/prebuilds/timer_ram_cached.py,sha256=op0A-5T42PoFJJrrdjvtDJV0_B3JYNojYumg6gI2_cM,19031
|
25
|
+
sm_blueprint_lib/prebuilds/timer_ram_multiclient.py,sha256=BIyvse6hPO3k8rrr-Ckw37_TDYoPyA8AjT8wtHczv2A,4182
|
26
|
+
sm_blueprint_lib-0.0.5.dist-info/METADATA,sha256=ECrEspXOyXCa4KJ-1OctL7fm1iJMGQwPAXmPQDc9jLs,611
|
27
|
+
sm_blueprint_lib-0.0.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
28
|
+
sm_blueprint_lib-0.0.5.dist-info/licenses/LICENSE,sha256=DWhaodryTSEv07KdWbanCMaEujOXYxnj-IEhmgTkOq0,1084
|
29
|
+
sm_blueprint_lib-0.0.5.dist-info/RECORD,,
|
@@ -1,28 +0,0 @@
|
|
1
|
-
sm_blueprint_lib/__init__.py,sha256=9ktxwUvthBopqAAg6vPnLAwiOP97nnLpPcH2wY-weG0,4915
|
2
|
-
sm_blueprint_lib/blueprint.py,sha256=foTUnSeMMcpfTKL-NnhkYE9vUX8QqG5qndTDVnaJ8Ps,1128
|
3
|
-
sm_blueprint_lib/body.py,sha256=6Daa4mjUwrBYQjowTbDozEWsESVTtkhqW4441TwZJDM,397
|
4
|
-
sm_blueprint_lib/bounds.py,sha256=fH-i8PdlZVg8qlEd3FmIf5mbx4RKhdBOFRAe5cSWWiI,183
|
5
|
-
sm_blueprint_lib/constants.py,sha256=mll05HrWLGCETzvQlkDPRMBe5HJLAGn5rRkxs5gJ71E,710
|
6
|
-
sm_blueprint_lib/id.py,sha256=5sBHC8qZJnCaizSBs4KGS1dnZHOSdoq5wkuIpuYNRnw,71
|
7
|
-
sm_blueprint_lib/pos.py,sha256=W0yaIg_nYgRqFwSkHlpd7Tfr69XSVwjTY1DfICHXoDo,411
|
8
|
-
sm_blueprint_lib/bases/controllers/basecontroller.py,sha256=wWz2dMvBzBG9Zn1l_sZf5L-L5lwNRMhNTynFSLC4KPs,652
|
9
|
-
sm_blueprint_lib/bases/controllers/baselogiccontroller.py,sha256=PNQhukaP8jceHs7O3b33xbKalS1Bym8x5T4ZN7XNGyQ,324
|
10
|
-
sm_blueprint_lib/bases/controllers/logicgatecontroller.py,sha256=g-Cla8kvFA77KQkAMbRxfyS_tvjFaIf6GJjOfsQ1FsY,257
|
11
|
-
sm_blueprint_lib/bases/controllers/sensorcontroller.py,sha256=K_nE8RmQSCxXAEiwpWeMSpeZtxXePbn_BDbgkkgMtEM,744
|
12
|
-
sm_blueprint_lib/bases/controllers/timercontroller.py,sha256=q0eusjpJ2EQ82mfxMHJP6ok5QH29eqIUpkzNfGLGsAQ,263
|
13
|
-
sm_blueprint_lib/prebuilds/adder.py,sha256=eWABQFvpuB2hHosMzD2LgJkdn_rLh00Wptc75UR8eT4,1804
|
14
|
-
sm_blueprint_lib/prebuilds/barrel_shifter.py,sha256=soDQWvOCfSNo3G3HXjglIfjte-QCil72SpwQDDDS7UE,3610
|
15
|
-
sm_blueprint_lib/prebuilds/clock40hz.py,sha256=XOEe1pthSGnVznU64itpzUMYCNsAJS-nrNxftgY-vJ0,898
|
16
|
-
sm_blueprint_lib/prebuilds/comparator.py,sha256=FuEz72Bh7G5yKHiuApnaF_mjuW-fwikxgjOUXK2H4UE,2259
|
17
|
-
sm_blueprint_lib/prebuilds/counter.py,sha256=zsfC6UKDH9PPrb9dDcM8G80_-QIPk9wAFYlu4US6eao,2602
|
18
|
-
sm_blueprint_lib/prebuilds/decoder.py,sha256=Ofso078Llj5Wu__9k0E_Q9-rREZu294piifdpA4mqGM,2131
|
19
|
-
sm_blueprint_lib/prebuilds/distance_sensor.py,sha256=RWvaoPYJySkjcrD6gfugho26QxQGc1Ub-Wmox8gUtdI,1821
|
20
|
-
sm_blueprint_lib/prebuilds/ram.py,sha256=YGzalt72H5vYKxcVqNkXLm_VbcoyebGlmRRp8oiTfZM,4281
|
21
|
-
sm_blueprint_lib/prebuilds/register.py,sha256=Y66NazPvjhajMQqBA4dwtdoFAxiwpeHBu8WMqbymUAA,2744
|
22
|
-
sm_blueprint_lib/prebuilds/rom.py,sha256=74rNXxVUCqvdsPhsUW7gLI-f2-jQa4-CWT04uyUAQAE,3784
|
23
|
-
sm_blueprint_lib/prebuilds/timer_ram_cached.py,sha256=EFEQP-fOt9M5U_tM3WdwwPFjr70BzbD_U1Ay4jfCTzo,19246
|
24
|
-
sm_blueprint_lib/prebuilds/timer_ram_multiclient.py,sha256=76domx9N9WelMIxIxTX4i-S66B6wTItOPIlXj1KIYdE,4329
|
25
|
-
sm_blueprint_lib-0.0.3.dist-info/METADATA,sha256=BjbIhOrYvraWPTlAiu3OYgAxhGStvLg1e4mL9rRP3-g,590
|
26
|
-
sm_blueprint_lib-0.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
27
|
-
sm_blueprint_lib-0.0.3.dist-info/licenses/LICENSE,sha256=DWhaodryTSEv07KdWbanCMaEujOXYxnj-IEhmgTkOq0,1084
|
28
|
-
sm_blueprint_lib-0.0.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|