From 931dd3fd985347cdf8953a4b9d915a5d6867654f Mon Sep 17 00:00:00 2001 From: Matthew Iannucci Date: Tue, 3 Sep 2024 16:41:12 -0400 Subject: [PATCH] Add 3.12 support, remove deps no longer used (#78) * Add 3.12 support, remove deps no longer used * appease lint * Remove more rioxarray relics --- .github/workflows/tests.yml | 2 +- .isort.cfg | 2 +- pyproject.toml | 2 +- requirements.txt | 2 -- xpublish_wms/utils.py | 18 ------------------ xpublish_wms/wms/get_map.py | 1 - 6 files changed, 3 insertions(+), 24 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b138f88..cb027c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] os: [windows-latest, ubuntu-latest, macos-latest] steps: diff --git a/.isort.cfg b/.isort.cfg index dd9ab8f..58e999c 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,2 +1,2 @@ [settings] -known_third_party = numpy,pytest,requests,setuptools,xpublish,xarray,shapely,fastapi,pydantic,cf_xarray,rioxarray,Pillow,matplotlib +known_third_party = numpy,pytest,requests,setuptools,xpublish,xarray,shapely,fastapi,pydantic,cf_xarray,Pillow,matplotlib diff --git a/pyproject.toml b/pyproject.toml index 70ba475..25d924e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "xpublish_wms" authors = [{ name = "Matthew Iannucci", email = "matt.iannucci@rpsgroup.com" }] description = "WMS plugin for xpublish" readme = "README.md" -requires-python = ">=3.9,<3.12" +requires-python = ">=3.9,<3.13" keywords = ["xarray", "xpublish", "wms"] license = { file = "LICENSE.txt" } diff --git a/requirements.txt b/requirements.txt index d1ed5d2..e6bd387 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,5 @@ cf_xarray datashader matplotlib Pillow -rioxarray>=0.12.2 -scikit-learn xarray xpublish>=0.3.0,<0.4.0 diff --git a/xpublish_wms/utils.py b/xpublish_wms/utils.py index 69d16b8..986afca 100644 --- a/xpublish_wms/utils.py +++ b/xpublish_wms/utils.py @@ -1,6 +1,5 @@ import logging import math -from typing import Union import cartopy.geodesic import numpy as np @@ -49,23 +48,6 @@ def speed_and_dir_for_uv(u, v): return [speed, dir] -def ensure_crs( - ds: Union[xr.Dataset, xr.DataArray], - default_crs: str = "EPSG:4326", -) -> Union[xr.Dataset, xr.DataArray]: - """ - Ensure our dataset has a CRS - :param ds: - :param default_crs: - :return: - """ - # logger.debug(f"CRS found in dataset : {ds.rio.crs}") - if not ds.rio.crs: - logger.debug(f"Settings default CRS : {default_crs}") - ds.rio.write_crs(default_crs, inplace=True) - return ds - - def lnglat_to_cartesian(longitude, latitude): """ Converts latitude and longitude to cartesian coordinates diff --git a/xpublish_wms/wms/get_map.py b/xpublish_wms/wms/get_map.py index ae7c78a..e936de6 100644 --- a/xpublish_wms/wms/get_map.py +++ b/xpublish_wms/wms/get_map.py @@ -11,7 +11,6 @@ import matplotlib.cm as cm import numpy as np import pandas as pd -import rioxarray # noqa import xarray as xr from fastapi.responses import StreamingResponse