diff --git a/panel/config.py b/panel/config.py index 9f75a2e556..f0c6f895f1 100644 --- a/panel/config.py +++ b/panel/config.py @@ -21,7 +21,7 @@ from bokeh.document import Document from bokeh.model import Model from bokeh.settings import settings as bk_settings -from param.depends import ( +from param.display import ( register_display_accessor, unregister_display_accessor, ) from pyviz_comms import ( diff --git a/panel/pane/base.py b/panel/pane/base.py index d99b9aa848..fbd42284d6 100644 --- a/panel/pane/base.py +++ b/panel/pane/base.py @@ -549,9 +549,7 @@ class ReplacementPane(PaneBase): _pane = param.ClassSelector(class_=Viewable, allow_refs=False) - _ignored_refs: ClassVar[Tuple[str]] = ['object', '_pane'] - - _linked_properties: ClassVar[Tuple[str]] = () + _linked_properties: ClassVar[Tuple[str,...]] = () _rename: ClassVar[Mapping[str, str | None]] = {'_pane': None, 'inplace': None} diff --git a/panel/pane/holoviews.py b/panel/pane/holoviews.py index 88f02f431e..d7836bcf32 100644 --- a/panel/pane/holoviews.py +++ b/panel/pane/holoviews.py @@ -9,7 +9,7 @@ from collections import OrderedDict, defaultdict from functools import partial from typing import ( - TYPE_CHECKING, Any, ClassVar, Mapping, Optional, Tuple, Type, + TYPE_CHECKING, Any, ClassVar, Mapping, Optional, Type, ) import param @@ -685,8 +685,6 @@ class Interactive(PaneBase): priority: ClassVar[float | bool | None] = None - _ignored_refs: ClassVar[Tuple[str]] = ['object'] - def __init__(self, object=None, **params): super().__init__(object, **params) self._update_layout() diff --git a/panel/pane/ipywidget.py b/panel/pane/ipywidget.py index 6d5bd563e7..b272a51eca 100644 --- a/panel/pane/ipywidget.py +++ b/panel/pane/ipywidget.py @@ -3,7 +3,7 @@ import os from typing import ( - TYPE_CHECKING, Any, ClassVar, List, Optional, + TYPE_CHECKING, Any, ClassVar, Optional, ) import param @@ -43,8 +43,6 @@ class IPyWidget(PaneBase): priority: ClassVar[float | bool | None] = 0.6 - _ignored_refs: ClassVar[List[str]] = ['object'] - @classmethod def applies(cls, obj: Any) -> float | bool | None: return (hasattr(obj, 'traits') and hasattr(obj, 'get_manager_state') and hasattr(obj, 'comm')) diff --git a/panel/pane/plot.py b/panel/pane/plot.py index 69294fde09..5594261d3d 100644 --- a/panel/pane/plot.py +++ b/panel/pane/plot.py @@ -8,7 +8,7 @@ from contextlib import contextmanager from io import BytesIO from typing import ( - TYPE_CHECKING, Any, ClassVar, Dict, List, Mapping, Optional, + TYPE_CHECKING, Any, ClassVar, Dict, Mapping, Optional, ) import param @@ -230,8 +230,6 @@ class Matplotlib(Image, IPyWidget): Automatically adjust the figure size to fit the subplots and other artist elements.""") - _ignored_refs: ClassVar[List[str]] = [] - _rename: ClassVar[Mapping[str, str | None]] = { 'object': 'text', 'interactive': None, 'dpi': None, 'tight': None, 'high_dpi': None, 'format': None, 'encode': None diff --git a/panel/param.py b/panel/param.py index 3a76a1a2e4..27dc2dbfb2 100644 --- a/panel/param.py +++ b/panel/param.py @@ -1051,9 +1051,6 @@ class ReactiveExpr(PaneBase): priority: ClassVar[float | bool | None] = 1 - # Parameter values which should not be treated like references - _ignored_refs: ClassVar[List[str]] = ['object'] - _layouts = { 'left': (Row, ('start', 'center'), True), 'right': (Row, ('end', 'center'), False), diff --git a/panel/pipeline.py b/panel/pipeline.py index 104709cc23..c5c8964bca 100644 --- a/panel/pipeline.py +++ b/panel/pipeline.py @@ -4,7 +4,6 @@ import traceback as tb from collections import OrderedDict, defaultdict -from typing import ClassVar, Tuple import param @@ -165,8 +164,6 @@ class Pipeline(Viewer): previous = param.Action(default=lambda x: x.param.trigger('previous')) - _ignored_refs: ClassVar[Tuple[str]] = ('next_parameter', 'ready_parameter') - def __init__(self, stages=[], graph={}, **params): try: import holoviews as hv diff --git a/panel/reactive.py b/panel/reactive.py index 30309cb323..05a285da27 100644 --- a/panel/reactive.py +++ b/panel/reactive.py @@ -527,9 +527,6 @@ class Reactive(Syncable, Viewable): the parameters to other objects. """ - # Parameter values which should not be treated like references - _ignored_refs: ClassVar[List[str]] = [] - _rename: ClassVar[Mapping[str, str | None]] = { 'design': None, 'loading': None } @@ -538,8 +535,8 @@ class Reactive(Syncable, Viewable): def __init__(self, refs=None, **params): for name, pobj in self.param.objects('existing').items(): - enable_refs = name not in self._ignored_refs - pobj.allow_refs = enable_refs + if name not in self._param__private.explicit_no_refs: + pobj.allow_refs = True super().__init__(**params) #---------------------------------------------------------------- diff --git a/panel/tests/test_expression.py b/panel/tests/test_expression.py index af783b4e6c..6d3e040bc9 100644 --- a/panel/tests/test_expression.py +++ b/panel/tests/test_expression.py @@ -52,18 +52,18 @@ def test_reactive_widget_order(): def test_reactive_dataframe_method_chain(dataframe): dfi = rx(dataframe).groupby('str')[['float']].mean().reset_index() - pd.testing.assert_frame_equal(dfi.rx.resolve(), dataframe.groupby('str')[['float']].mean().reset_index()) + pd.testing.assert_frame_equal(dfi.rx.value, dataframe.groupby('str')[['float']].mean().reset_index()) def test_reactive_dataframe_attribute_chain(dataframe): - array = rx(dataframe).str.values.rx.resolve() + array = rx(dataframe).str.values.rx.value np.testing.assert_array_equal(array, dataframe.str.values) def test_reactive_dataframe_param_value_method_chain(dataframe): P = Parameters(string='str') dfi = rx(dataframe).groupby(P.param.string)[['float']].mean().reset_index() - pd.testing.assert_frame_equal(dfi.rx.resolve(), dataframe.groupby('str')[['float']].mean().reset_index()) + pd.testing.assert_frame_equal(dfi.rx.value, dataframe.groupby('str')[['float']].mean().reset_index()) P.string = 'int' - pd.testing.assert_frame_equal(dfi.rx.resolve(), dataframe.groupby('int')[['float']].mean().reset_index()) + pd.testing.assert_frame_equal(dfi.rx.value, dataframe.groupby('int')[['float']].mean().reset_index()) def test_reactive_layout_default_with_widgets(): w = IntSlider(value=2, start=1, end=5) diff --git a/panel/widgets/indicators.py b/panel/widgets/indicators.py index 132d655db1..2680b6a911 100644 --- a/panel/widgets/indicators.py +++ b/panel/widgets/indicators.py @@ -1228,8 +1228,6 @@ class Tqdm(Indicator): write_to_console = param.Boolean(default=False, doc=""" Whether or not to also write to the console.""") - _ignored_refs: ClassVar[List[str]] = ['progress'] - _layouts: ClassVar[Dict[Type[Panel], str]] = {Row: 'row', Column: 'column'} _rename: ClassVar[Mapping[str, str | None]] = { diff --git a/panel/widgets/misc.py b/panel/widgets/misc.py index e74763050b..6feb05bcf0 100644 --- a/panel/widgets/misc.py +++ b/panel/widgets/misc.py @@ -124,8 +124,6 @@ class FileDownload(IconMixin): _transfers = param.Integer(default=0) - _ignored_refs: ClassVar[List[str]] = ['callback'] - _mime_types = { 'application': { 'pdf': 'pdf', 'zip': 'zip' diff --git a/setup.py b/setup.py index faa6063565..5bd48299ac 100644 --- a/setup.py +++ b/setup.py @@ -102,7 +102,7 @@ def run(self): install_requires = [ 'bokeh >=3.1.1,<3.3.0', - 'param >=2.0.0rc2', + 'param >=2.0.0rc6', 'pyviz_comms >=0.7.4', 'xyzservices >=2021.09.1', # Bokeh dependency, but pyodide 23.0.0 does not always pick it up 'markdown', @@ -226,7 +226,7 @@ def run(self): # non-python dependencies). Note that setup_requires isn't used # because it doesn't work well with pip. extras_require['build'] = [ - 'param >=2.0.0rc2', + 'param >=2.0.0rc6', 'setuptools >=42', 'requests', 'packaging',