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

code example from the 2.2.0 documentation fails #3339

Closed
fabrice-ducos opened this issue Jun 20, 2019 · 2 comments
Closed

code example from the 2.2.0 documentation fails #3339

fabrice-ducos opened this issue Jun 20, 2019 · 2 comments
Assignees

Comments

@fabrice-ducos
Copy link

In the "Loading Iris cubes" section, the following example code is provided.

import iris
filename = iris.sample_data_path('uk_hires.pp')
cubes = iris.load(filename)
print(cubes)

When attempting to test this code (configuration: OSX Mojave, python 3.7.3, anaconda 3, iris 2.2.0, sample data properly installed), I get the following error on the iris.load() call:

    721 
    722     # Ensure we have write permission on the data buffer.
--> 723     data.setflags(write=True)
    724 
    725     # Ensure the data is in the native byte order

ValueError: cannot set WRITEABLE flag to True of this array
@pp-mo
Copy link
Member

pp-mo commented Jun 20, 2019

This broke at numpy 1.16, has been fixed in 2.2.1 : #3257

@bjlittle bjlittle self-assigned this Jun 25, 2019
@bjlittle
Copy link
Member

Thanks for raising this @fabrice-ducos

As @pp-mo mentions, this has been fixed in our latest release of iris version 2.2.1.

I'm going to close this issue as it has already been resolved. Please install the latest version of iris which is available from conda-forge. Thanks!

>>> import iris
>>> iris.__version__
'2.2.1dev0'
>>> import numpy as np
>>> np.__version__
'1.16.4'
>>> fname = iris.sample_data_path('uk_hires.pp')
>>> cubes = iris.load(fname)
>>> print(cubes)
0: air_potential_temperature / (K)     (time: 3; model_level_number: 7; grid_latitude: 204; grid_longitude: 187)
1: surface_altitude / (m)              (grid_latitude: 204; grid_longitude: 187)

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

3 participants