We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since #3028, we can partially collapse a multidimesional auxcoord, which is great. However, it goes wrong if that auxcoord has bounds. Example:
import iris import numpy as np print(iris.__version__) cube = iris.cube.Cube(np.zeros((2, 3))) coord1 = iris.coords.DimCoord(range(2), long_name='foo') coord2 = iris.coords.DimCoord(range(3), long_name='bar') spanning_bounds = np.stack([np.arange(6), np.arange(1, 7)], axis=-1) spanning_points = np.mean(spanning_bounds, axis=-1) spanning_coord = iris.coords.AuxCoord( spanning_points.reshape(2, 3), bounds=spanning_bounds.reshape(2, 3, 2), long_name='spanning') for i, coord in enumerate([coord1, coord2]): cube.add_dim_coord(coord, i) cube.add_aux_coord(spanning_coord, (0, 1)) print(cube.collapsed('foo', iris.analysis.MEAN))
Output:
2.2.0 [warnings about metadata] Traceback (most recent call last): File "2d_coord_issue.py", line 24, in <module> print(cube.collapsed('foo', iris.analysis.MEAN)) File "[site-packages-path]/iris/cube.py", line 3217, in collapsed collapsed_cube.replace_coord(coord.collapsed(local_dims)) File "[site-packages-path]/iris/cube.py", line 1149, in replace_coord self.add_aux_coord(new_coord, dims) File "[site-packages-path]/iris/cube.py", line 949, in add_aux_coord self._add_unique_aux_coord(coord, data_dims) File "[site-packages-path]/iris/cube.py", line 981, in _add_unique_aux_coord data_dims = self._check_multi_dim_metadata(coord, data_dims) File "[site-packages-path]/iris/cube.py", line 973, in _check_multi_dim_metadata metadata.shape[i])) ValueError: Unequal lengths. Cube dimension 0 => 3; metadata 'spanning' dimension 0 => 2.
The text was updated successfully, but these errors were encountered:
Fixed at #3302.
Sorry, something went wrong.
rcomer
No branches or pull requests
Since #3028, we can partially collapse a multidimesional auxcoord, which is great. However, it goes wrong if that auxcoord has bounds. Example:
Output:
The text was updated successfully, but these errors were encountered: