diff --git a/README.md b/README.md index 38bccb10d..30c4f0cb6 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The API is based on the familiar Pandas `.plot` API and the innovative `.interac hvPlot -- supports a wide range of data sources including [Pandas](http://pandas.pydata.org), [Polars](https://docs.pola.rs/), [XArray](http://xarray.pydata.org), [Dask](http://dask.pydata.org), [Streamz](http://streamz.readthedocs.io), [Intake](http://github.com/ContinuumIO/intake), [GeoPandas](http://geopandas.org) and [NetworkX](https://networkx.github.io/documentation/stable/). +- supports a wide range of data sources including [Pandas](http://pandas.pydata.org), [Polars](https://docs.pola.rs/), [XArray](http://xarray.pydata.org), [Dask](http://dask.pydata.org), [Intake](http://github.com/ContinuumIO/intake), [GeoPandas](http://geopandas.org) and [NetworkX](https://networkx.github.io/documentation/stable/). - supports the plotting backends [Bokeh](https://docs.bokeh.org/en/latest/), [Matplotlib](https://matplotlib.org/) and [Plotly](https://plotly.com/python/). - exposes the powerful tools from the [HoloViz](https://holoviz.org/) ecosystem in a familiar and convenient API. diff --git a/doc/conftest.py b/doc/conftest.py index b2123a8bc..5b6349ed5 100644 --- a/doc/conftest.py +++ b/doc/conftest.py @@ -1,5 +1,4 @@ import os -import sys from importlib.util import find_spec @@ -52,7 +51,7 @@ 'user_guide/Plotting_with_Plotly.ipynb', ] -if not find_spec('streamz') or sys.version_info[:2] >= (3, 14): +if not find_spec('streamz'): collect_ignore_glob += [ 'ref/plotting_options/streaming.ipynb', ] diff --git a/doc/index.md b/doc/index.md index a9763c788..b41ec362f 100644 --- a/doc/index.md +++ b/doc/index.md @@ -185,21 +185,6 @@ align: center --- ::: -:::{tab-item} Streamz -```python -import hvplot.streamz -from streamz.dataframe import Random - -df_streamz = Random(interval='200ms', freq='50ms') -df_streamz.hvplot() -``` -```{image} ./assets/streamz_demo.gif ---- -alt: Works with Streamz -align: center ---- -::: - :::: `.hvplot()` can generate plots with [Bokeh](https://bokeh.org/) (default), [Matplotlib](https://matplotlib.org/) or [Plotly](https://plotly.com/). diff --git a/doc/ref/api/index.md b/doc/ref/api/index.md index 2d4e91ee5..736562d42 100644 --- a/doc/ref/api/index.md +++ b/doc/ref/api/index.md @@ -36,7 +36,7 @@ df.hvplot(kind='scatter') Under the hood, these special imports like `import hvplot.pandas` register an accessor that returns an instance of an `hvPlotBase` class. Tabular-like data sources rely on the `hvPlotTabular` class and gridded-like sources on `hvPlot` (subclass of `hvPlotTabular` extended with methods like {meth}`image `): -- `hvPlotTabular`: cuDF, Dask, Fugue, Ibis, Pandas, Streamz +- `hvPlotTabular`: cuDF, Dask, Fugue, Ibis, Pandas - `hvPlotTabularDuckDB`: DuckDB - `hvPlotTabularPolars`: Polars - `hvPlot`: Xarray diff --git a/doc/ref/data_libraries.ipynb b/doc/ref/data_libraries.ipynb index e8ce66656..67a89f21d 100644 --- a/doc/ref/data_libraries.ipynb +++ b/doc/ref/data_libraries.ipynb @@ -42,20 +42,20 @@ "id": "5f0d3dcc", "metadata": {}, "source": [ - "| Source | Module | Type | HoloViews interface | Comment |\n", - "| --------------------------------- | ---------------- | ----------------- | ------------------- | ----------------------------- |\n", - "| [Pandas](#libraries-pandas) | `hvplot.pandas` | Tabular | ✅ | |\n", - "| [Dask](#libraries-dask) | `hvplot.dask` | Tabular | ✅ | |\n", - "| [Geopandas](#libraries-geopandas) | `hvplot.pandas` | Tabular | ✅ | |\n", - "| [Ibis](#libraries-ibis) | `hvplot.ibis` | Tabular | ✅ | |\n", - "| [Polars](#libraries-polars) | `hvplot.polars` | Tabular | ❌ | To Pandas |\n", - "| [DuckDB](#libraries-duckdb) | `hvplot.duckdb` | Tabular | ❌ | To Pandas |\n", - "| [RAPIDS cuDF](#libraries-cudf) | `hvplot.cudf` | Tabular | ✅ | GPU |\n", - "| [Fugue](#libraries-fugue) | `hvplot.fugue` | Tabular | ❌ | Experimental |\n", + "| Source | Module | Type | HoloViews interface | Comment |\n", + "| --------------------------------- | ---------------- | ---------------- | ------------------- | ----------------------------- |\n", + "| [Pandas](#libraries-pandas) | `hvplot.pandas` | Tabular | ✅ | |\n", + "| [Dask](#libraries-dask) | `hvplot.dask` | Tabular | ✅ | |\n", + "| [Geopandas](#libraries-geopandas) | `hvplot.pandas` | Tabular | ✅ | |\n", + "| [Ibis](#libraries-ibis) | `hvplot.ibis` | Tabular | ✅ | |\n", + "| [Polars](#libraries-polars) | `hvplot.polars` | Tabular | ❌ | To Pandas |\n", + "| [DuckDB](#libraries-duckdb) | `hvplot.duckdb` | Tabular | ❌ | To Pandas |\n", + "| [RAPIDS cuDF](#libraries-cudf) | `hvplot.cudf` | Tabular | ✅ | GPU |\n", + "| [Fugue](#libraries-fugue) | `hvplot.fugue` | Tabular | ❌ | Experimental |\n", "| [Xarray](#libraries-xarray) | `hvplot.xarray` | Multidimensional | ✅ | |\n", - "| [Intake](#libraries-intake) | `hvplot.intake` | Catalog | ❌ | |\n", - "| [Streamz](#libraries-streamz) | `hvplot.streamz` | Streaming | ✅ | |\n", - "| [NetworkX](#libraries-networkx) | - | Graph | - | [Different API](api-networkx) |\n" + "| [Intake](#libraries-intake) | `hvplot.intake` | Catalog | ❌ | |\n", + "| [Streamz](#libraries-streamz) | `hvplot.streamz` | Streaming | ✅ | **Deprecated** |\n", + "| [NetworkX](#libraries-networkx) | - | Graph | - | [Different API](api-networkx) |\n" ] }, { @@ -630,7 +630,12 @@ "metadata": {}, "source": [ "(libraries-streamz)=\n", - "### Streamz" + "### \n", + "\n", + ":::{warning}\n", + "\n", + "Streamz support has been deprecated and will be removed in a future version.\n", + ":::" ] }, { diff --git a/doc/user_guide/Introduction.ipynb b/doc/user_guide/Introduction.ipynb index a7d793214..a6f6dfd95 100644 --- a/doc/user_guide/Introduction.ipynb +++ b/doc/user_guide/Introduction.ipynb @@ -19,7 +19,6 @@ "* [Polars](https://www.pola.rs/): Polars is a fast DataFrame library/in-memory query engine (columnar/tabular data)\n", "* [Dask](https://www.dask.org): DataFrame, Series (distributed/out of core arrays and columnar data)\n", "* [XArray](https://xarray.pydata.org): Dataset, DataArray (labelled multidimensional arrays)\n", - "* [Streamz](https://streamz.readthedocs.io): DataFrame(s), Series(s) (streaming columnar data)\n", "* [Intake](https://github.com/ContinuumIO/intake): DataSource (data catalogues)\n", "* [GeoPandas](https://geopandas.org): GeoDataFrame (geometry data)\n", "* [NetworkX](https://networkx.github.io/documentation/stable/): Graph (network graphs)\n", diff --git a/doc/user_guide/Streaming.ipynb b/doc/user_guide/Streaming.ipynb index 4cc21ee8c..3850a9da4 100644 --- a/doc/user_guide/Streaming.ipynb +++ b/doc/user_guide/Streaming.ipynb @@ -11,6 +11,11 @@ "cell_type": "markdown", "metadata": {}, "source": [ + ":::{warning}\n", + "\n", + "Streamz support has been deprecated and will be removed in a future version.\n", + ":::\n", + "\n", "hvPlot supports [streamz](https://github.com/mrocklin/streamz) DataFrame and Series objects, automatically generating streaming plots in a Jupyter notebook or deployed as a [Bokeh Server app](https://bokeh.pydata.org/en/latest/docs/user_guide/server.html). \n", "\n", "All hvPlot methods on streamz objects return HoloViews `DynamicMap` objects that update the plot whenever `streamz` triggers an event. For more information on `DynamicMap` and HoloViews dynamic plotting support, see the [HoloViews User Guide](https://holoviews.org/user_guide); here we will focus on using the simple, high-level hvPlot API rather than on the details of how events and data flow behind the scenes.\n", diff --git a/doc/user_guide/index.md b/doc/user_guide/index.md index 606d7a5dc..0ebf89cb5 100644 --- a/doc/user_guide/index.md +++ b/doc/user_guide/index.md @@ -51,7 +51,7 @@ pandas.plotting module. - [Subplots](Subplots) How to generate subplots and grids. - [Streaming](Streaming) - How to use hvPlot for streaming plots with the streamz library. + How to use hvPlot for streaming plots with the streamz library (**Streamz support is deprecated**). - [Gridded Data](Gridded_Data) How to use hvPlot for plotting XArray-based gridded data. - [Network Graphs](NetworkX) diff --git a/hvplot/streamz.py b/hvplot/streamz.py index 311fb9616..7ad42c8f2 100644 --- a/hvplot/streamz.py +++ b/hvplot/streamz.py @@ -1,3 +1,8 @@ +import warnings + +from .util import _find_stack_level + + def patch(name='hvplot', extension='bokeh', logo=False): from . import hvPlotTabular, post_patch, _module_extensions @@ -7,6 +12,13 @@ def patch(name='hvplot', extension='bokeh', logo=False): raise ImportError( 'Could not patch plotting API onto streamz. Streamz could not be imported.' ) + + warnings.warn( + 'streamz support has been deprecated and will be removed in a future version.', + DeprecationWarning, + stacklevel=_find_stack_level(), + ) + if 'hvplot.streamz' not in _module_extensions: _patch_plot = lambda self: hvPlotTabular(self) # noqa: E731 _patch_plot.__doc__ = hvPlotTabular.__call__.__doc__ diff --git a/hvplot/tests/testdeprecations.py b/hvplot/tests/testdeprecations.py index 98e32afee..d396af4f1 100644 --- a/hvplot/tests/testdeprecations.py +++ b/hvplot/tests/testdeprecations.py @@ -28,3 +28,14 @@ def test_converter_argument_hover_formatters(): df = pd.DataFrame({'x': [0, 1], 'y': [0, 1]}) with pytest.warns(DeprecationWarning): HoloViewsConverter(df, 'x', 'y', hover_formatters={'@{y}': 'printf'}) + + +def test_streamz_patch(): + pytest.importorskip('streamz') + with pytest.warns( + DeprecationWarning, + match='streamz support has been deprecated', + ): + from hvplot.streamz import patch + + patch() diff --git a/hvplot/tests/testpatch.py b/hvplot/tests/testpatch.py index ea7982856..2b54da02c 100644 --- a/hvplot/tests/testpatch.py +++ b/hvplot/tests/testpatch.py @@ -74,8 +74,6 @@ def test_xarray_dataset_patched(self): class TestPatchStreamz(TestCase): def setUp(self): - if sys.version_info[:2] >= (3, 14): - raise SkipTest('streamz not compatible') try: import streamz # noqa except ImportError: