diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3da38a5d..424c0d0f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,14 @@ Changelog for cfgrib ==================== +0.9.10.3 (2022-xx-xx) +--------------------- + +- Replaced ``distutils.version`` py ``packaging.version`` and + added description and url to the xarray plugin. + See `#318 `_. + + 0.9.10.2 (2022-10-04) --------------------- diff --git a/cfgrib/xarray_plugin.py b/cfgrib/xarray_plugin.py index d30a3b93..1b6e5c82 100644 --- a/cfgrib/xarray_plugin.py +++ b/cfgrib/xarray_plugin.py @@ -1,18 +1,18 @@ import os import pathlib import typing as T -from distutils.version import LooseVersion import numpy as np import xarray as xr +from packaging.version import Version -from . import abc, dataset, messages - -if LooseVersion(xr.__version__) <= "0.17.0": +if Version(xr.__version__) <= Version("0.17.0"): raise ImportError("xarray_plugin module needs xarray version >= 0.18+") from xarray.backends.common import AbstractDataStore, BackendArray, BackendEntrypoint +from . import abc, dataset, messages + # FIXME: Add a dedicated lock, even if ecCodes is supposed to be thread-safe # in most circumstances. See: # https://confluence.ecmwf.int/display/ECC/Frequently+Asked+Questions @@ -71,6 +71,9 @@ def get_encoding(self) -> T.Dict[str, T.Set[str]]: class CfGribBackend(BackendEntrypoint): + description = "Open GRIB files (.grib, .grib2, .grb and .grb2) in Xarray" + url = "https://github.com/ecmwf/cfgrib" + def guess_can_open( self, store_spec: str,