Open jbayless opened 4 years ago
Thanks for the detailed report! I'll take a look at it.
Well, you tried just about every possible variation to make this work! I made some fixes so that methods #1 and #2 now work. You can also use method #3, but you have to change the package calls to avg1 = analog_average(circuit=cct, cct=cct)
which seems rather pointless.
You can install the latest changes using:
pip install git+https://github.com/xesscorp/skidl@development
I'm still working on this. I think I can make Method #4 work.
Describe the bug The new
@package
decorator seems very exciting, but it appears to assume the use of the globaldefault_circuit
object. I aim to write code that modifies as little global state as possible, so I've been usingCircuit
objects that I create. But they don't seem to be interoperable with packages, or at least, I apparently don't know how to do so.To Reproduce I've attempted several methods of using packages with circuits. I'll enumerate through the ones I've tried.
1) Pass a circuit as a keyword argument to the package, without any corresponding keyword argument in the function definition.
Output:
2) Add a "circuit" keyword argument to the function definition:
Output:
3) Add a differently-named keyword argument to the function definition and pass that to the package components as the circuit:
Output:
4) Use the += operators to add packages to a circuit, the way you can for parts. But since those parts don't actually seem to be in the circuit, I can't reference them, so I don't try to make connections here...
Outputs:
(But the netlist it outputs has no nets and no components).
5) Same as method 2, but this time forget to pass the
circuit
argument to theNet
s:Output:
Expected behavior I'd expect at least one of the above methods to produce similar results as I'd get from the following code:
which produces the following netlist:
Desktop (please complete the following information):