Skip to content
New issue

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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aux factories are not properly updated after concatenation #5339

Closed
schlunma opened this issue Jun 6, 2023 · 1 comment 路 Fixed by #5340
Closed

Aux factories are not properly updated after concatenation #5339

schlunma opened this issue Jun 6, 2023 · 1 comment 路 Fixed by #5340
Assignees

Comments

@schlunma
Copy link
Contributor

schlunma commented Jun 6, 2023

馃悰 Bug Report

In #5096, I missed to update the scalar coordinates of the new concatenated cube correctly. As a result, operations like indexing a cube fail with cryptic errors like

KeyError: 140737037761168

How To Reproduce

Steps to reproduce the behaviour:

import iris
import iris.util
from iris.cube import CubeList
from iris.coords import DimCoord

print(iris.__version__)
print("")


# Load sample data
path = iris.sample_data_path('hybrid_height.nc')
cube = iris.load(path)[0]
cube.remove_coord('time')

time_coord = DimCoord(10.0, units='days since 2000-01-01', standard_name='time')

cube_0 = iris.util.new_axis(cube)
cube_0.add_dim_coord(time_coord.copy(), 0)

cube_1 = iris.util.new_axis(cube)
cube_1.add_dim_coord(time_coord.copy(), 0)
cube_1.coord('time').points = [20.0]

cubes = CubeList([cube_0, cube_1])
concat_cube = cubes.concatenate_cube()
print(concat_cube[0, 0, 0])

Running this leads to the aforementioned KeyError.

Expected behaviour

No error.

Environment

  • OS & Version: Red Hat Enterprise Linux 8.6 (Ootpa)
  • Iris Version: 3.6.0

I will provide a fix for this shortly.

@trexfeathers
Copy link
Contributor

@SciTools/peloton: note this did not automatically close because the fix is in the v3.6.x patch branch. However we always do a 'merge back' of such branches post-release so we are comfortable closing this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants