Make LabelledDataGroup more consistent with xarray
This MR fixes the bugs in the LabelledDataGroup
s 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
andisel
) is reworked such that it, in particular, takes care of parsing thedrop
argument correctly and handling scalar coordinates asxarray
.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., theshape
,coords
, etc. properties should return the respective property of themember_map
(creating it if not available).
Other improvements/features:
-
Add a(not feasible)squeeze
method -
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 -
Changes follow coding guidelines -
Checked code coverage on new and adjusted code
-
-
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
Closes #234 (closed), #204 (closed)