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

invalid value encountered in cast #401

Open
berceanu opened this issue Oct 20, 2023 · 1 comment
Open

invalid value encountered in cast #401

berceanu opened this issue Oct 20, 2023 · 1 comment
Labels

Comments

@berceanu
Copy link
Contributor

I encountered a cast Warning and tracked it down to this line:

data = np.full(record_component.shape, NaN_value, record_component.dtype)

In order to see it, one needs to set np.seterr(all='raise'). I get:

    multiarray.copyto(a, fill_value, casting='unsafe')
  File "<__array_function__ internals>", line 200, in copyto
FloatingPointError: invalid value encountered in cast

Without raising warnings as errors, one just gets the warning, with no stack trace and no way to see where it is coming from.

<__array_function__ internals>:200: RuntimeWarning: invalid value encountered in cast

I suspect this is caused by having an int type which is being filled with NaN, that is of float type?

@ax3l
Copy link
Member

ax3l commented Jan 4, 2024

I am not sure if we have not fixed this already with a978fc1 by now.

@berceanu can you retry and link a data set that shows the warning/error, so we can reproduce and fix it?

@ax3l ax3l added the bug label Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants