Open btrotta-bom opened 2 years ago
We should consider duplicating the solution in #3283.
Is Iris' array_equal()
still appropriate in the places where it is being used?
While the problem is similar, I don't think it is due to a use of array_equal()
in this case. It seems as though the problem here is due to comparisons between Cell
s defined here: https://github.com/SciTools/iris/blob/5eeb2c02215122c038c60e76b784cdb37f8a1d94/lib/iris/coords.py#L1349-L1373
If a Cell
containing a NaN was equal to another Cell
containing a NaN, I think this would solve our problem. It ought to be possible to do this without changing Cell
equality behaviour, though that might involve a bit more of a rewrite of the merge code.
Due to changes in Python 3.10, the approach I took to fix this no longer seems viable. Until we come up with a better solution, #4701 has been reverted so this issue is reopened.
ℹ Feel free to ask @stephenworsley for info if you pick this up!
We think that #5713 should now have resolved this. Do you think that is the case, so can maybe close this @btrotta-bom ?
Merge seems to treat scalar coordinates differently when they have value NaN. I am trying to merge a list of cubes, each of which has a scalar coordinate with the same value. If this value is not NaN, the merge works as expected: the resulting cube has a scalar coordinate identical to the one in the input cubes. But if the value is NaN, this coordinate becomes 2-dimensional in the result.
Example below: