-
Notifications
You must be signed in to change notification settings - Fork 199
Open
Description
Environment (OS, Python version, PySpice version, simulator)
OS: Linux zealoft 5.11.0-1006-gcp #6-Ubuntu SMP Wed Apr 14 21:09:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Python version: 3.9.4
PySpice version: 1.4.3
Simulator: ngSpice
Related Code
class ParallelResistor2(SubCircuit):
__nodes__ = ('n1', 'n2')
def __init__(self, name, R1=1@u_Ω, R2=2@u_Ω):
SubCircuit.__init__(self, name, *self.__nodes__)
self.R(1, 'n1', 'n2', R1)
self.R(2, 'n1', 'n2', R2)
circuit = Circuit('Test')
circuit.subcircuit(ParallelResistor2('pr1', R2=2@u_Ω))
circuit.X('1', 'pr1', 1, circuit.gnd)
circuit.subcircuit(ParallelResistor2('pr2', R2=3@u_Ω))
circuit.X('2', 'pr2', 1, circuit.gnd)
source = str(circuit)
parser = SpiceParser(source=source)
bootstrap_circuit = parser.build_circuit()
bootstrap_source = str(bootstrap_circuit)
print(bootstrap_source)
assert bootstrap_source == source
Expected Behaviour
.title Test
.subckt pr1 n1 n2
R1 n1 n2 1Ohm
R2 n1 n2 2Ohm
.ends pr1
.subckt pr2 n1 n2
R1 n1 n2 1Ohm
R2 n1 n2 3Ohm
.ends pr2
X1 1 0 pr1
X2 1 0 pr2
Actual Behaviour
.title Test
X1 1 0 pr1
X2 1 0 pr2
It seems this feature is not implemented?
Metadata
Metadata
Assignees
Labels
No labels