Skip to content

Make LabelledDataGroup more consistent with xarray

This MR fixes the bugs in the LabelledDataGroups sel and isel methods occurring for scalar indexers as described in #234 (closed), and makes the group more consistent with xarray overall (mainly by staying as close as possible to the member_map internally); see also #158 (closed).

Details

  • The bugs are mostly due to dimension and coordinate information beeing passed on wrongly. The data selection (via sel and isel) is reworked such that it, in particular, takes care of parsing the drop argument correctly and handling scalar coordinates as xarray.

    Regarding the latter: An error should be raised on conflicting (scalar) coordinate information, i.e. when there is scalar (!) coordinate information on the (deep) member-level that does not match an overlapping coordinate on the group-level.

  • Whenever possible, the member_map should be kept as the core of any method/modification. E.g., the shape, coords, etc. properties should return the respective property of the member_map (creating it if not available).

Other improvements/features:

  • Add a squeeze method (not feasible)
  • Documentation improvements

Anything to double-check?

  • Is the (strict) error on conflicting scalar coords okay? Should it be optional behavior?

Can this MR be accepted?

  • Implementation ready
  • Tests added or adjusted
  • Documentation extended or updated
  • Code quality
  • Ready for merging
    • Pipeline passes without warnings
    • History cleaned-up or squash option set
    • Changelog entry added
    • Version number bumped
    • Reviewed & approved by @

Related issues

#158 (closed)

Closes #234 (closed), #204 (closed)

Edited by Utopia Developers

Merge request reports