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

Skip to content

BUG: numpy.putmask respecting writeable flag #17873

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 14 commits into from
Closed

BUG: numpy.putmask respecting writeable flag #17873

wants to merge 14 commits into from

Conversation

drskoolie
Copy link
Contributor

@drskoolie drskoolie commented Nov 29, 2020

This is fixing issue #17871.

@BvB93 BvB93 linked an issue Nov 29, 2020 that may be closed by this pull request
seberg and others added 8 commits November 29, 2020 15:58
The other path must leak, since dtype registration is permanent
(at least I think so).
The readonly flag was not being set and untested. Also the request
for a readonly buffer incorrectly did not set an error.
BUG: Fix buffer readflag errors and small leaks
`openblas64_-v0.3.10-win_amd64-gcc_7_1_0.zip` is already given in line 57
MAINT: Remove duplicate dictionary entry
Copy link
Member

@seberg seberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good, just some nitpicks.

a = np.arange(12)
a.setflags(write = False)

with pytest.raises(Exception) as e_info:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nicer if you make this specific, i.e. not Exception but what ever it is (probably a TypeError). You also do not use e_info, so just remove it. If you want to be precise, you can add match="putmask: output array" which will check the error message as well.

@drskoolie
Copy link
Contributor Author

It seems that I messed up the commit history here. I think it may have been because I:

  1. Committed the changes here
  2. Rebased on master for my local version
  3. Pulled the changes from this branch

Don't know how to fix it, so I've opened up a new PR in a new branch with the exact same thing as this one: #17884.

@drskoolie drskoolie closed this Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: ndarray.putmask should respect the writeable flag
5 participants