Skip to content

Commit 5e29f5d

Browse files
authored
Merge branch 'AntSimi:master' into master
2 parents a5a4d58 + 99a848f commit 5e29f5d

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
channels:
22
- conda-forge
3-
- defaults
43
dependencies:
5-
- python=3.10
4+
- python>=3.10, <3.13
65
- ffmpeg
76
- pip
87
- pip:
8+
- -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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: binder-pyeddytracker
22
channels:
33
- conda-forge
4-
- defaults
54
dependencies:
6-
- python=3.10
5+
- python>=3.10, <3.13
76
- pip
87
- ffmpeg
98
- 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
)

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
matplotlib
1+
matplotlib < 3.8 # need an update of contour management
22
opencv-python
33
pint
44
polygon3
55
pyyaml
66
requests
77
scipy
8-
zarr
8+
zarr < 3.0
99
netCDF4
1010
numpy
1111
numba

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)