You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importcfimportnumpyasnp# field: specific_humidityf=cf.Field()
f.set_properties({'standard_name': 'specific_humidity', 'units': '1'})
d=cf.Data([0.007, 0.034])
f.nc_set_variable('q')
# domain_axis: ncdim%timec=cf.DomainAxis()
c.set_size(2)
c.nc_set_dimension('time')
f.set_construct(c, key='domainaxis0', copy=False)
# field data axesf.set_data_axes(('domainaxis0'))
# dimension_coordinate: timec=cf.DimensionCoordinate()
c.set_properties({'units': 'days since 2004-01-01', 'standard_name': 'time'})
d=cf.Data(cf.dt_vector(['2004-01-15', '2004-02-15']))
c.set_data(d)
c.nc_set_variable('time')
b=cf.Bounds()
b.set_properties({})
d=cf.Data([cf.dt_vector(['2004-01-01', '2004-01-31']),
cf.dt_vector(['2004-02-01', '2004-02-28'])])
b.set_data(d)
b.nc_set_variable('time_bnds')
c.set_bounds(b)
f.set_construct(c, axes=('domainaxis0',), key='dimensioncoordinate0', copy=False)
# Create filecf.write(f, filename, Conventions='CF-1.8') #Bug, it creates CF-1.9# Dirtycode: cfchecks does not support CF-1.9importnetCDF4asnc4ncfid=nc4.Dataset(filename, mode='a', format='NETCDF4')
ncfid.Conventions="CF-1.8"ncfid.close()
and then run
cfchecks test.nc
CHECKING NetCDF FILE: test.nc
=====================
Using CF Checker Version 4.1.0
Checking against CF Version CF-1.8
Using Standard Name Table Version 78 (2021-09-21T11:55:06Z)
Using Area Type Table Version 10 (23 June 2020)
Using Standardized Region Name Table Version 4 (18 December 2018)
ERROR: (7.1): boundary variable with non-numeric data type
------------------
Checking variable: time_bnds
------------------
------------------
Checking variable: time
------------------
WARN: (4.4.1): Use of the calendar and/or month_lengths attributes is recommended for time coordinate variables
------------------
Checking variable: q
------------------
ERRORS detected: 1
WARNINGS given: 1
INFORMATION messages: 0
The text was updated successfully, but these errors were encountered:
The following dataset:
raises the following error:
See the following code:
https://github.com/cedadev/cf-checker/blob/master/src/cfchecker/cfchecks.py#L1159
checks for:
it looks "datetime64" is considered "nonNumeric".
How to reproduce (a bit long):
and then run
The text was updated successfully, but these errors were encountered: