Browse Source

tweak repr, doc

devel
Stefan Holst 2 years ago
parent
commit
1a9cb396bf
  1. 4
      src/kyupy/circuit.py
  2. 2
      src/kyupy/sim.py

4
src/kyupy/circuit.py

@ -82,7 +82,9 @@ class Node: @@ -82,7 +82,9 @@ class Node:
def __repr__(self):
ins = ' '.join([f'<{line.index}' if line is not None else '<None' for line in self.ins])
outs = ' '.join([f'>{line.index}' if line is not None else '>None' for line in self.outs])
return f'{self.index}:{self.kind}"{self.name}" {ins} {outs}'
ins = ' ' + ins if len(ins) else ''
outs = ' ' + outs if len(outs) else ''
return f'{self.index}:{self.kind}"{self.name}"{ins}{outs}'
def remove(self):
"""Removes the node from its circuit.

2
src/kyupy/sim.py

@ -237,7 +237,7 @@ class SimOps: @@ -237,7 +237,7 @@ class SimOps:
self.level_starts = np.asarray(level_starts, dtype='int32')
self.level_stops = np.asarray(level_starts[1:] + [len(self.ops)], dtype='int32')
# state allocation table. maps line and interface indices to self.state memory locations
# combinational signal allocation table. maps line and interface indices to self.c memory locations
self.c_locs = np.full((self.c_locs_len,), -1, dtype=np.int32)
self.c_caps = np.zeros((self.c_locs_len,), dtype=np.int32)

Loading…
Cancel
Save