Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ build:
python: "mambaforge-latest"
python:
install:
- method: setuptools
- method: pip
path: .
3 changes: 2 additions & 1 deletion doc/environment.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
channels:
- conda-forge
dependencies:
- python>=3.10
- python>=3.10, <3.13
- ffmpeg
- pip
- pip:
- -r ../requirements.txt
- git+https://github.com/AntSimi/py-eddy-tracker-sample-id.git
- sphinx-gallery
- sphinx_rtd_theme
- sphinx>=3.1
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: binder-pyeddytracker
channels:
- conda-forge
dependencies:
- python>=3.10
- python>=3.10, <3.13
- pip
- ffmpeg
- pip:
Expand Down
3 changes: 2 additions & 1 deletion examples/02_eddy_identification/pet_eddy_detection_ACC.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Two detections are provided : with a filtered ADT and without filtering

"""

from datetime import datetime

from matplotlib import pyplot as plt, style
Expand Down Expand Up @@ -80,7 +81,7 @@ def set_fancy_labels(fig, ticklabelsize=14, labelsize=14, labelweight="semibold"
# Identification
# ^^^^^^^^^^^^^^
# Run the identification step with slices of 2 mm
date = datetime(2016, 5, 15)
date = datetime(2019, 2, 23)
kw_ident = dict(
date=date, step=0.002, shape_error=70, sampling=30, uname="u", vname="v"
)
Expand Down
19 changes: 13 additions & 6 deletions src/py_eddy_tracker/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
20160515 adt None None longitude latitude . \
--cut 800 --fil 1
"""

import io
import lzma
from os import path
Expand All @@ -26,14 +27,20 @@ def get_remote_demo_sample(path):
if path.endswith(".nc"):
return io.BytesIO(content)
else:
if path.endswith(".nc"):
try:
import py_eddy_tracker_sample_id
if path.endswith(".nc"):
return py_eddy_tracker_sample_id.get_remote_demo_sample(path)
content = open(py_eddy_tracker_sample_id.get_remote_demo_sample(f"{path}.tar.xz"), "rb").read()
except:
if path.endswith(".nc"):
content = requests.get(
f"https://github.com/AntSimi/py-eddy-tracker-sample-id/raw/master/{path}"
).content
return io.BytesIO(content)
content = requests.get(
f"https://github.com/AntSimi/py-eddy-tracker-sample-id/raw/master/{path}"
f"https://github.com/AntSimi/py-eddy-tracker-sample-id/raw/master/{path}.tar.xz"
).content
return io.BytesIO(content)
content = requests.get(
f"https://github.com/AntSimi/py-eddy-tracker-sample-id/raw/master/{path}.tar.xz"
).content

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