Skip to content

Commit e09f985

Browse files
committed
Remove dependency breaking PyPI upload (pypi/warehouse#7136); Raise error about manually installing
1 parent ee531f7 commit e09f985

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ keywords:
3838
- neural processes
3939
- active learning
4040
license: MIT
41-
version: 0.3.3
41+
version: 0.3.4
4242
date-released: '2023-11-07'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ data with neural processes</p>
1111

1212
-----------
1313

14-
[![release](https://img.shields.io/badge/release-v0.3.3-green?logo=github)](https://github.com/tom-andersson/deepsensor/releases)
14+
[![release](https://img.shields.io/badge/release-v0.3.4-green?logo=github)](https://github.com/tom-andersson/deepsensor/releases)
1515
[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://tom-andersson.github.io/deepsensor/)
1616
![Tests](https://github.com/tom-andersson/deepsensor/actions/workflows/tests.yml/badge.svg)
1717
[![Coverage Status](https://coveralls.io/repos/github/tom-andersson/deepsensor/badge.svg?branch=main)](https://coveralls.io/github/tom-andersson/deepsensor?branch=main)

deepsensor/data/sources.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from deepsensor.plot import extent_str_to_tuple
44

5-
from get_station_data import ghcnd
65
import urllib.request
76
import multiprocessing
87
from functools import partial
@@ -31,6 +30,11 @@ def get_ghcnd_station_data(
3130
into a pandas DataFrame.
3231
Source: https://www.ncei.noaa.gov/products/land-based-station/global-historical-climatology-network-daily
3332
33+
.. note::
34+
Requires the `scotthosking/get-station-data` repository to be installed
35+
manually in your Python environment with:
36+
`pip install git+https://github.com/scott-hosking/get-station-data.git`
37+
3438
.. note::
3539
Example key variable IDs:
3640
- ``"TAVG"``: Average temperature (degrees Celsius)
@@ -78,6 +82,12 @@ def get_ghcnd_station_data(
7882
Station data with indexes ``time``, ``lat``, ``lon``, ``station`` and columns
7983
``var1``, ``var2``, etc.
8084
"""
85+
try:
86+
from get_station_data import ghcnd
87+
except ImportError:
88+
raise ImportError(
89+
"Must manually pip-install get-station-data with: `pip install git+https://github.com/scott-hosking/get-station-data.git`"
90+
)
8191
if not cache:
8292
cache_dir = None
8393
memory = Memory(cache_dir, verbose=0)
@@ -301,7 +311,7 @@ def _get_era5_reanalysis_data_parallel(
301311
extent="global",
302312
cache=False,
303313
cache_dir=".datacache",
304-
):
314+
): # pragma: no cover
305315
"""
306316
Helper function for downloading ERA5 data in parallel with caching.
307317
@@ -359,7 +369,7 @@ def get_gldas_land_mask(
359369
verbose: bool = False,
360370
cache: bool = False,
361371
cache_dir: str = ".datacache",
362-
) -> xr.DataArray:
372+
) -> xr.DataArray: # pragma: no cover
363373
"""
364374
Get GLDAS land mask at 0.25 degree resolution.
365375
Source: https://ldas.gsfc.nasa.gov/gldas/vegetation-class-mask
@@ -439,7 +449,7 @@ def get_earthenv_auxiliary_data(
439449
verbose: bool = False,
440450
cache: bool = False,
441451
cache_dir: str = ".datacache",
442-
) -> xr.Dataset:
452+
) -> xr.Dataset: # pragma: no cover
443453
"""
444454
Download global static auxiliary data from EarthEnv into an xarray DataArray.
445455
See: https://www.earthenv.org/topography
@@ -558,7 +568,7 @@ def _get_auxiliary_data_cached(
558568
return _get_auxiliary_data_cached(var_IDs, extent, resolution, verbose)
559569

560570

561-
if __name__ == "__main__":
571+
if __name__ == "__main__": # pragma: no cover
562572
# Using the same settings allows use to use pre-downloaded cached data
563573
data_range = ("2015-06-25", "2015-06-30")
564574
extent = "europe"

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = deepsensor
3-
version = 0.3.3
3+
version = 0.3.4
44
author = Tom R. Andersson
55
author_email = [email protected]
66
description = A Python package for modelling xarray and pandas data with neural processes.
@@ -37,7 +37,6 @@ install_requires =
3737
pooch
3838
gcsfs
3939
zarr
40-
get-station-data @ git+ssh://[email protected]/scotthosking/get-station-data.git
4140

4241
[options.extras_require]
4342
testing =

0 commit comments

Comments
 (0)