sandialabs / pyscan

Scientific Measurement Toolbox
https://pyscan.readthedocs.io/en/latest/
MIT License
4 stars 4 forks source link

bug: save_metadata fails with actual instruments #219

Open mplilly4395 opened 3 weeks ago

mplilly4395 commented 3 weeks ago

Pyscan crashes when starting the experiment with real instruments. The issue is that one way we make drives is to have a GPIBInstrument class that is saved as an attribute to the driver. The JSON encoding step for save metadata crashes when it tries to serialize this object.

There are likely other pyvisa and other instrument driver objects that fail when pyscan tries to serialize them (USB instruments, Thorlabs and other specialized drivers, etc.).

The initial fix is easy, but having a safe fail for unknown objects is probably required.