Open Nemo1166 opened 11 months ago
It seems can be solved by following modification:
In pkg cfunits
, file units.py
, line 2297:
- x -= offset
+ x = x - offset
I haven't check other components to avoid potential problems.
Thanks for reporting this! We'll look into it soon. I'll comment here with any updates from when we get a chance to work on it.
UFuncTypeError: Cannot cast ufunc 'subtract' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
Expectation
Same with recipe 1 in documentation.
Reproduction
Run
plot_01_recipe.ipynb
, with data file cru_ts4.06.1901.2021.tmp.dat.nc (link).Traceback info
here
``` { "name": "UFuncTypeError", "message": "Cannot cast ufunc 'subtract' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'", "stack": "--------------------------------------------------------------------------- UFuncTypeError Traceback (most recent call last) c:\\Users\\10502\\Desktop\\dataset-derived-near-surface-meteorological-variables-a2eeaa79-acc2-4c4a-9e90-b5b6ecd9c3f9\\plot_01_recipe.ipynb 单元格 22 line 1 ----> 1 annual_global_avg = global_avg.collapse(\"T: mean\", group=cf.Y()) 2 cfp.lineplot( 3 annual_global_avg, 4 color=\"red\", 5 title=\"Annual global mean surface temperature\", 6 ) File c:\\Users\\10502\\miniforge3\\envs\\cf311\\Lib\\site-packages\\cf\\decorators.py:71, in _deprecated_kwarg_check.Env