diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index 5b5f7c8a36..1c1d281871 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -719,8 +719,10 @@ def _data_bytes_to_shaped_array(data_bytes, lbpack, boundary_packing, raise iris.exceptions.NotYetImplementedError( 'PP fields with LBPACK of %s are not yet supported.' % lbpack) - # Ensure we have write permission on the data buffer. - data.setflags(write=True) + # 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() # Ensure the data is in the native byte order if not data.dtype.isnative: diff --git a/requirements/core.txt b/requirements/core.txt index 429f6573f7..7e55bd1fd5 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -6,7 +6,7 @@ cartopy #conda: proj4<5 cf_units>=2 -cftime!=1.0.2.1 +cftime==1.0.1 dask[array] #conda: dask matplotlib>=2,<3 netcdf4