You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extracting using a constraint on a scalar coordinate with bounds, where the value of the constraint is a non-integer outside the bounds causes an error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../iris/cube.py", line 2044, in extract
return constraint.extract(self)
File ".../iris/_constraints.py", line 151, in extract
resultant_CIM = self._CIM_extract(cube)
File ".../iris/_constraints.py", line 175, in _CIM_extract
resultant_CIM = resultant_CIM & coord_constraint.extract(cube)
File ".../iris/_constraints.py", line 273, in extract
i = coord.nearest_neighbour_index(self._coord_thing)
File ".../iris/coords.py", line 1189, in nearest_neighbour_index
result_index = np.where(inside_cells)[0][0]
IndexError: index out of bounds
The text was updated successfully, but these errors were encountered:
It turns out it doesn't matter if the coordinate is scalar. The error occurs if the dtype of the constraint is float but the dtype of the bounds is int. There's code which extends the bounds to always include the point, so that the where will always return something, but if the dtypes are different this code can fail.
Extracting using a constraint on a scalar coordinate with bounds, where the value of the constraint is a non-integer outside the bounds causes an error:
The text was updated successfully, but these errors were encountered: