Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joamatab committed Apr 30, 2024
1 parent 5ded186 commit 866c570
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
5 changes: 3 additions & 2 deletions tests/test_netlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ def test_netlists(
component_factory: component factory.
"""
c = component_factory[component_type]()
n = c.get_netlist()
allow_multiple = True
n = c.get_netlist(allow_multiple=allow_multiple)
if check:
data_regression.check(n)

yaml_str = OmegaConf.to_yaml(n, sort_keys=True)
c2 = gf.read.from_yaml(yaml_str, name=c.name)
n2 = c2.get_netlist()
n2 = c2.get_netlist(allow_multiple=allow_multiple)

d = jsondiff.diff(n, n2)
assert len(d) == 0, d
34 changes: 15 additions & 19 deletions tests/test_netlists/test_netlists_straight_heater_metal_.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
connections: {}
connections:
taper_1,o1: via_stack_1,e3
taper_2,o1: via_stack_2,e1
instances:
component_sequence_1:
component: component_sequence
Expand Down Expand Up @@ -79,12 +81,12 @@ instances:
width_function: null
length: 5.0
port: null
port_order_name:
port_names:
- o1
- o2
port_order_types:
- optical
- optical
port_types:
- electrical
- electrical
width1: 10.0
width2: 4.0
with_two_ports: true
Expand Down Expand Up @@ -121,12 +123,12 @@ instances:
width_function: null
length: 5.0
port: null
port_order_name:
port_names:
- o1
- o2
port_order_types:
- optical
- optical
port_types:
- electrical
- electrical
width1: 10.0
width2: 4.0
with_two_ports: true
Expand Down Expand Up @@ -216,29 +218,23 @@ placements:
ports:
l_e1: via_stack_1,e1
l_e2: via_stack_1,e2
l_e3: via_stack_1,e3
l_e3: taper_1,o1
l_e4: via_stack_1,e4
o1: component_sequence_1,o1
o2: component_sequence_1,o2
r_e1: via_stack_2,e1
r_e1: taper_2,o1
r_e2: via_stack_2,e2
r_e3: via_stack_2,e3
r_e4: via_stack_2,e4
warnings:
optical:
electrical:
unconnected_ports:
- message: 4 unconnected optical ports!
- message: 2 unconnected electrical ports!
ports:
- taper_1,o1
- taper_1,o2
- taper_2,o1
- taper_2,o2
values:
- - -4.905
- 0.0
- - 0.095
- 0.0
- - 324.905
- 0.0
- - 319.905
- 0.0

0 comments on commit 866c570

Please sign in to comment.