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

Prevent modifications to input data during array checks. #7

Merged
merged 1 commit into from
Mar 26, 2023

Conversation

jedludlow
Copy link
Contributor

assert_2d_sort function was modifying its inputs during the sort call. We should make this sort happen on a copy of the data so we don't produce side effects.

It turns out that numpy.array.reshape sometimes produces a view and is not guaranteed to make a copy, hence the need to create an explicit copy prior to sorting.

assert_2d_sort function was modifying its inputs during
the sort call. We should make this sort happen on a copy
of the data so we don't produce side effects.
@cjekel
Copy link
Owner

cjekel commented Mar 26, 2023

Wow that's a nasty bug that would cause some hair to be pulled out.

This LGTM! Thanks!

@cjekel cjekel merged commit cdd985b into cjekel:master Mar 26, 2023
@jedludlow jedludlow deleted the no-side-effects branch March 26, 2023 21:08
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.

2 participants