diff --git a/CITATION.cff b/CITATION.cff index 29b7fb47..c11f056a 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -38,5 +38,5 @@ keywords: - neural processes - active learning license: MIT -version: 0.3.3 +version: 0.3.4 date-released: '2023-11-07' diff --git a/README.md b/README.md index f3874a34..5320848b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ data with neural processes

----------- -[![release](https://img.shields.io/badge/release-v0.3.3-green?logo=github)](https://github.com/tom-andersson/deepsensor/releases) +[![release](https://img.shields.io/badge/release-v0.3.4-green?logo=github)](https://github.com/tom-andersson/deepsensor/releases) [![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://tom-andersson.github.io/deepsensor/) ![Tests](https://github.com/tom-andersson/deepsensor/actions/workflows/tests.yml/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/tom-andersson/deepsensor/badge.svg?branch=main)](https://coveralls.io/github/tom-andersson/deepsensor?branch=main) diff --git a/deepsensor/data/sources.py b/deepsensor/data/sources.py index 4f60df37..bddc6982 100644 --- a/deepsensor/data/sources.py +++ b/deepsensor/data/sources.py @@ -2,7 +2,6 @@ from deepsensor.plot import extent_str_to_tuple -from get_station_data import ghcnd import urllib.request import multiprocessing from functools import partial @@ -31,6 +30,11 @@ def get_ghcnd_station_data( into a pandas DataFrame. Source: https://www.ncei.noaa.gov/products/land-based-station/global-historical-climatology-network-daily + .. note:: + Requires the `scotthosking/get-station-data` repository to be installed + manually in your Python environment with: + `pip install git+https://github.com/scott-hosking/get-station-data.git` + .. note:: Example key variable IDs: - ``"TAVG"``: Average temperature (degrees Celsius) @@ -78,6 +82,12 @@ def get_ghcnd_station_data( Station data with indexes ``time``, ``lat``, ``lon``, ``station`` and columns ``var1``, ``var2``, etc. """ + try: + from get_station_data import ghcnd + except ImportError: + raise ImportError( + "Must manually pip-install get-station-data with: `pip install git+https://github.com/scott-hosking/get-station-data.git`" + ) if not cache: cache_dir = None memory = Memory(cache_dir, verbose=0) @@ -301,7 +311,7 @@ def _get_era5_reanalysis_data_parallel( extent="global", cache=False, cache_dir=".datacache", -): +): # pragma: no cover """ Helper function for downloading ERA5 data in parallel with caching. @@ -359,7 +369,7 @@ def get_gldas_land_mask( verbose: bool = False, cache: bool = False, cache_dir: str = ".datacache", -) -> xr.DataArray: +) -> xr.DataArray: # pragma: no cover """ Get GLDAS land mask at 0.25 degree resolution. Source: https://ldas.gsfc.nasa.gov/gldas/vegetation-class-mask @@ -439,7 +449,7 @@ def get_earthenv_auxiliary_data( verbose: bool = False, cache: bool = False, cache_dir: str = ".datacache", -) -> xr.Dataset: +) -> xr.Dataset: # pragma: no cover """ Download global static auxiliary data from EarthEnv into an xarray DataArray. See: https://www.earthenv.org/topography @@ -558,7 +568,7 @@ def _get_auxiliary_data_cached( return _get_auxiliary_data_cached(var_IDs, extent, resolution, verbose) -if __name__ == "__main__": +if __name__ == "__main__": # pragma: no cover # Using the same settings allows use to use pre-downloaded cached data data_range = ("2015-06-25", "2015-06-30") extent = "europe" diff --git a/setup.cfg b/setup.cfg index 245c2dd2..82796b27 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = deepsensor -version = 0.3.3 +version = 0.3.4 author = Tom R. Andersson author_email = tomand@bas.ac.uk description = A Python package for modelling xarray and pandas data with neural processes. @@ -37,7 +37,6 @@ install_requires = pooch gcsfs zarr - get-station-data @ git+ssh://git@github.com/scotthosking/get-station-data.git [options.extras_require] testing =