Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Sep 25, 2023
1 parent 1d50f38 commit bbc47d4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
3 changes: 1 addition & 2 deletions holoviews/core/spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,7 @@ class Callable(param.Parameterized):
"""

callable = param.Callable(default=None, constant=True, doc="""
The callable function being wrapped.""",
**{'allow_refs': False} if util.param_version > util.Version('2.0.0rc1') else {})
The callable function being wrapped.""", **util.disallow_refs)

inputs = param.List(default=[], constant=True, doc="""
The list of inputs the callable function is wrapping. Used
Expand Down
7 changes: 6 additions & 1 deletion holoviews/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

anonymous_dimension_label = '_'

disallow_refs = {'allow_refs': False} if param_version > Version('2.0.0rc1') else {}

# Argspec was removed in Python 3.11
ArgSpec = namedtuple('ArgSpec', 'args varargs keywords defaults')

Expand Down Expand Up @@ -1617,7 +1619,10 @@ def resolve_dependent_value(value):
from panel.depends import param_value_if_widget
from panel.widgets import RangeSlider
range_widget = isinstance(value, RangeSlider)
value = param_value_if_widget(value)
if param_version > Version('2.0.0rc1'):
value = param.parameterized.resolve_value(value)
else:
value = param_value_if_widget(value)

if is_param_method(value, has_deps=True):
value = value()
Expand Down
7 changes: 3 additions & 4 deletions holoviews/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def streams_list_from_dict(streams):
params = {}
for k, v in streams.items():
if 'panel' in sys.modules:
from panel.depends import param_value_if_widget
if util.param_version > util.Version('2.0.0rc1'):
v = param.parameterized.resolve_value(v)
v = param.parameterized.transform_reference(v)
else:
from panel.depends import param_value_if_widget
v = param_value_if_widget(v)
if isinstance(v, param.Parameter) and v.owner is not None:
params[k] = v
Expand Down Expand Up @@ -682,8 +682,7 @@ class Params(Stream):
parameterized = param.ClassSelector(class_=(param.Parameterized,
param.parameterized.ParameterizedMetaclass),
constant=True, allow_None=True, doc="""
Parameterized instance to watch for parameter changes.""",
**{'allow_refs': False} if util.param_version > util.Version('2.0.0rc1') else {})
Parameterized instance to watch for parameter changes.""", **util.disallow_refs)

parameters = param.List(default=[], constant=True, doc="""
Parameters on the parameterized to watch.""")
Expand Down
2 changes: 1 addition & 1 deletion holoviews/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ class Dynamic(param.ParameterizedFunction):
Whether the cloned DynamicMap will share the same cache.""")

streams = param.ClassSelector(default=[], class_=(list, dict), doc="""
List of streams to attach to the returned DynamicMap""")
List of streams to attach to the returned DynamicMap""", **util.disallow_refs)

def __call__(self, map_obj, **params):
watch = params.pop('watch', True)
Expand Down

0 comments on commit bbc47d4

Please sign in to comment.