yaq-project / yaq-python

Repository for yaq core python packages.
https://yaq.fyi
GNU Lesser General Public License v3.0
6 stars 5 forks source link

fake spectrometer does not properly update mapping id #31

Open ksunden opened 1 year ago

ksunden commented 1 year ago

https://github.com/yaq-project/yaq-python/blob/c686c3472e935dd4a9ae412cc327dd31b56e4146/yaqd-fakes/yaqd_fakes/_fake_spectrometer.py#L28

Since we use set_item here, the mapping id does not get updated by the mix-in class, which requires that you do specifically self._mappings = new_mapping.

I expect this may be a common error, perhaps we should look into solutions to make the version that at least rewrites the top level of entries automatically properly increment mapping_id.

ksunden commented 1 year ago

Additionally, the mapping is not computed until a measurement is taken, so if you ask for mapping first it will be outdated.