diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index dbc1c57..ec9080b 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -32,3 +32,15 @@ jobs: - name: Test with tox run: | tox + + minimal-dependencies: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Create virtual env + run: python3 -m venv venv --upgrade-deps + - name: Install pyaro + run: source venv/bin/activate && pip install ./ + - name: Try importing pyaro + run: source venv/bin/activate && python -c "import pyaro; print(pyaro.__version__)" + diff --git a/src/pyaro/timeseries/Filter.py b/src/pyaro/timeseries/Filter.py index 3c92226..1a3fd38 100644 --- a/src/pyaro/timeseries/Filter.py +++ b/src/pyaro/timeseries/Filter.py @@ -1227,11 +1227,11 @@ def __init__( upper: float | None = None, ): if "cf_units" not in sys.modules: - raise ModuleNotFoundError( + logger.info( "valleyfloor_relaltitude filter is missing required dependency 'cf-units'. Please install to use this filter." ) if "xarray" not in sys.modules: - raise ModuleNotFoundError( + logger.info( "valleyfloor_relaltitude filter is missing required dependency 'xarray'. Please install to use this filter." ) @@ -1254,8 +1254,16 @@ def name(self): return "valleyfloor_relaltitude" def filter_stations(self, stations: dict[str, Station]) -> dict[str, Station]: - filtered_stations = {} + if "cf_units" not in sys.modules: + raise ModuleNotFoundError( + "valleyfloor_relaltitude filter is missing required dependency 'cf-units'. Please install to use this filter." + ) + if "xarray" not in sys.modules: + raise ModuleNotFoundError( + "valleyfloor_relaltitude filter is missing required dependency 'xarray'. Please install to use this filter." + ) + filtered_stations = {} with xr.open_dataset(self._topo_file) as topo: for k, v in stations.items(): lat = v.latitude @@ -1285,7 +1293,7 @@ def _calculate_relative_altitude( *, radius: float, altitude: float, - topo: xr.Dataset, + topo: "xr.Dataset", ): """Calculates relative altitude