8000 map_overlap does not trim properly with new_axis when input array has more than 2 dimensions · Issue #11961 · dask/dask · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

map_overlap does not trim properly with new_axis when input array has more than 2 dimensions #11961

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

Open
joshua-gould opened this issue May 21, 2025 · 0 comments
Labels
needs triage Needs a response from a contributor

Comments

@joshua-gould
Copy link

Minimal Complete Verifiable Example:

import dask.array as da
import numpy as np


def process_chunk(x):
    return np.ones(shape=(2,) + x.shape)


# fails with 3d array
a = da.random.random((4, 100, 100)).rechunk((4, 10, 10))
result_shape = da.map_overlap(
    process_chunk,
    a,
    new_axis=0,
    depth={0: 0, 1: 2, 2: 2},
    trim=True,
    boundary="none",
).compute().shape
assert result_shape[1:] == a.shape, f"{result_shape} != {a.shape}"

# works with 2d array
a = da.random.random((100, 100)).rechunk((10, 10))
result_shape = da.map_overlap(
    process_chunk,
    a,
    new_axis=0,
    depth={0: 2, 1: 2},
    trim=True,
    boundary="none",
).compute().shape
assert result_shape[1:] == a.shape, f"{result_shape} != {a.shape}"

Environment:

  • Dask version: 2025.5.1
  • Python version: 3.12
  • Operating System: Linux
  • Install method: pip
@github-actions github-actions bot added the needs triage Needs a response from a contributor label May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Needs a response from a contributor
Projects
None yet
Development

No branches or pull requests

1 participant
0