Skip to content
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

filterwarnings("ignore:invalid value encountered in sqrt") ? #8863

Closed
cyschneck opened this issue Mar 21, 2024 · 1 comment
Closed

filterwarnings("ignore:invalid value encountered in sqrt") ? #8863

cyschneck opened this issue Mar 21, 2024 · 1 comment
Labels
needs triage Issue that has not been reviewed by xarray team member

Comments

@cyschneck
Copy link

What is your issue?

I am cleaning up some deprecation warnings on a repo and encountered:

dask/core.py:127: RuntimeWarning: invalid value encountered in sqrt

I believe the issue is arising within xarray, even though dask is triggering it. I noticed that in the xarray tests, the same warning is being filtered out to be ignored.

Do you know where this issue is arising and why is it being filtered?

Simple reproducible form: (Python 3.12, Linux)

import xarray as xr
import numpy as np
from geocat.comp import *

t1 = np.array([80, 80, 60, 30])
rh1 = np.array([40, 75, 90, 50])

t = xr.DataArray(t1).chunk(3)
rh = xr.DataArray(rh1).chunk(3)
out = heat_index(t, rh)
print(out.values)

Output

/home/user/miniconda3/envs/geocat_comp_build/lib/python3.12/site-packages/dask/core.py:127: RuntimeWarning: invalid value encountered in sqrt
  return func(*(_execute_task(a, cache) for a in args))
[79.79      83.5751104 59.965     30.       ]
@cyschneck cyschneck added the needs triage Issue that has not been reviewed by xarray team member label Mar 21, 2024
@dcherian
Copy link
Contributor

Unfortunately there's not much we can do with dask: dask/dask#3245

aside from setting np.errstate inside dask (#5151 dask/dask#8125)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue that has not been reviewed by xarray team member
Projects
None yet
Development

No branches or pull requests

2 participants