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

Setting range broken for dates #3019

Closed
jsignell opened this issue Sep 28, 2018 · 3 comments
Closed

Setting range broken for dates #3019

jsignell opened this issue Sep 28, 2018 · 3 comments

Comments

@jsignell
Copy link
Member

On latest master I am getting a new failure when trying to set the range on time dimensions.

import numpy as np
import pandas as pd
import holoviews as hv

hv.extension('bokeh')

df = pd.DataFrame({
    'x': pd.date_range('2017', '2018', periods=100), 
    'y': np.sin(np.linspace(0, 2*np.pi, 100))
})
hv.Curve(df).redim.range(x=(pd.Timestamp('2017-05'),pd.Timestamp('2017-09')))

error output:

/Users/jsignell/holoviews/holoviews/core/util.py in dimension_range(lower, upper, hard_range, soft_range, padding, log)
    883     lower, upper = max_range([(lower, upper), soft_range])
    884     dmin, dmax = hard_range
--> 885     lower = lower if dmin is None or not np.isfinite(dmin) else dmin
    886     upper = upper if dmax is None or not np.isfinite(dmax) else dmax
    887     return lower, upper

TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
@philippjfr
Copy link
Member

Thanks, we wrote our own isfinite implementation which also lives in core/util.py for precisely this reason but it seems its not used consistently throughout. Should probably grep for np.isfinite and replace it whereever it makes sense.

@philippjfr
Copy link
Member

Fixed in #3045

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 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants