diff --git a/ci/requirements/all-but-dask.yml b/ci/requirements/all-but-dask.yml index a673e4a14c7..d30c94348d0 100644 --- a/ci/requirements/all-but-dask.yml +++ b/ci/requirements/all-but-dask.yml @@ -30,7 +30,6 @@ dependencies: - pip - pseudonetcdf - pydap - # - pynio # not compatible with netCDF4>1.5.3, see #4491 - pytest - pytest-cov - pytest-env diff --git a/ci/requirements/environment-windows.yml b/ci/requirements/environment-windows.yml index 8401e31a8fc..22bfa3543d3 100644 --- a/ci/requirements/environment-windows.yml +++ b/ci/requirements/environment-windows.yml @@ -30,7 +30,6 @@ dependencies: - pre-commit - pseudonetcdf - pydap - # - pynio # Not available on Windows - pytest - pytest-cov - pytest-env diff --git a/ci/requirements/environment.yml b/ci/requirements/environment.yml index 2d71233a610..d6bc8466c76 100644 --- a/ci/requirements/environment.yml +++ b/ci/requirements/environment.yml @@ -34,7 +34,6 @@ dependencies: - pre-commit - pseudonetcdf - pydap - # - pynio # not compatible with netCDF4>1.5.3, see #4491 - pytest - pytest-cov - pytest-env diff --git a/ci/requirements/min-all-deps.yml b/ci/requirements/min-all-deps.yml index 18ec6077737..c7e157992f0 100644 --- a/ci/requirements/min-all-deps.yml +++ b/ci/requirements/min-all-deps.yml @@ -40,7 +40,6 @@ dependencies: - pip - pseudonetcdf=3.2 - pydap=3.2 - # - pynio=1.5.5 # see: https://github.com/pydata/xarray/issues/4491 - pytest - pytest-cov - pytest-env diff --git a/doc/user-guide/io.rst b/doc/user-guide/io.rst index beab5fc050b..c29d87556f8 100644 --- a/doc/user-guide/io.rst +++ b/doc/user-guide/io.rst @@ -1209,6 +1209,10 @@ We recommend installing cfgrib via conda:: Formats supported by PyNIO -------------------------- +.. warning:: + + The PyNIO backend is deprecated_. PyNIO is no longer maintained_. See + Xarray can also read GRIB, HDF4 and other file formats supported by PyNIO_, if PyNIO is installed. To use PyNIO to read such files, supply ``engine='pynio'`` to :py:func:`open_dataset`. @@ -1217,12 +1221,9 @@ We recommend installing PyNIO via conda:: conda install -c conda-forge pynio -.. warning:: - - PyNIO is no longer actively maintained and conflicts with netcdf4 > 1.5.3. - The PyNIO backend may be moved outside of xarray in the future. - .. _PyNIO: https://www.pyngl.ucar.edu/Nio.shtml +.. _deprecated: https://github.com/pydata/xarray/issues/4491 +.. _maintained: https://github.com/NCAR/pynio/issues/53 .. _io.PseudoNetCDF: diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 13867daebf4..d1ce28d3e54 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -49,7 +49,8 @@ Breaking changes Deprecations ~~~~~~~~~~~~ - +- The PyNIO backend has been deprecated (:issue:`4491`, :pull:`7301`). + By `Joe Hamman `_. Bug fixes ~~~~~~~~~ diff --git a/xarray/backends/pynio_.py b/xarray/backends/pynio_.py index 07fb2b94673..cb7c65c0432 100644 --- a/xarray/backends/pynio_.py +++ b/xarray/backends/pynio_.py @@ -1,5 +1,7 @@ from __future__ import annotations +import warnings + import numpy as np from ..core import indexing @@ -55,6 +57,12 @@ class NioDataStore(AbstractDataStore): def __init__(self, filename, mode="r", lock=None, **kwargs): import Nio + warnings.warn( + "The PyNIO backend is Deprecated and will be removed from Xarray in a future release. " + "See https://github.com/pydata/xarray/issues/4491 for more information", + DeprecationWarning, + ) + if lock is None: lock = PYNIO_LOCK self.lock = ensure_lock(lock) @@ -94,6 +102,15 @@ def close(self): class PynioBackendEntrypoint(BackendEntrypoint): + """ + PyNIO backend + + .. deprecated:: 0.20.0 + + Deprecated as PyNIO is no longer supported. See + https://github.com/pydata/xarray/issues/4491 for more information + """ + available = module_available("Nio") def open_dataset(