PySpice icon indicating copy to clipboard operation
PySpice copied to clipboard

LosslessTransmissionLine cannot be cloned

Open fblanchetNaN opened this issue 4 years ago • 2 comments

Environment (OS, Python version, PySpice version, simulator)

Linux, 3.8.10, 1.5, irrelevant

Expected Behaviour

Clone a circuit

Actual Behaviour

NameError: Either TD or F, NL must be specified

Steps to reproduce the behaviour

circuit = Circuit("title")
circuit.LosslessTransmissionLine('A', circuit.gnd, circuit.gnd, circuit.gnd, circuit.gnd,
                                 impedance=50@u_Ohm, frequency=6@u_GHz, normalized_length=0.25)
circuit_capa.clone()

fblanchetNaN avatar Oct 14 '21 13:10 fblanchetNaN

Try this patch. I think it should resolve the issue. I have a feeling this may be a bug throughout the codebase.

https://github.com/FabriceSalvaire/PySpice/pull/309/commits/896bfc3f43636dab53e655d25dac3fd56875d499

thejackal360 avatar Jan 21 '22 18:01 thejackal360

I did a quick search through the codebase. This appears to be the only instance of the bug. I cooked up a cleaner fix here. I would patch it on top of the previous commit.

50d2b954442ea2dcfd8b6d2a9f4daa696b3ef3ed

thejackal360 avatar Jan 24 '22 02:01 thejackal360