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
If you print a cube which has two similar coordinates, there is some logic which (as far as I can tell) creates a string to distinguish the two coordinates. This logic fails if one of the coordinates happens to have attributes whose values are numpy arrays.
Traceback (most recent call last):
File "iris3_cube_print_fail.py", line 13, in <module>
print(cube)
File "[site-packages-path]/lib/python3.6/site-packages/iris/cube.py", line 2599, in __str__
return self.summary()
File "[site-packages-path]/lib/python3.6/site-packages/iris/cube.py", line 2445, in summary
vector_dim_coords, cube_header, max_line_offset
File "[site-packages-path]/lib/python3.6/site-packages/iris/cube.py", line 2423, in vector_summary
vectors, vector_summary, extra_indent
File "[site-packages-path]/lib/python3.6/site-packages/iris/cube.py", line 2215, in _summary_extra
extra = self._summary_coord_extra(coord, indent)
File "[site-packages-path]/lib/python3.6/site-packages/iris/cube.py", line 2198, in _summary_coord_extra
if attributes.setdefault(key, value) != value:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Expected behaviour
I should be able to print this cube.
Environment
OS & Version: RHEL7.9
Iris Version: v3 release candidate
The text was updated successfully, but these errors were encountered:
The error occurs even if the second coordinate has an empty attributes dictionary. Presumably because the first coordinate gets compared to itself in this loop.
🐛 Bug Report
If you print a cube which has two similar coordinates, there is some logic which (as far as I can tell) creates a string to distinguish the two coordinates. This logic fails if one of the coordinates happens to have attributes whose values are numpy arrays.
How To Reproduce
Minimal example:
Result:
Expected behaviour
I should be able to print this cube.
Environment
The text was updated successfully, but these errors were encountered: