nanophotonics / nplab

Core functions and instrument scripts for the Nanophotonics lab experimental scripts
GNU General Public License v3.0
38 stars 15 forks source link

DumbNotifiedProperty fails when used with different objects #113

Closed eoinell closed 4 years ago

eoinell commented 4 years ago

Running https://github.com/nanophotonics/nplab/blob/python3/nplab/instrument/spectrometer/__init__.py , the variable_int_enabled and filename DumbNotifiedProperties fail to callback their registered functions. [python3]. Notified properties seem to work fine however, and notified_property's docstring works fine with but dumb and ordinary notified properties.

eoinell commented 4 years ago

I traced why the registered functions weren't being called, the WeakSetholding the callbacks was being garbage-collected. Replacing this with set fixes this issue, at the potential cost of some memory.