File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ dependencies:
66 - pip
77 - pip :
88 - -r ../requirements.txt
9+ - git+https://github.com/AntSimi/py-eddy-tracker-sample-id.git
910 - sphinx-gallery
1011 - sphinx_rtd_theme
1112 - sphinx>=3.1
Original file line number Diff line number Diff line change 88 20160515 adt None None longitude latitude . \
99 --cut 800 --fil 1
1010"""
11+
1112import io
1213import lzma
1314from os import path
@@ -26,14 +27,21 @@ def get_remote_demo_sample(path):
2627 if path .endswith (".nc" ):
2728 return io .BytesIO (content )
2829 else :
29- if path .endswith (".nc" ):
30+ try :
31+ import py_eddy_tracker_sample_id
32+ py_eddy_tracker_sample_id .get_remote_demo_sample ()
33+ if path .endswith (".nc" ):
34+ return py_eddy_tracker_sample_id .get_remote_demo_sample (path )
35+ content = open (py_eddy_tracker_sample_id .get_remote_demo_sample (f"{ path } .tar.xz" ), "rb" ).read ()
36+ except :
37+ if path .endswith (".nc" ):
38+ content = requests .get (
39+ f"https://github.com/AntSimi/py-eddy-tracker-sample-id/raw/master/{ path } "
40+ ).content
41+ return io .BytesIO (content )
3042 content = requests .get (
31- f"https://github.com/AntSimi/py-eddy-tracker-sample-id/raw/master/{ path } "
43+ f"https://github.com/AntSimi/py-eddy-tracker-sample-id/raw/master/{ path } .tar.xz "
3244 ).content
33- return io .BytesIO (content )
34- content = requests .get (
35- f"https://github.com/AntSimi/py-eddy-tracker-sample-id/raw/master/{ path } .tar.xz"
36- ).content
3745
3846 # Tar module could manage lzma tar, but it will apply uncompress for each extractfile
3947 tar = tarfile .open (mode = "r" , fileobj = io .BytesIO (lzma .decompress (content )))
You can’t perform that action at this time.
0 commit comments