Skip to content

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

@mo-garethsjones

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions