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

Skip to content

Cube attributes with numbers are decorated with np.int and np.float instead of plain numberΒ #6692

Description

@mo-garethsjones

πŸ› Bug Report

For iris 3.13.0, loaded climate data into "cubes" have attributes which are shown as "np.int...(...)" or "np.float...(...)" instead of just numbers as is done for earlier versions of iris.
e.g., https://scitools-iris.readthedocs.io/en/v3.13.0/further_topics/ugrid/operations.html#plotting in the example code the "print(sample_mesh_cube)" prints the cube, with the very last attribute = "nco_openmp_thread_number np.int32(1)"
This should be (as in earlier versions of iris) "nco_openmp_thread_number 1"
I spotted this while examining CMIP5 and CMIP6 netcdf data.

How To Reproduce

Steps to reproduce the behaviour:

>>> import iris
>>> filename = iris.sample_data_path('mesh_C4_synthetic_float.nc')
>>> co = iris.load(filename)
>>> co[0].attributes['nco_openmp_thread_number']
np.int32(1)

Expected behaviour

>>> import iris
>>> filename = iris.sample_data_path('mesh_C4_synthetic_float.nc')
>>> co = iris.load(filename)
>>> co[0].attributes['nco_openmp_thread_number']
1

Environment

  • Iris Version: 3.13.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions