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

Fix for numpy 1v16. #3257

Merged
merged 1 commit into from
Feb 1, 2019
Merged

Fix for numpy 1v16. #3257

merged 1 commit into from
Feb 1, 2019

Conversation

pp-mo
Copy link
Member

@pp-mo pp-mo commented Feb 1, 2019

Fixes problem triggered by numpy >= 1.16.
Can no longer simply "make" an array writeable by writing the flag.
There's actually only one place we do that. It was probably a bit cheeky anyway ...

# Ensure we have a writeable data buffer.
# NOTE: "data.setflags(write=True)" is not valid for numpy >= 1.16.0.
if not data.flags['WRITEABLE']:
data = data.copy()
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: 'data' is generated within this routine, not passed in.
So I think this is a safe change.

@pp-mo pp-mo requested a review from bjlittle February 1, 2019 11:39
@bjlittle bjlittle self-assigned this Feb 1, 2019
@pp-mo pp-mo mentioned this pull request Feb 1, 2019
@bjlittle bjlittle added this to the v2.2.1 milestone Feb 1, 2019
@bjlittle bjlittle merged commit c3048cb into SciTools:v2.2.x Feb 1, 2019
@bjlittle
Copy link
Member

bjlittle commented Feb 1, 2019

Ping @pp-mo 👍

bjlittle pushed a commit that referenced this pull request Feb 1, 2019
* BLD: Pinning cftime to 1.0.1 (#3247)

* Fix for numpy 1v16. (#3257)
@pp-mo pp-mo deleted the np_1x16_writeable branch May 23, 2019 09:28
znicholls pushed a commit to znicholls/iris that referenced this pull request Jun 15, 2019
* BLD: Pinning cftime to 1.0.1 (SciTools#3247)

* Fix for numpy 1v16. (SciTools#3257)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants