Skip to content
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

Add example for xarray groupby reduction causing memory pressure #1528

Merged
merged 8 commits into from
Aug 20, 2024

Conversation

phofl
Copy link
Contributor

@phofl phofl commented Aug 13, 2024

each query runs around 50s, we are fine with spot-with-fallback since we mostly care about memory pressure

cluster_kwargs.yaml Outdated Show resolved Hide resolved
Co-authored-by: Florian Jetter <[email protected]>
clim = arr.groupby("day").mean(dim="time")
anom = arr.groupby("day") - clim
anom_mean = anom.mean(dim="time")
with xarray.set_options(use_flox=False):
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest moving the xarray-related tests to test_xarray.py.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd rather do this as a follow up, but the general idea is good

],
)
def test_xarray_groupby_reduction(group_reduction_client, func):
pytest.importorskip("xarray")
Copy link
Member

Choose a reason for hiding this comment

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

Let's move these to the top of the module. There's no need to spin up clusters if we don't have xarray installed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@hendrikmakait hendrikmakait left a comment

Choose a reason for hiding this comment

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

Thanks, @phofl!

@hendrikmakait hendrikmakait merged commit d216c83 into main Aug 20, 2024
15 checks passed
@hendrikmakait hendrikmakait deleted the phofl/xarray-reduction branch August 20, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants