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

xarray/core/duck_array_ops.py RuntimeWarning during casting #1155

Closed
emiliom opened this issue Sep 2, 2023 · 1 comment
Closed

xarray/core/duck_array_ops.py RuntimeWarning during casting #1155

emiliom opened this issue Sep 2, 2023 · 1 comment
Milestone

Comments

@emiliom
Copy link
Collaborator

emiliom commented Sep 2, 2023

In some circumstances which we haven't fully isolated, a warning is emitted by xarray:

... site-packages/xarray/core/duck_array_ops.py:188: RuntimeWarning: invalid value encountered in cast return data.astype(dtype, **kwargs)

Using a test OOI EK60 file, the warning is triggered by utils/coding.py:sanitize_dtypes on open_raw, here:

if not np.issubdtype(var.dtype, expected_dtype):
ds[name] = var.astype(expected_dtype)

But I haven't gotten further in identifying the exact variable(s) and condition that lead to it.

This PR shows echopype-examples notebooks with this warning. See notebooks 2 & 3. The warning occurs on either open_raw or to_zarr. In notebook 2 (hake data) it only happens 3 times, which I assume means 3 files out of the total 170 raw files that are handled.

Originally reported in #1153

@emiliom emiliom added this to Echopype Sep 2, 2023
@github-project-automation github-project-automation bot moved this to Todo in Echopype Sep 2, 2023
@leewujung leewujung added this to the v0.9.0 milestone Jul 5, 2024
@leewujung
Copy link
Member

This is the same as #1337 and fixed in #1135.

@github-project-automation github-project-automation bot moved this from Todo to Done in Echopype Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants