Skip to content

Commit 99a848f

Browse files
authored
solve doc problem (#255)
* reject python 3.13 * use pip instead of setuptools * add sample id to install
1 parent 449b7f8 commit 99a848f

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ build:
77
python: "mambaforge-latest"
88
python:
99
install:
10-
- method: setuptools
10+
- method: pip
1111
path: .

doc/environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
channels:
22
- conda-forge
33
dependencies:
4-
- python>=3.10
4+
- python>=3.10, <3.13
55
- ffmpeg
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

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: binder-pyeddytracker
22
channels:
33
- conda-forge
44
dependencies:
5-
- python>=3.10
5+
- python>=3.10, <3.13
66
- pip
77
- ffmpeg
88
- pip:

examples/02_eddy_identification/pet_eddy_detection_ACC.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Two detections are provided : with a filtered ADT and without filtering
88
99
"""
10+
1011
from datetime import datetime
1112

1213
from matplotlib import pyplot as plt, style
@@ -80,7 +81,7 @@ def set_fancy_labels(fig, ticklabelsize=14, labelsize=14, labelweight="semibold"
8081
# Identification
8182
# ^^^^^^^^^^^^^^
8283
# Run the identification step with slices of 2 mm
83-
date = datetime(2016, 5, 15)
84+
date = datetime(2019, 2, 23)
8485
kw_ident = dict(
8586
date=date, step=0.002, shape_error=70, sampling=30, uname="u", vname="v"
8687
)

src/py_eddy_tracker/data/__init__.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
20160515 adt None None longitude latitude . \
99
--cut 800 --fil 1
1010
"""
11+
1112
import io
1213
import lzma
1314
from os import path
@@ -26,14 +27,20 @@ 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+
if path.endswith(".nc"):
33+
return py_eddy_tracker_sample_id.get_remote_demo_sample(path)
34+
content = open(py_eddy_tracker_sample_id.get_remote_demo_sample(f"{path}.tar.xz"), "rb").read()
35+
except:
36+
if path.endswith(".nc"):
37+
content = requests.get(
38+
f"https://github.com/AntSimi/py-eddy-tracker-sample-id/raw/master/{path}"
39+
).content
40+
return io.BytesIO(content)
3041
content = requests.get(
31-
f"https://github.com/AntSimi/py-eddy-tracker-sample-id/raw/master/{path}"
42+
f"https://github.com/AntSimi/py-eddy-tracker-sample-id/raw/master/{path}.tar.xz"
3243
).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
3744

3845
# Tar module could manage lzma tar, but it will apply uncompress for each extractfile
3946
tar = tarfile.open(mode="r", fileobj=io.BytesIO(lzma.decompress(content)))

0 commit comments

Comments
 (0)