Skip to content

Commit

Permalink
Remove dependency breaking PyPI upload (pypi/warehouse#7136); Raise e…
Browse files Browse the repository at this point in the history
…rror about manually installing
  • Loading branch information
tom-andersson committed Nov 7, 2023
1 parent ee531f7 commit e09f985
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ keywords:
- neural processes
- active learning
license: MIT
version: 0.3.3
version: 0.3.4
date-released: '2023-11-07'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data with neural processes</p>

-----------

[![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)
Expand Down
20 changes: 15 additions & 5 deletions deepsensor/data/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = deepsensor
version = 0.3.3
version = 0.3.4
author = Tom R. Andersson
author_email = [email protected]
description = A Python package for modelling xarray and pandas data with neural processes.
Expand Down Expand Up @@ -37,7 +37,6 @@ install_requires =
pooch
gcsfs
zarr
get-station-data @ git+ssh://[email protected]/scotthosking/get-station-data.git

[options.extras_require]
testing =
Expand Down

0 comments on commit e09f985

Please sign in to comment.