pyopenrivercam 0.9.0__tar.gz → 0.9.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/CHANGELOG.md +17 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/PKG-INFO +5 -2
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/__init__.py +1 -1
- pyopenrivercam-0.9.2/pyorc/sample_data.py +97 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyproject.toml +4 -1
- pyopenrivercam-0.9.0/pyorc/sample_data.py +0 -91
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/.gitignore +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/.pre-commit-config.yaml +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/Dockerfile +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/LICENSE +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/README.md +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/TRADEMARK.md +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/environment.yml +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/api/__init__.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/api/cameraconfig.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/api/cross_section.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/api/frames.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/api/mask.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/api/orcbase.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/api/plot.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/api/transect.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/api/velocimetry.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/api/video.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/cli/__init__.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/cli/cli_elements.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/cli/cli_utils.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/cli/log.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/cli/main.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/const.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/cv.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/helpers.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/plot_helpers.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/project.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/pyorc.sh +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/service/__init__.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/service/camera_config.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/service/velocimetry.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/velocimetry/__init__.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/pyorc/velocimetry/ffpiv.py +0 -0
- {pyopenrivercam-0.9.0 → pyopenrivercam-0.9.2}/sonar-project.properties +0 -0
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## [0.9.2] = 2026-01-15
|
|
2
|
+
### Added
|
|
3
|
+
### Changed
|
|
4
|
+
### Deprecated
|
|
5
|
+
### Removed
|
|
6
|
+
### Fixed
|
|
7
|
+
- fixed problems with sample data downloading (403 errors)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [0.9.1] = 2026-01-13
|
|
11
|
+
### Added
|
|
12
|
+
### Changed
|
|
13
|
+
### Deprecated
|
|
14
|
+
### Removed
|
|
15
|
+
### Fixed
|
|
16
|
+
- fixed python<3.10 compatibility
|
|
17
|
+
|
|
1
18
|
## [0.9.0] = 2025-12-23
|
|
2
19
|
### Added
|
|
3
20
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyopenrivercam
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: pyorc: free and open-source image-based surface velocity and discharge.
|
|
5
5
|
Author-email: Hessel Winsemius <winsemius@rainbowsensing.com>
|
|
6
6
|
Requires-Python: >=3.9
|
|
@@ -28,9 +28,12 @@ Requires-Dist: geopandas
|
|
|
28
28
|
Requires-Dist: matplotlib
|
|
29
29
|
Requires-Dist: netCDF4
|
|
30
30
|
Requires-Dist: numba>0.56
|
|
31
|
-
Requires-Dist: numpy
|
|
31
|
+
Requires-Dist: numpy==1.26.4; python_version == '3.9'
|
|
32
|
+
Requires-Dist: numpy>=2; python_version >= '3.10'
|
|
32
33
|
Requires-Dist: opencv-python
|
|
33
34
|
Requires-Dist: packaging; platform_machine == 'armv7l'
|
|
35
|
+
Requires-Dist: pillow==9.5.0; python_version == '3.9'
|
|
36
|
+
Requires-Dist: pillow; python_version >= '3.10'
|
|
34
37
|
Requires-Dist: pip
|
|
35
38
|
Requires-Dist: pyproj
|
|
36
39
|
Requires-Dist: pythran; platform_machine == 'armv7l'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""pyorc: free and open-source image-based surface velocity and discharge."""
|
|
2
2
|
|
|
3
|
-
__version__ = "0.9.
|
|
3
|
+
__version__ = "0.9.2"
|
|
4
4
|
|
|
5
5
|
from .api import CameraConfig, CrossSection, Frames, Transect, Velocimetry, Video, get_camera_config, load_camera_config # noqa
|
|
6
6
|
from .project import * # noqa
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"""Retrieval of sample dataset."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import time
|
|
5
|
+
import zipfile
|
|
6
|
+
|
|
7
|
+
import platformdirs
|
|
8
|
+
import requests
|
|
9
|
+
|
|
10
|
+
cache_dir = platformdirs.user_cache_dir("pyorc")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def zenodo_pooch(record_id, cache_name):
|
|
14
|
+
"""Retrieve files from Zenodo record."""
|
|
15
|
+
try:
|
|
16
|
+
import pooch
|
|
17
|
+
except ImportError:
|
|
18
|
+
raise ImportError("This function needs pooch. Install pyorc with pip install pyopenrivercam[extra]")
|
|
19
|
+
r = requests.get(
|
|
20
|
+
f"https://zenodo.org/api/records/{record_id}",
|
|
21
|
+
timeout=30,
|
|
22
|
+
# headers=headers
|
|
23
|
+
)
|
|
24
|
+
if r.status_code != 200:
|
|
25
|
+
raise RuntimeError(f"Failed to fetch metadata for record {record_id}. {r.status_code} {r.text}")
|
|
26
|
+
meta = r.json()
|
|
27
|
+
urls = {f["key"]: f["links"]["self"] for f in meta["files"]}
|
|
28
|
+
|
|
29
|
+
return pooch.create(
|
|
30
|
+
path=pooch.os_cache(cache_name),
|
|
31
|
+
base_url="",
|
|
32
|
+
urls=urls,
|
|
33
|
+
registry={name: None for name in urls},
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def get_hommerich_dataset():
|
|
38
|
+
"""Retrieve and cache sample dataset of Sheaf river."""
|
|
39
|
+
# Define the DOI link
|
|
40
|
+
filename = "20241010_081717.mp4"
|
|
41
|
+
file_path = os.path.join(cache_dir, filename)
|
|
42
|
+
# Fetch the dataset
|
|
43
|
+
if not os.path.exists(file_path):
|
|
44
|
+
for attempt in range(5):
|
|
45
|
+
registry = zenodo_pooch(
|
|
46
|
+
record_id=15002591,
|
|
47
|
+
cache_name="pyorc",
|
|
48
|
+
)
|
|
49
|
+
try:
|
|
50
|
+
file_path = registry.fetch(filename, progressbar=True)
|
|
51
|
+
break
|
|
52
|
+
except Exception as e:
|
|
53
|
+
if attempt == 4:
|
|
54
|
+
raise f"Download failed with error: {e}."
|
|
55
|
+
else:
|
|
56
|
+
print(f"Download failed with error: {e}. Retrying...")
|
|
57
|
+
time.sleep(1)
|
|
58
|
+
print(f"Hommerich video is available in {file_path}")
|
|
59
|
+
return file_path
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def get_hommerich_pyorc_zip():
|
|
63
|
+
"""Retrieve and cache sample dataset of Sheaf river."""
|
|
64
|
+
#
|
|
65
|
+
# # Define the DOI link
|
|
66
|
+
filename = "hommerich_20241010_081717_pyorc_data.zip.zip"
|
|
67
|
+
file_path = os.path.join(cache_dir, filename)
|
|
68
|
+
# Fetch the dataset
|
|
69
|
+
if not os.path.exists(file_path):
|
|
70
|
+
for attempt in range(5):
|
|
71
|
+
registry = zenodo_pooch(
|
|
72
|
+
record_id=15002591,
|
|
73
|
+
cache_name="pyorc",
|
|
74
|
+
)
|
|
75
|
+
try:
|
|
76
|
+
file_path = registry.fetch(filename, progressbar=True)
|
|
77
|
+
break
|
|
78
|
+
except Exception as e:
|
|
79
|
+
if attempt == 4:
|
|
80
|
+
raise f"Download failed with error: {e}."
|
|
81
|
+
else:
|
|
82
|
+
print(f"Download failed with error: {e}. Retrying...")
|
|
83
|
+
time.sleep(1)
|
|
84
|
+
print(f"Hommerich video is available in {file_path}")
|
|
85
|
+
return file_path
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def get_hommerich_pyorc_files():
|
|
89
|
+
"""Unzip hommerich pyorc files and return file list."""
|
|
90
|
+
zip_file = get_hommerich_pyorc_zip()
|
|
91
|
+
trg_dir = os.path.split(zip_file)[0]
|
|
92
|
+
if not os.path.exists(os.path.join(trg_dir, "hommerich.yml")):
|
|
93
|
+
# apparently the pyorc files are not yet preset. Unzip the record.
|
|
94
|
+
print("Unzipping sample data...")
|
|
95
|
+
with zipfile.ZipFile(zip_file, "r") as f:
|
|
96
|
+
f.extractall(trg_dir)
|
|
97
|
+
return trg_dir
|
|
@@ -23,9 +23,12 @@ dependencies = [
|
|
|
23
23
|
"matplotlib",
|
|
24
24
|
"netCDF4",
|
|
25
25
|
"numba>0.56",
|
|
26
|
-
"numpy
|
|
26
|
+
"numpy==1.26.4; python_version == '3.9'",
|
|
27
|
+
"numpy>=2; python_version >= '3.10'",
|
|
27
28
|
"opencv-python",
|
|
28
29
|
"packaging; platform_machine == 'armv7l'",
|
|
30
|
+
"pillow==9.5.0; python_version == '3.9'",
|
|
31
|
+
"pillow; python_version >= '3.10'",
|
|
29
32
|
"pip",
|
|
30
33
|
"pyproj",
|
|
31
34
|
"pythran; platform_machine == 'armv7l'",
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"""Retrieval of sample dataset."""
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
import time
|
|
5
|
-
import zipfile
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def get_hommerich_dataset():
|
|
9
|
-
"""Retrieve and cache sample dataset of Sheaf river."""
|
|
10
|
-
try:
|
|
11
|
-
import pooch
|
|
12
|
-
except ImportError:
|
|
13
|
-
raise ImportError("This function needs pooch. Install pyorc with pip install pyopenrivercam[extra]")
|
|
14
|
-
|
|
15
|
-
# Define the DOI link
|
|
16
|
-
filename = "20241010_081717.mp4"
|
|
17
|
-
base_url = "https://zenodo.org/records/15002591/files"
|
|
18
|
-
url = base_url + "/" + filename
|
|
19
|
-
print(f"Retrieving or providing cached version of dataset from {url}")
|
|
20
|
-
# Create a Pooch registry to manage downloads
|
|
21
|
-
registry = pooch.create(
|
|
22
|
-
# Define the cache directory
|
|
23
|
-
path=pooch.os_cache("pyorc"),
|
|
24
|
-
# Define the base URL for fetching data
|
|
25
|
-
base_url=base_url,
|
|
26
|
-
# Define the registry with the file we're expecting to download
|
|
27
|
-
registry={filename: None},
|
|
28
|
-
)
|
|
29
|
-
# Fetch the dataset
|
|
30
|
-
for attempt in range(5):
|
|
31
|
-
try:
|
|
32
|
-
file_path = registry.fetch(filename, progressbar=True)
|
|
33
|
-
break
|
|
34
|
-
except Exception as e:
|
|
35
|
-
if attempt == 4:
|
|
36
|
-
raise f"Download failed with error: {e}."
|
|
37
|
-
else:
|
|
38
|
-
print(f"Download failed with error: {e}. Retrying...")
|
|
39
|
-
time.sleep(1)
|
|
40
|
-
print(f"Hommerich video is available in {file_path}")
|
|
41
|
-
return file_path
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def get_hommerich_pyorc_zip():
|
|
45
|
-
"""Retrieve and cache sample dataset of Sheaf river."""
|
|
46
|
-
try:
|
|
47
|
-
import pooch
|
|
48
|
-
except ImportError:
|
|
49
|
-
raise ImportError("This function needs pooch. Install pyorc with pip install pyopenrivercam[extra]")
|
|
50
|
-
|
|
51
|
-
# Define the DOI link
|
|
52
|
-
filename = "hommerich_20241010_081717_pyorc_data.zip.zip"
|
|
53
|
-
base_url = "https://zenodo.org/records/15002591/files"
|
|
54
|
-
url = base_url + "/" + filename
|
|
55
|
-
print(f"Retrieving or providing cached version of dataset from {url}")
|
|
56
|
-
# Create a Pooch registry to manage downloads
|
|
57
|
-
registry = pooch.create(
|
|
58
|
-
# Define the cache directory
|
|
59
|
-
path=pooch.os_cache("pyorc"),
|
|
60
|
-
# Define the base URL for fetching data
|
|
61
|
-
base_url=base_url,
|
|
62
|
-
# Define the registry with the file we're expecting to download
|
|
63
|
-
registry={filename: None},
|
|
64
|
-
)
|
|
65
|
-
# Fetch the dataset
|
|
66
|
-
file_path = registry.fetch(filename, progressbar=True)
|
|
67
|
-
# Fetch the dataset
|
|
68
|
-
for attempt in range(5):
|
|
69
|
-
try:
|
|
70
|
-
file_path = registry.fetch(filename, progressbar=True)
|
|
71
|
-
break
|
|
72
|
-
except Exception as e:
|
|
73
|
-
if attempt == 4:
|
|
74
|
-
raise f"Download failed with error: {e}."
|
|
75
|
-
else:
|
|
76
|
-
print(f"Download failed with error: {e}. Retrying...")
|
|
77
|
-
time.sleep(1)
|
|
78
|
-
print(f"Hommerich video is available in {file_path}")
|
|
79
|
-
return file_path
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
def get_hommerich_pyorc_files():
|
|
83
|
-
"""Unzip hommerich pyorc files and return file list."""
|
|
84
|
-
zip_file = get_hommerich_pyorc_zip()
|
|
85
|
-
trg_dir = os.path.split(zip_file)[0]
|
|
86
|
-
if not os.path.exists(os.path.join(trg_dir, "hommerich.yml")):
|
|
87
|
-
# apparently the pyorc files are not yet preset. Unzip the record.
|
|
88
|
-
print("Unzipping sample data...")
|
|
89
|
-
with zipfile.ZipFile(zip_file, "r") as f:
|
|
90
|
-
f.extractall(trg_dir)
|
|
91
|
-
return trg_dir
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|