-
Notifications
You must be signed in to change notification settings - Fork 5
Drop unused coords #448
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
Drop unused coords #448
Conversation
AFAIK, there is no need to keep all coords around. And this caused a problem in Scipp where the averaging introduced in 649064e fails for a datetime coord.
| """ | ||
| out = to_data_array(obj) | ||
| if isinstance(coords, str): | ||
| coords = [coords] |
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.
I think this means that the check
if isinstance(coords, str):
coords = [coords]further down (L231) can be removed?
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, removed
| da = data_array(ndim=2) | ||
| da.coords['xx2'] = 7.5 * da.coords['xx'] | ||
| da.coords['yy2'] = 3.3 * da.coords['yy'] | ||
| out = preprocess(da, coords=['yy2', 'xx']) |
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.
Also test the case where the arg passed as coords is a string?
e.g. preprocess(da, coords='yy2')
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.
Done
AFAIK, there is no need to keep all coords around. And this caused a problem in Scipp where the averaging introduced in #428 fails for a datetime coord. (See scipp/scipp#3695)