Right now the fill_value attribute of our metadata classes is a numpy scalar, or None, or a string (i think). This is problematic for comparing two metadata instances -- if the fill value is np.nan, then np.nan == np.nan is always false, even when the two values are in fact the same.
We could address this by disallowing numpy scalars for the fill_value attribute. Instead, we could use a custom scalar wrapper class that handles NaN correctly, or use a JSON-serializable form of the scalar, e.g. a string in the case of np.nan.
see also: #2929
Right now the
fill_valueattribute of our metadata classes is a numpy scalar, orNone, or a string (i think). This is problematic for comparing two metadata instances -- if the fill value isnp.nan, thennp.nan == np.nanis always false, even when the two values are in fact the same.We could address this by disallowing numpy scalars for the
fill_valueattribute. Instead, we could use a custom scalar wrapper class that handlesNaNcorrectly, or use a JSON-serializable form of the scalar, e.g. a string in the case ofnp.nan.see also: #2929