-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flood of cast warnings after improved hdf5 I/O #84
Comments
Yes, it's a known issue in xarray (see pydata/xarray#7098, and pydata/xarray#7827). The warnings can be ignored. I use the following to deal with it: import warnings
warnings.filterwarnings(
"ignore",
message="invalid value encountered in cast",
module="xarray",
category=RuntimeWarning,
) |
Thanks a lot! 🙌 I'll do the same here. |
I've made an attempt and suppressed the warnings in the parent classes' hdf5 methods. see CLIMADA-project/climada_python#742 |
I get the same warning when loading any other NetCDF file, it's not only related to the new implementation of >>> from climada.hazard import TCTracks
>>> TCTracks.from_ibtracs_netcdf(year_range=(2015, 2015))
$CONDA_PREFIX/lib/python3.9/site-packages/xarray/coding/times.py:254: RuntimeWarning: invalid value encountered in cast
flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype(
$CONDA_PREFIX/lib/python3.9/site-packages/xarray/coding/times.py:254: RuntimeWarning: invalid value encountered in cast
flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( So, I would consider suppressing the warnings at a central place during CLIMADA setup and maybe mention pydata/xarray#7098 in the code so that future developers know where this comes from, and have an easy benchmark when to remove it. |
climada_python PR #735 started a flood of Runtime Warnings in
tc_track_forecast.TCForecast.from_hdf5
.To reproduce, run:
The warnings are raised in
climada.hazard.tc_tracks.TCTracks.from_hdf5
:I have not really a clue whether we can safely ignore it or whether this points to a serious problem. 🤷
The text was updated successfully, but these errors were encountered: