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

Numpy path broken with negative padding #15

Open
harskish opened this issue Oct 6, 2022 · 0 comments
Open

Numpy path broken with negative padding #15

harskish opened this issue Oct 6, 2022 · 0 comments

Comments

@harskish
Copy link

harskish commented Oct 6, 2022

The function fw_pad is supposed to perform a crop when called with negative padding values.

However, the numpy codepath raises a ValueError if np.pad() is called with negative values.
Specifically, np.pad calls _as_pairs(..., as_index=True) (link) internally which results in the error here.

I have patched the function in my fork, but I'm not sure if my fix is the most elegant.

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

No branches or pull requests

1 participant