NCAS-CMS / cfdm

A Python reference implementation of the CF data model
http://ncas-cms.github.io/cfdm
MIT License
28 stars 11 forks source link

`cfdm.write` fails when a parametric Z dimension coordinate does not have a `compute_standard_name` attribute #303

Closed davidhassell closed 4 months ago

davidhassell commented 4 months ago

cfdm.write fails when a parametric Z dimension coordinate does not have a compute_standard_name attribute:

>>> import cfdm
>>> f = cfdm.example_field(1)
>>> f.coordinate('atmosphere_hybrid_height_coordinate').del_property('computed_standard_name')
'altitude'
>>> cfdm.write(f, 'delme.nc')
Traceback ....

AttributeError: 'CFDMImplementation' object has no attribute 'set_property'

PR to follow ...

>>> cfdm.environment(paths=False)
Platform: Linux-5.15.0-112-generic-x86_64-with-glibc2.35
HDF5 library: 1.14.3
netcdf library: 4.9.2
Python: 3.10.13
netCDF4: 1.6.5
numpy: 1.26.0
cfdm.core: 1.11.1.0
scipy: 1.11.3
cftime: 1.6.2
netcdf_flattener: 1.2.0
cfdm: 1.11.1.0