Skip to content

Fix the push method when the limit parameter is bigger than the chunk… #9940

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

Merged
merged 7 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion xarray/core/dask_array_ops.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import math
from functools import partial

from xarray.core import dtypes, nputils

Expand Down
25 changes: 17 additions & 8 deletions xarray/tests/test_duck_array_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,13 +1010,24 @@ def test_least_squares(use_dask, skipna):
@requires_bottleneck
@pytest.mark.parametrize("method", ["sequential", "blelloch"])
@pytest.mark.parametrize(
"arr", [
"arr",
[
[np.nan, 1, 2, 3, np.nan, np.nan, np.nan, np.nan, 4, 5, np.nan, 6],
[
np.nan, np.nan, np.nan, 2, np.nan, np.nan, np.nan, 9, np.nan,
np.nan, np.nan, np.nan
]
]
np.nan,
np.nan,
np.nan,
2,
np.nan,
np.nan,
np.nan,
9,
np.nan,
np.nan,
np.nan,
np.nan,
],
],
)
def test_push_dask(method, arr):
import bottleneck
Expand All @@ -1029,9 +1040,7 @@ def test_push_dask(method, arr):
expected = bottleneck.push(arr, axis=0, n=n)
for c in chunks:
with raise_if_dask_computes():
actual = push(
da.from_array(arr, chunks=c), axis=0, n=n, method=method
)
actual = push(da.from_array(arr, chunks=c), axis=0, n=n, method=method)
np.testing.assert_equal(actual, expected)


Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy