Skip to content

Conversation

@DPeterK
Copy link
Member

@DPeterK DPeterK commented May 31, 2017

If you print a cube with a bounded derived coordinate it realises the lazy bounds of the coordinates from which the derived coordinate is derived: 😱

>>> cube = iris.load_cube(iris.sample_data_path('hybrid_height.nc'))
>>> aux_coord = cube.coord('sigma')
>>> print aux_coord.has_lazy_points()
True
>>> print aux_coord.has_lazy_bounds()
True

>>> print cube

>>> print aux_coord.has_lazy_points()
True
>>> print aux_coord.has_lazy_bounds()
False

More accurately, printing a cube with a derived (bounded) coordinate triggers the deferred construction of the derived coordinate. If this derived coordinate is bounded then an oversight in the code that calculates the derived coordinate from the dependency coordinates, such as sigma in the example above, would cause the bounds to be accessed directly and so realise the bounds.

Copy link
Member

@corinnebosley corinnebosley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a test. Does it also need a What's New entry?

@bjlittle
Copy link
Member

bjlittle commented Jun 7, 2017

Closed by #2590

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants