Skip to content

Data._axes is not updated after a cf.Field.collapse #857

Closed

Description

@davidhassell

Data._axes is not updated after a cf.Field.collapse. If squeeze=False (the default) then this is not a problem, but if squeeze=True then the removed collapsed axes need stripping from returned Data object _axes attributes.

>>> # Current
>>> import cf
>>> f = cf.example_field(0)
>>> g = f.collapse('X: mean', squeeze=True)
>>> g.data._axes
('dim0', 'dim1')  # WRONG
>>> # Should be ...
>>> import cf
>>> f = cf.example_field(0)
>>> g = f.collapse('X: mean', squeeze=True)
>>> g.data._axes
('dim0',)  # RIGHT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions