cf-python
cf-python copied to clipboard
coordinate equality raises a stack trace instead of a False
I am comparing coordinates for equality (don't ask why).
MWE of the problem, given a field with Z and Y dimensions:
zz = f.dimension_coordinate('Z')
yy = f.dimension_coordiante('Y')
zz == yy # raises an error instead of simply raising False:
# ValueError: Can't compare <Units: m> to <Units: degrees_north>
Platform: Linux-3.10.0-1160.119.1.el7.x86_64-x86_64-with-glibc2.17 HDF5 library: 1.14.3 netcdf library: 4.9.2 udunits2 library: /home/users/lawrence/.conda/envs/mampy24b/lib/libudunits2.so.0 esmpy/ESMF: not available Python: 3.12.4 dask: 2024.7.0 netCDF4: 1.7.1 h5netcdf: 1.3.0 h5py: 3.11.0 s3fs: 2024.6.1 psutil: 6.0.0 packaging: 24.1 numpy: 2.0.0 scipy: 1.14.0 matplotlib: 3.9.1 cftime: 1.6.4 cfunits: 3.3.7 cfplot: 3.3.0 cfdm: 1.11.2.0 cf: 3.17.0