1
0
forked from pool/python-xarray
python-xarray/local_dataset.patch
Sebastian Wagner 15f5c83eeb Accepting request 895529 from home:mcepl:branches:devel:languages:python:numeric
- Add local_dataset.patch allowing the use of the cached datasets
  (gh#pydata/xarray#5377).
- Add scipy-interpolate.patch adding a missing import
  scipy.interpolate to test_interp.py (gh#pydata/xarray#5375).
- Add test_resample_loffset.patch to fix test_resample_loffset
  test (gh#pydata/xarray#5364).

OBS-URL: https://build.opensuse.org/request/show/895529
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-xarray?expand=0&rev=53
2021-05-27 06:19:25 +00:00

19 lines
621 B
Diff

---
xarray/tutorial.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/xarray/tutorial.py
+++ b/xarray/tutorial.py
@@ -139,7 +139,10 @@ def open_dataset(
url = f"{base_url}/raw/{version}/{path.name}"
# retrieve the file
- filepath = pooch.retrieve(url=url, known_hash=None, path=cache_dir)
+ fname = pathlib.Path(cache_dir, path).expanduser()
+ if not fname.exists():
+ fname = None
+ filepath = pooch.retrieve(url=url, fname=fname, known_hash=None, path=cache_dir)
ds = _open_dataset(filepath, engine=engine, **kws)
if not cache:
ds = ds.load()