diff --git a/holoviews/core/spaces.py b/holoviews/core/spaces.py index 7c782d0ba6..83930331e0 100644 --- a/holoviews/core/spaces.py +++ b/holoviews/core/spaces.py @@ -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 diff --git a/holoviews/core/util.py b/holoviews/core/util.py index 21876175dd..4ae9f1c0d4 100644 --- a/holoviews/core/util.py +++ b/holoviews/core/util.py @@ -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') @@ -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() diff --git a/holoviews/streams.py b/holoviews/streams.py index 5b904fe1ae..41ee8924d9 100644 --- a/holoviews/streams.py +++ b/holoviews/streams.py @@ -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 @@ -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.""") diff --git a/holoviews/util/__init__.py b/holoviews/util/__init__.py index a22434a902..e63bf3f482 100644 --- a/holoviews/util/__init__.py +++ b/holoviews/util/__init__.py @@ -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)