and all these lines...
https://github.com/fmi-faim/faim-hcs/blob/4e73d599dd841bf64b5035a0fa7771023ad9b499/tests/test_UIntHistogram.py#L47
https://github.com/fmi-faim/faim-hcs/blob/4e73d599dd841bf64b5035a0fa7771023ad9b499/tests/test_UIntHistogram.py#L60
https://github.com/fmi-faim/faim-hcs/blob/4e73d599dd841bf64b5035a0fa7771023ad9b499/tests/test_UIntHistogram.py#L73
Also, there no use in adding + 1, we can have just bins == len(frequencies).
We currently don't read bins anywhere except in the tests, so I propose we change it, and also don't serialize bins as it can be computed from frequencies easily.
To preserve backwards compatibility, we should ignore bins when reading from files, and instead return len(frequencies) when asked for bins.
In addition to bins and offset, we can then maybe also serialize a version value, so if that is absent, we switch to "legacy" behavior. But that might not even be needed since we don't change how bins and offset are stored.
The
UIntHistogram
currently saves redundant data:bins
is alwayslen(frequencies) + 1
.See here:
https://github.com/fmi-faim/faim-hcs/blob/4e73d599dd841bf64b5035a0fa7771023ad9b499/tests/test_UIntHistogram.py#L26
and all these lines...
https://github.com/fmi-faim/faim-hcs/blob/4e73d599dd841bf64b5035a0fa7771023ad9b499/tests/test_UIntHistogram.py#L47 https://github.com/fmi-faim/faim-hcs/blob/4e73d599dd841bf64b5035a0fa7771023ad9b499/tests/test_UIntHistogram.py#L60 https://github.com/fmi-faim/faim-hcs/blob/4e73d599dd841bf64b5035a0fa7771023ad9b499/tests/test_UIntHistogram.py#L73Also, there no use in adding
+ 1
, we can have justbins == len(frequencies)
.We currently don't read
bins
anywhere except in the tests, so I propose we change it, and also don't serializebins
as it can be computed fromfrequencies
easily.To preserve backwards compatibility, we should ignore
bins
when reading from files, and instead returnlen(frequencies)
when asked forbins
.In addition to
bins
andoffset
, we can then maybe also serialize aversion
value, so if that is absent, we switch to "legacy" behavior. But that might not even be needed since we don't change howbins
andoffset
are stored.