diff --git a/README.md b/README.md index 2ce137d85..3f6605ec0 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), [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), [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/binder/environment.yml b/binder/environment.yml index 44ee3ef2a..dedf1f4c0 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -8,9 +8,6 @@ dependencies: - geopandas>=0.9.0 - xarray>=0.18.2 - networkx>=2.6.3 - - intake>=0.6.5 - - intake-parquet>=0.2.3 - - intake-xarray>=0.5.0 - dask>=2021.3.0 - datashader>=0.6.5 - notebook>=5.4 diff --git a/doc/_static/home/intake.gif b/doc/_static/home/intake.gif deleted file mode 100644 index 1e430b6b4..000000000 Binary files a/doc/_static/home/intake.gif and /dev/null differ diff --git a/doc/index.md b/doc/index.md index 06a5e53d1..a39d7dfa3 100644 --- a/doc/index.md +++ b/doc/index.md @@ -156,20 +156,6 @@ align: center ``` ::: -:::{tab-item} Intake -```python -import hvplot.intake -from hvplot.sample_data import catalogue as cat - -cat.us_crime.hvplot.line(x='Year', y='Violent Crime rate') -``` -```{image} ./_static/home/intake.gif ---- -alt: Works with Intake -align: center ---- -::: - :::{tab-item} NetworkX ```python import hvplot.networkx as hvnx diff --git a/doc/ref/data_libraries.ipynb b/doc/ref/data_libraries.ipynb index 715927e20..2c953da1f 100644 --- a/doc/ref/data_libraries.ipynb +++ b/doc/ref/data_libraries.ipynb @@ -53,9 +53,8 @@ "| [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 | ❌ since 1.23.0 | **Deprecated** |\n", - "| [NetworkX](#libraries-networkx) | - | Graph | - | [Different API](api-networkx) |\n" + "| [Streamz](#libraries-streamz) | `hvplot.streamz` | Streaming | ✅ | |\n", + "| [NetworkX](#libraries-networkx) | - | Graph | - | [Different API](api-networkx) |\n" ] }, { @@ -591,31 +590,6 @@ "ds['A'].hvplot.image(height=150)" ] }, - { - "cell_type": "markdown", - "id": "2530f2da-2287-43d7-998d-bfb3eeb64d80", - "metadata": {}, - "source": [ - "## Catalog" - ] - }, - { - "cell_type": "markdown", - "id": "55668697-f5f5-40e6-9fd2-f023bea3e9dc", - "metadata": {}, - "source": [ - "(libraries-intake)=\n", - "### Intake" - ] - }, - { - "cell_type": "markdown", - "id": "7c01a461-5c22-48a3-b5e1-a2a3716c5bf4", - "metadata": {}, - "source": [ - "`.hvplot()` supports [Intake](https://github.com/intake/intake) `DataSource` objects." - ] - }, { "cell_type": "markdown", "id": "111f4441-f5b2-4355-92aa-de79c4fe30c7", diff --git a/doc/tutorials/getting_started.ipynb b/doc/tutorials/getting_started.ipynb index cc6af29c0..eca56c1b3 100644 --- a/doc/tutorials/getting_started.ipynb +++ b/doc/tutorials/getting_started.ipynb @@ -66,8 +66,8 @@ "To run the guides in this site locally, create an environment with the required dependencies:\n", "\n", "```bash\n", - "conda create -n hvplot-env -c conda-forge --override-channels hvplot geoviews datashader xarray pandas geopandas dask networkx intake intake-xarray intake-parquet s3fs scipy spatialpandas pooch rasterio fiona plotly matplotlib hvsampledata jupyterlab\n", - "```" + "conda create -n hvplot-env -c conda-forge --override-channels hvplot geoviews datashader xarray pandas geopandas dask streamz networkx scipy spatialpandas pooch rasterio fiona plotly matplotlib hvsampledata jupyterlab\n", + "```\n" ] }, { diff --git a/doc/user_guide/Introduction.ipynb b/doc/user_guide/Introduction.ipynb index a6f6dfd95..70c643afc 100644 --- a/doc/user_guide/Introduction.ipynb +++ b/doc/user_guide/Introduction.ipynb @@ -19,7 +19,7 @@ "* [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", - "* [Intake](https://github.com/ContinuumIO/intake): DataSource (data catalogues)\n", + "* [Streamz](https://streamz.readthedocs.io): DataFrame(s), Series(s) (streaming columnar data)\n", "* [GeoPandas](https://geopandas.org): GeoDataFrame (geometry data)\n", "* [NetworkX](https://networkx.github.io/documentation/stable/): Graph (network graphs)\n", "\n", @@ -118,7 +118,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "This interactive plot makes it much easier to explore the properties of the data, without having to write code to select ranges, columns, or data values manually. Note that while pandas, dask and xarray all use the `.hvplot` method, `intake` uses hvPlot as its main plotting API, which means that is available using `.plot()`." + "This interactive plot makes it much easier to explore the properties of the data, without having to write code to select ranges, columns, or data values manually." ] }, { diff --git a/hvplot/intake.py b/hvplot/intake.py index 637222f34..19405ac84 100644 --- a/hvplot/intake.py +++ b/hvplot/intake.py @@ -1,6 +1,16 @@ +import warnings + from packaging.version import Version from . import hvPlot, post_patch, _module_extensions +from .util import _find_stack_level + +warnings.warn( + 'hvplot.intake is deprecated and will be removed in a future version. ' + 'Use pandas, xarray, or other supported libraries to read your data directly.', + FutureWarning, + stacklevel=_find_stack_level(), +) def patch(name='hvplot', extension='bokeh', logo=False): diff --git a/hvplot/tests/testdeprecations.py b/hvplot/tests/testdeprecations.py index 8aefe267e..4bf2d497f 100644 --- a/hvplot/tests/testdeprecations.py +++ b/hvplot/tests/testdeprecations.py @@ -2,11 +2,14 @@ Tests for deprecation warnings. """ +import os import sys import importlib +import tempfile import pandas as pd import pytest +from hvplot import hvPlot from hvplot.converter import HoloViewsConverter from hvplot.plotting import plot from hvplot.tests.util import makeDataFrame @@ -54,3 +57,33 @@ def test_sample_data_deprecation(): with pytest.warns(FutureWarning): importlib.import_module('hvplot.sample_data') sys.modules.pop('hvplot.sample_data', None) + + +def test_intake_deprecation(): + pytest.importorskip('intake') + with pytest.warns(FutureWarning): + importlib.import_module('hvplot.intake') + sys.modules.pop('hvplot.intake', None) + + +def test_intake_datasource_hvplot_deprecation(disable_param_warnings_as_exceptions): + intake = pytest.importorskip('intake') + + from intake.source.base import DataSource + + # Patch .hvplot onto DataSource manually to avoid importing hvplot.intake, + # which fires its own separate FutureWarning and would pollute this test. + if not hasattr(DataSource, 'hvplot'): + DataSource.hvplot = property(lambda self: hvPlot(self)) + + df = pd.DataFrame({'x': [1, 2, 3], 'y': [4, 5, 6]}) + with tempfile.NamedTemporaryFile(suffix='.csv', delete=False, mode='w') as f: + df.to_csv(f, index=False) + tmppath = f.name + + try: + src = intake.open_csv(tmppath) + with pytest.warns(FutureWarning, match='intake DataSource'): + src.hvplot.line(x='x', y='y') + finally: + os.unlink(tmppath) diff --git a/hvplot/util.py b/hvplot/util.py index eb08acbbd..1786feb3f 100644 --- a/hvplot/util.py +++ b/hvplot/util.py @@ -654,6 +654,13 @@ def support_index(data): def process_intake(data, use_dask): + warnings.warn( + 'Passing an intake DataSource to hvplot is deprecated and will be removed in a ' + 'future version. ' + 'Use pandas, xarray, or other supported libraries to read your data first before passing to hvplot.', + FutureWarning, + stacklevel=_find_stack_level(), + ) if data.container not in ('dataframe', 'xarray'): raise NotImplementedError( 'Plotting interface currently only ' diff --git a/pixi.toml b/pixi.toml index 2b98151e2..9d2580701 100644 --- a/pixi.toml +++ b/pixi.toml @@ -125,13 +125,11 @@ jinja2 = "*" fugue = "*" # end fugue ibis-duckdb = ">=9.0.0" # ibis-framework[duckdb] -intake-parquet = ">=0.2.3" -intake-xarray = ">=0.5.0,<2" -intake = ">=0.6.5,<2.0.0" ipywidgets = "*" networkx = ">=2.6.3" matplotlib = "*" notebook = ">=5.4" +netcdf4 = "*" numba = ">=0.51.0" pillow = ">=8.2.0" plotly = "*" @@ -169,6 +167,7 @@ bokeh_sampledata = "*" psutil = "*" cftime = "*" numpydoc = "*" +intake = ">=0.6.5,<2.0.0" # Kept only for deprecation tests. [feature.test-example.dependencies] # Dependencies required to run the examples notebooks. diff --git a/pyproject.toml b/pyproject.toml index ac0bf52c2..f3a4a0800 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -115,9 +115,6 @@ examples = [ "fugue[sql]", "hvplot[fugue-sql]", "ibis-framework[duckdb]", # ibis-duckdb on conda - "intake-parquet >=0.2.3", - "intake-xarray >=0.5.0,<2", - "intake >=0.6.5,<2.0.0", "ipywidgets", "networkx >=2.6.3", "matplotlib",