Open JacobHast opened 2 months ago
You're right, creating multiple QuamRoot objects causes issues because QuamBase._root
is always set to the latest QuAM, which is needed for absolute referencing to work.
However, I don't see a straightforward solution for this. There are several situations where one would create a new QuamRoot object. For instance, if one is running a live kernel and loads QuAM multiple times.
I will keep this open, but for now I don't see a solution that wouldn't introduce significant overhead. @JacobHast if you have suggestions please let me know
I see. Would it be possible to add a warning when creating a new root if a root already exists to facilitate debugging?
At least for now I wouldn't want it as a warning because that usually shows up by default. I could do logging.info
, which will or will not show up depending on the log filtering. Does that work?
When initializing multiple quam roots in a single script something appears to go wrong with referencing. I'm not sure when it makes sense to initialize multiple quams, but in my case this has caused some hard-to-find bugs when testing various things out. If initializing multiple roots is not allowed, maybe a suggestion would be to raise an error if it happens.