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

display.plot() add_nan with integer data #838

Closed
kenkehoe opened this issue Jun 5, 2024 · 0 comments · Fixed by #842
Closed

display.plot() add_nan with integer data #838

kenkehoe opened this issue Jun 5, 2024 · 0 comments · Fixed by #842
Assignees
Labels
bug Something isn't working

Comments

@kenkehoe
Copy link
Contributor

kenkehoe commented Jun 5, 2024

When plotting with display.plot() we have the option to set add_nan=True to disconnect line segments. The disconnecting is done by inserting a np.nan value. For data that is not a float or double the script is throwing "ValueError: cannot convert float NaN to integer" exception. I believe Python is trying to downconvert the inserted value. Since the display object contains the Dataset it can be hard to fix this issue on the user end without changing the Dataset. We need to check the data type of the data before inserting and up convert the numpy array before inserting NaN if necessary. This will preserve the data type of the DataArray in the Dataset.

@kenkehoe kenkehoe added the bug Something isn't working label Jun 5, 2024
@kenkehoe kenkehoe self-assigned this Jun 5, 2024
@kenkehoe kenkehoe mentioned this issue Jul 2, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant