Repository: holoviz/panel

Issue:
Panel code raises DeprecationWarning: panel.Pane(...) is deprecated, use panel.panel(...) instead.
Panel 0.13.1

```python
import panel as pn

def test_func():
    slider = pn.widgets.IntSlider(value=0, start=0, end=10)
    def func(value):
        return value
    func = pn.bind(func, slider)
    return pn.Column(
        pn.panel(func)
    )
```

```bash
pytest 'script.py'
```

```bash
$ pytest 'script.py'
======================================================================= test session starts ========================================================================
platform win32 -- Python 3.9.7, pytest-7.1.2, pluggy-1.0.0
rootdir: C:\repos\trading_analytics\mt-fumo-data-pipelines, configfile: pyproject.toml
plugins: cov-3.0.0, mock-3.8.1
collected 1 item

script.py .

========================================================================= warnings summary ========================================================================= 
script.py::test_func
  C:\repos\trading_analytics\mt-fumo-data-pipelines\.venv\lib\site-packages\panel\pane\base.py:38: DeprecationWarning: panel.Pane(...) is deprecated, use panel.panel(...) instead.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================== 1 passed, 2 warnings in 1.76s =================================================================== 
```

## Additional Context

This is an issue because we try to keep our code in great shape and its best practice to get warnings removed when we see them. But here we are not in control. If every library behaved like this our pytest output would start being swamped and nobody would bother to get warnings fixed.


Discussion:

Resolving patch:
diff --git a/panel/pane/base.py b/panel/pane/base.py
--- a/panel/pane/base.py
+++ b/panel/pane/base.py
@@ -386,7 +386,7 @@ def __init__(self, object: Any=None, **params):
         self._kwargs =  {p: params.pop(p) for p in list(params)
                          if p not in self.param}
         super().__init__(object, **params)
-        self._pane = Pane(None)
+        self._pane = panel(None)
         self._internal = True
         self._inner_layout = Row(self._pane, **{k: v for k, v in params.items() if k in Row.param})
         self.param.watch(self._update_inner_layout, list(Layoutable.param))


Test patch:
diff --git a/panel/tests/pane/test_vega.py b/panel/tests/pane/test_vega.py
--- a/panel/tests/pane/test_vega.py
+++ b/panel/tests/pane/test_vega.py
@@ -13,8 +13,10 @@
 
 import numpy as np
 
+import panel as pn
+
 from panel.models.vega import VegaPlot
-from panel.pane import Pane, PaneBase, Vega
+from panel.pane import PaneBase, Vega
 
 blank_schema = {'$schema': ''}
 
@@ -137,7 +139,7 @@ def test_get_vega_pane_type_from_dict():
 
 
 def test_vega_pane(document, comm):
-    pane = Pane(vega_example)
+    pane = pn.panel(vega_example)
 
     # Create pane
     model = pane.get_root(document, comm=comm)
@@ -164,7 +166,7 @@ def test_vega_pane(document, comm):
 
 
 def test_vega_geometry_data(document, comm):
-    pane = Pane(gdf_example)
+    pane = pn.panel(gdf_example)
 
     # Create pane
     model = pane.get_root(document, comm=comm)
@@ -175,7 +177,7 @@ def test_vega_geometry_data(document, comm):
 
 
 def test_vega_pane_inline(document, comm):
-    pane = Pane(vega_inline_example)
+    pane = pn.panel(vega_inline_example)
 
     # Create pane
     model = pane.get_root(document, comm=comm)
@@ -209,7 +211,7 @@ def test_get_vega_pane_type_from_altair():
 
 @altair_available
 def test_altair_pane(document, comm):
-    pane = Pane(altair_example())
+    pane = pn.panel(altair_example())
 
     # Create pane
     model = pane.get_root(document, comm=comm)