-
Notifications
You must be signed in to change notification settings - Fork 2
Description
For native python-seabreeze, if the device has not be opened (dev.open(), usually called in seabreeze.spectrometers.Spectrometer.__init__ ), and some data is requested from the device, it will raise a seabreeze.cseabreeze._wrapper.SeaBreezeError error. This is only relevant if either you are trying to open the same device multiple times (in which case you also need to close the device too), or if you are directly using the seabreeze.cseabreeze.SeaBreezeDevice object which needs to be manually opened.
We should add something like a __assert_open() method to the seatease.cseatease.SeaTeaseDevice object which gets invoked inside every data requesting method call, so that it can raise a SeaBreezeError if the device hasn't been opened.
Also, the seatease.spectrometers.Spectrometer init function should also open the device, and it should be given .open() and .close() wrappers.