workflow modification, bus indexing

This commit is contained in:
Vojta Mrazek 2023-02-22 09:52:06 +01:00
parent 35240abc63
commit 43b3d65463
3 changed files with 5 additions and 2 deletions

View File

@ -84,7 +84,7 @@ jobs:
needs: build
strategy:
matrix:
python-version: [ '3.6.x', '3.7.x', '3.8.x', '3.9.x', '3.10.0-rc.2' ]
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10', '3.11' ]
name: Python ${{ matrix.python-version }} test
steps:
- uses: actions/checkout@v2

View File

@ -76,6 +76,9 @@ class Bus():
Wire: Returning wire from the bus.
"""
return self.bus[wire_index]
def __getitem__(self, i):
return self.bus[i]
# Connecting output wire of the inner circuit component to desired position in the described circuit's output bus
def connect(self, bus_wire_index: int, inner_component_out_wire: Wire, inserted_wire_desired_index: int = -1):

View File

@ -186,7 +186,7 @@ def test_direct():
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
self.out = Bus(self.prefix+"_out", self.N+1)
a_0 = self.a.get_wire(0)
a_0 = self.a[0]
b_0 = self.b.get_wire(0)
or_1 = OrGate(a_0, b_0, prefix=self.prefix+"_or"+str(self.get_instance_num(cls=OrGate)), parent_component=self)