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

redim.range doesn't work for datetimes on latest dev #3044

Closed
ahuang11 opened this issue Oct 3, 2018 · 2 comments
Closed

redim.range doesn't work for datetimes on latest dev #3044

ahuang11 opened this issue Oct 3, 2018 · 2 comments
Labels
good first issue An issue well suited to a new contributor type: bug Something isn't correct or isn't working
Milestone

Comments

@ahuang11
Copy link
Collaborator

ahuang11 commented Oct 3, 2018

tsz = pd.DataFrame([0, 1, 2], index=pd.date_range('2017-02-01', end='2017-02-03')).rename_axis('x')
tsz.hvplot().redim.range(x=('2017-01-01', '2017-02-03'))

tsz = pd.DataFrame([0, 1, 2], index=pd.date_range('2017-02-01', end='2017-02-03')).rename_axis('x')
tsz.hvplot().redim.range(x=(pd.to_datetime('2017-01-01'), pd.to_datetime('2017-02-03')))
/mnt/c/Users/user/GOOGLE~1/Bash/holoviews/holoviews/plotting/bokeh/element.py in initialize_plot(self, ranges, plot, plots, source)
    722             element = self.hmap.last
    723         key = util.wrap_tuple(self.hmap.last_key)
--> 724         ranges = self.compute_ranges(self.hmap, key, ranges)
    725         self.current_ranges = ranges
    726         self.current_frame = element

/mnt/c/Users/user/GOOGLE~1/Bash/holoviews/holoviews/plotting/plot.py in compute_ranges(self, obj, key, ranges)
    381             if (not (axiswise and not isinstance(obj, HoloMap)) or
    382                 (not framewise and isinstance(obj, HoloMap))):
--> 383                 self._compute_group_range(group, elements, ranges)
    384         self.ranges.update(ranges)
    385         return ranges

/mnt/c/Users/user/GOOGLE~1/Bash/holoviews/holoviews/plotting/plot.py in _compute_group_range(group, elements, ranges)
    454             data_range = util.max_range(values['data'])
    455             combined = util.dimension_range(data_range[0], data_range[1],
--> 456                                             hard_range, soft_range)
    457             dranges = {'data': data_range, 'hard': hard_range,
    458                        'soft': soft_range, 'combined': combined}

/mnt/c/Users/user/GOOGLE~1/Bash/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 philippjfr added good first issue An issue well suited to a new contributor type: bug Something isn't correct or isn't working labels Oct 3, 2018
@philippjfr
Copy link
Member

Thanks for the report. This should be an easy fix, np.isfinite simply needs to be isfinite since we already defined a general isfinite function in the same module.

@philippjfr
Copy link
Member

Fixed in #3045

@philippjfr philippjfr added this to the v1.10.8 milestone Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue An issue well suited to a new contributor type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

2 participants