You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A search for pd.array(extents) shows this is done in both the Bokeh and Matplotlib renderers.
I also tested that the error occurs with both. I did not test Plotly.
Complete, minimal, self-contained example code that reproduces the issue
The following will raise the exception printed above
...
File [~/usr/venv/comp/lib/python3.10/site-packages/holoviews/plotting/plot.py:1988](http://localhost:33091/home/rene/usr/venv/comp/lib/python3.10/site-packages/holoviews/plotting/plot.py#line=1987), in GenericOverlayPlot.get_extents(self, overlay, ranges, range_type, dimension, **kwargs)
1986 subplot_extents = self._get_subplot_extents(overlay, ranges, range_type, dimension)
1987 zrange = isinstance(self.projection, str) and self.projection == '3d'
-> 1988 extents = {k: util.max_extents(rs, zrange) for k, rs in subplot_extents.items()}
1989 if range_type != 'combined':
1990 return extents[range_type]
File [~/usr/venv/comp/lib/python3.10/site-packages/holoviews/plotting/plot.py:1988](http://localhost:33091/home/rene/usr/venv/comp/lib/python3.10/site-packages/holoviews/plotting/plot.py#line=1987), in <dictcomp>(.0)
1986 subplot_extents = self._get_subplot_extents(overlay, ranges, range_type, dimension)
1987 zrange = isinstance(self.projection, str) and self.projection == '3d'
-> 1988 extents = {k: util.max_extents(rs, zrange) for k, rs in subplot_extents.items()}
1989 if range_type != 'combined':
1990 return extents[range_type]
File [~/usr/venv/comp/lib/python3.10/site-packages/holoviews/core/util.py:1121](http://localhost:33091/home/rene/usr/venv/comp/lib/python3.10/site-packages/holoviews/core/util.py#line=1120), in max_extents(extents, zrange)
1119 for lidx, uidx in inds:
1120 lower = [v for v in arr[lidx] if v is not None and not is_nan(v)]
-> 1121 upper = [v for v in arr[uidx] if v is not None and not is_nan(v)]
1122 if lower and isinstance(lower[0], datetime_types):
1123 extents[lidx] = np.min(lower)
File [~/usr/venv/comp/lib/python3.10/site-packages/holoviews/core/util.py:1121](http://localhost:33091/home/rene/usr/venv/comp/lib/python3.10/site-packages/holoviews/core/util.py#line=1120), in <listcomp>(.0)
1119 for lidx, uidx in inds:
1120 lower = [v for v in arr[lidx] if v is not None and not is_nan(v)]
-> 1121 upper = [v for v in arr[uidx] if v is not None and not is_nan(v)]
1122 if lower and isinstance(lower[0], datetime_types):
1123 extents[lidx] = np.min(lower)
File missing.pyx:419, in pandas._libs.missing.NAType.__bool__()
TypeError: boolean value of NA is ambiguous
The text was updated successfully, but these errors were encountered:
ALL software version info
HoloViews: 1.18.1
Pandas: 2.1.4
NumPy: 1.26.3
Bokeh: 3.3.3
Matplotlib: 3.8.2
Python: 3.10.12
Description of error
The
*Spans
and*Lines
annotations don’t support hard ranges unless both ends are specified.Singular versions (
*Span
and*Line
) are fine.The issue seems due to converting extents to a Pandas array:
holoviews/holoviews/plotting/bokeh/annotation.py
Lines 70 to 82 in e243fe0
which converts
nan
topandas.NA
. Then these lines filter out NaNs, but notNA
s:holoviews/holoviews/core/util.py
Lines 1091 to 1092 in e243fe0
A search for
pd.array(extents)
shows this is done in both the Bokeh and Matplotlib renderers.I also tested that the error occurs with both. I did not test Plotly.
Complete, minimal, self-contained example code that reproduces the issue
The following will raise the exception printed above
With any of the following changes, the example does work:
range=(0, 1)
instead ofrange=(0, None)
soft_range=(0, None)
instead ofrange=(0, None)
HSpan
instead ofHSpans
Possible workaround
Use
soft_range
for half-open ranges.Stack traceback and/or browser JavaScript console output
Last bit of traceback:
The text was updated successfully, but these errors were encountered: