Skip to content

Conversation

@jl-wynen
Copy link
Member

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)

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.
@github-project-automation github-project-automation bot moved this to In progress in Development Board May 14, 2025
@jl-wynen jl-wynen moved this from In progress to Selected in Development Board May 14, 2025
"""
out = to_data_array(obj)
if isinstance(coords, str):
coords = [coords]
Copy link
Member

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?

Copy link
Member Author

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'])
Copy link
Member

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')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@jl-wynen jl-wynen merged commit 6d9bdaf into main May 19, 2025
4 checks passed
@jl-wynen jl-wynen deleted the remove-unused-coords branch May 19, 2025 09:02
@github-project-automation github-project-automation bot moved this from Selected to Done in Development Board May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants