Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: Fix handling of clip out= argument order properly #7873

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

Closed
wants to merge 1 commit into from
Closed

BUG: Fix handling of clip out= argument order properly #7873

wants to merge 1 commit into from

Conversation

pimdh
Copy link
Contributor

@pimdh pimdh commented Jul 27, 2016

Since fastclip doesn't allow for the in and out to have different orders, this fix forces the output to have the same order as the input.

Closes #7633

Alternatively, I could call the slow clip function in this case or change the in array to the proper order if needed. Would either of those methods be preferable?

Since fastclip doesn't allow for the in and out to have different
orders, this fix forces the output to have the same order as the in.

Closes #7633
@seberg
Copy link
Member

seberg commented Jul 27, 2016

I guess we have both kind of ways in numpy probably. I guess this might be a bit faster usually, but on the other hand going to slow mode more often when out is not great will not waste memory, and when you already use out you might be trying to save memory.
If you change it to slow mode, should probably also change it for non-contiguous out arrays, and best make a small performance check.

@seberg
Copy link
Member

seberg commented Jul 27, 2016

It would also be a nice, but a bit more involved, option to see if we can't replace the whole function with a ufunc....

@pimdh
Copy link
Contributor Author

pimdh commented Jul 28, 2016

Tried to implement a ufunc version of clip in #7876

@pimdh pimdh closed this Jul 28, 2016
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.

numpy.clip does not respect out array order
2 participants