-
Notifications
You must be signed in to change notification settings - Fork 21
feat: add drop_coords and masks to bins #3518
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There was a suggestion in the original issue to not add a new method to But I decided to not do that for now, since then it would not be possible to drop only the inner coords. |
|
Can you also use this addition in the place linked in the issue? |
src/scipp/core/binning.py
Outdated
| if x.bins is None: | ||
| x = x.drop_coords(drop) | ||
| else: | ||
| content = x.bins.constituents | ||
| content['data'] = content['data'].drop_coords(drop) | ||
| x = x.copy(deep=False) | ||
| x.data = _cpp._bins_no_validate(**content) | ||
| x = x.bins.drop_coords(drop) | ||
| return x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this just return da.drop_coords(drop) (see the alias da defined in line 418)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you're right
614a4d3 to
cd80efc
Compare
cd80efc to
f4655cd
Compare
Fixes #3496