Bug with comparing ManifestArrays using __eq__
which have fill_value
=NaN
#501
Labels
bug
Something isn't working
Originally posted by @TomNicholas in #349 (comment)
I found out what the problem is - two
ManifestArrays
with identical.metadata
will compare not equal if they both haveNaN
for afill_value
. This is because the__eq__
check introspects deeper until it finds e.g. thenp.float32(nan)
type, but(See https://stackoverflow.com/a/10059796 for why numpy NaNs behave like this.)
The solution needs to be to actually check two
Metadata
classes are__eq__
with dedicated code, not just trusting the python dataclasses' automatically-generated__eq__
method to fi it.I would ideally like to move that fix upstream into zarr-python.
The text was updated successfully, but these errors were encountered: