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
aggregated_by
collapsed
Following on from #4315, #1528. When handling integer coordinates, collapsed and aggregated_by produce inconsistent points.
Minimal example:
import iris import iris.cube import iris.coords import numpy as np N = 6 cube = iris.cube.Cube(range(N), long_name="foo") dim_coord = iris.coords.DimCoord(range(N), long_name="bar") aux_coord = iris.coords.AuxCoord(np.arange(N) // 2, long_name="baz") cube.add_dim_coord(dim_coord, 0) cube.add_aux_coord(aux_coord, 0) print(cube.aggregated_by("baz", iris.analysis.MEAN).coord("bar")) # Emulate aggregated_by procedure with extract and collapsed. for baz_val in np.unique(aux_coord.points): constraint = iris.Constraint(baz=baz_val) sub_cube = cube.extract(constraint) mean = sub_cube.collapsed("bar", iris.analysis.MEAN) print(mean.coord("bar"))
"bar" coord after aggregated_by:
DimCoord(array([0.5, 2.5, 4.5]), bounds=array([[0, 1], [2, 3], [4, 5]]), standard_name=None, units=Unit('unknown'), long_name='bar')
"bar" coords after extract and collapse:
extract
collapse
DimCoord(array([0]), bounds=array([[0, 1]]), standard_name=None, units=Unit('unknown'), long_name='bar') DimCoord(array([2]), bounds=array([[2, 3]]), standard_name=None, units=Unit('unknown'), long_name='bar') DimCoord(array([4]), bounds=array([[4, 5]]), standard_name=None, units=Unit('unknown'), long_name='bar')
The output points should either be 0, 2, 4 in both cases, or 0.5, 2.5, 4.5 in both cases. Note that @pp-mo at #1528 expected integer output points.
The text was updated successfully, but these errors were encountered:
In order to maintain a backlog of relevant issues, we automatically label them as stale after 500 days of inactivity.
If this issue is still important to you, then please comment on this issue and the stale label will be removed.
Otherwise this issue will be automatically closed in 28 days time.
Sorry, something went wrong.
We cannot do anything about this until next major release. Perhaps we should have the stalebot ignore issues with that label?
#5559
No branches or pull requests
🐛 Bug Report
Following on from #4315, #1528. When handling integer coordinates,
collapsed
andaggregated_by
produce inconsistent points.How To Reproduce
Minimal example:
"bar" coord after
aggregated_by
:"bar" coords after
extract
andcollapse
:Expected behaviour
The output points should either be 0, 2, 4 in both cases, or 0.5, 2.5, 4.5 in both cases. Note that @pp-mo at #1528 expected integer output points.
Environment
The text was updated successfully, but these errors were encountered: