cf-python icon indicating copy to clipboard operation
cf-python copied to clipboard

runtime warning from numpy about invalid value in cast

Open JonathanGregory opened this issue 3 years ago • 11 comments

There's an example field in the attached zero.cdl.txt. The following produces the warning "/usr/share/anaconda3/lib/python3.8/site-packages/numpy/ma/core.py:467: RuntimeWarning: invalid value encountered in cast".


>>> cf.__version__
'3.14.1'
>>> numpy.__version__
'1.24.2'
n=cf.read('zero.nc')[0]
>>> n.dim('T').dump()
/usr/share/anaconda3/lib/python3.8/site-packages/numpy/ma/core.py:467: RuntimeWarning: invalid value encountered in cast
  fill_value = np.array(fill_value, copy=False, dtype=ndtype)
Dimension coordinate: time
    axis = 'T'
    calendar = '360_day'
    standard_name = 'time'
    units = 'days since 2007-1-1'
    Data(294) = [2007-01-01 00:00:00, ..., 2300-01-01 00:00:00] 360_day

JonathanGregory avatar Mar 23 '23 19:03 JonathanGregory