diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b2ab31db..e8adf3d6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,7 @@ Breaking changes ^^^^^^^^^^^^^^^^ * The `xhydro` testing utilities have been rewritten to use `pooch` for downloading and caching testing datasets from `hydrologie/xhydro-testdata`. (:pull:`212`). * The `xhydro` testing utilities now require `pytest-xdist` as a development dependency. (:pull:`212`). +* Many core dependencies have been updated to more modern versions. (:pull:`218`). Internal changes ^^^^^^^^^^^^^^^^ diff --git a/environment-dev.yml b/environment-dev.yml index aac4203c..b5779d4d 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -5,30 +5,30 @@ dependencies: - python >=3.10,<3.13 # Don't forget to sync changes between environment.yml, environment-dev.yml, and pyproject.toml! # Main packages - - cartopy - - geopandas - - haversine + - cartopy >=0.23.0 + - geopandas >=1.0 + - haversine >=2.8.0 - importlib-metadata <8.0 # Required for xesmf >=8.4.0,<8.6 to work on Windows - leafmap - - numpy <2.0.0 + - numpy >=1.23,<2.0.0 - pandas >=2.2.0 - planetary-computer - pystac - pystac-client - pooch >=1.8.0 - pydantic >=2.0,<2.5.3 # FIXME: Remove pin once our dependencies (xclim, xscen) support pydantic 2.5.3 - - pyyaml + - pyyaml >=6.0.2 - rasterio <=1.3.11 # temporary pin until https://github.com/xarray-contrib/xvec/issues/85 is addressed. - ravenpy >=0.15.0 - - rioxarray + - rioxarray >=0.15.0 - s3fs <=2024.6.1 - - spotpy + - spotpy >=1.6.2 - stackstac >=0.5.1 - - statsmodels + - statsmodels >=0.14.0 - tqdm - xarray >=2023.11.0 - - xarray-spatial - - xclim >=0.48.2 + - xarray-spatial >=0.3.7 + - xclim >=0.48.2,<0.53 - xdatasets >=0.3.6 - xscen >=0.8.3 - xvec @@ -42,10 +42,10 @@ dependencies: - flake8-rst-docstrings >=0.3.0 - furo - ipykernel - - ipython + - ipython >=8.5.0 - isort ==5.13.2 - jupyter_client - - lmoments3 + - lmoments3 >=1.0.7 - nbsphinx - nbval >=0.11.0 - numpydoc >=1.8.0 diff --git a/environment.yml b/environment.yml index c9f52ade..a8a933b9 100644 --- a/environment.yml +++ b/environment.yml @@ -6,29 +6,29 @@ dependencies: - pip >=24.2.0 # Don't forget to sync changes between environment.yml, environment-dev.yml, and pyproject.toml! # Main packages - - cartopy - - geopandas - - haversine + - cartopy >=0.23.0 + - geopandas >=1.0 + - haversine >=2.8.0 - importlib-metadata <8.0 # Required for xesmf >=8.4.0,<8.6 to work on Windows - leafmap - - numpy <2.0.0 + - numpy >=1.23,<2.0.0 - pandas >=2.2.0 - planetary-computer - pooch >=1.8.0 - pydantic >=2.0,<2.5.3 # FIXME: Remove pin once our dependencies (xclim, xscen) support pydantic 2.5.3 - pystac - pystac-client - - pyyaml + - pyyaml >=6.0.2 - rasterio <=1.3.11 # temporary pin until https://github.com/xarray-contrib/xvec/issues/85 is addressed. - ravenpy >=0.15.0 - - rioxarray - - spotpy + - rioxarray >=0.15.0 + - spotpy >=1.6.2 - stackstac >=0.5.1 - - statsmodels + - statsmodels >=0.14.0 - tqdm - xarray >=2023.11.0 - - xarray-spatial - - xclim >=0.48.2 + - xarray-spatial >=0.3.7 + - xclim >=0.48.2,<0.53 - xdatasets >=0.3.5 - xscen >=0.8.3 - xvec diff --git a/pyproject.toml b/pyproject.toml index f42dd20c..92015e27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,29 +36,29 @@ classifiers = [ dynamic = ["description", "version"] dependencies = [ # Don't forget to sync changes between environment.yml, environment-dev.yml, and pyproject.toml! - "cartopy", - "geopandas", - "haversine", + "cartopy >=0.23.0", + "geopandas >=1.0", + "haversine >=2.8.0", "importlib-metadata <8.0", # Required for xesmf >=8.4.0,<8.6 to work on Windows "leafmap", - "numpy <2.0.0", + "numpy >=1.23,<2.0.0", "pandas >=2.2.0", "planetary-computer", "pooch >=1.8.0", "pydantic >=2.0,<2.5.3", "pystac", "pystac-client", - "pyyaml", + "pyyaml >=6.0.2", "rasterio <=1.3.11", # temporary pin until https://github.com/xarray-contrib/xvec/issues/85 is addressed. "ravenpy >=0.15.0", - "rioxarray", - "spotpy", + "rioxarray >=0.15.0", + "spotpy >=1.6.2", "stackstac >=0.5.1", - "statsmodels", + "statsmodels >=0.14.0", "tqdm", "xarray >=2023.11.0", - "xarray-spatial", - "xclim >=0.48.2", + "xarray-spatial >=0.3.7", + "xclim >=0.48.2,<0.53", "xdatasets >=0.3.6", "xscen >=0.8.3", "xvec" @@ -93,7 +93,7 @@ docs = [ "furo", "hvplot", "ipykernel", - "ipython", + "ipython >=8.5.0", "jupyter_client", "nbsphinx", "nbval", diff --git a/src/xhydro/gis.py b/src/xhydro/gis.py index 208a035e..0191f84e 100644 --- a/src/xhydro/gis.py +++ b/src/xhydro/gis.py @@ -16,14 +16,13 @@ import planetary_computer import pystac_client import rasterio -import rasterio.features import rioxarray # noqa: F401 import stackstac import xarray as xr import xvec # noqa: F401 from matplotlib.colors import ListedColormap from pystac.extensions.item_assets import ItemAssetsExtension -from pystac.extensions.projection import ProjectionExtension as proj # noqa: N813 +from pystac.extensions.projection import ProjectionExtension from shapely import Point from tqdm.auto import tqdm from xrspatial import aspect, slope @@ -39,6 +38,7 @@ # FIXME: `map` is a reserved keyword in Python, so it should not be used as a variable name. def watershed_delineation( + *, coordinates: list[tuple] | tuple | None = None, map: leafmap.Map | None = None, ) -> gpd.GeoDataFrame: @@ -591,7 +591,7 @@ def land_use_plot( merged, item = _merge_stac_dataset(catalog, bbox_of_interest, year) - epsg = proj.ext(item).epsg + epsg = ProjectionExtension.ext(item).epsg class_count = len(class_names)