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

Crash when trying to set xlim on datetime axis #5834

Closed
TheoMathurin opened this issue Jul 27, 2023 · 1 comment · Fixed by #5838
Closed

Crash when trying to set xlim on datetime axis #5834

TheoMathurin opened this issue Jul 27, 2023 · 1 comment · Fixed by #5838
Labels
type: bug Something isn't correct or isn't working

Comments

@TheoMathurin
Copy link
Contributor

TheoMathurin commented Jul 27, 2023

HoloViews 1.17.0
Bokeh 3.2.1

The condition here introduced in #5621 yields an error for a datetime axis:
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''.

Replacing util.cftime_types with util.datetime_types makes it work. I can make a PR if it's the right fix.

Minimal example:

import pandas as pd
import datetime as dt
import holoviews as hv

df = pd.DataFrame({'time': [pd.Timestamp('2023-07-27T09:00:00Z'), pd.Timestamp('2023-07-27T15:00:00Z')], 'value': [5, 6]})
xlim = (dt.datetime(2023, 7, 27, 0), dt.datetime(2023, 7, 28, 0))

hv.Curve(df, 'time', 'value').opts(xlim=xlim)
@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Jul 31, 2023
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants