water-column-sonar-processing 25.1.7__tar.gz → 25.3.0__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.
Potentially problematic release.
This version of water-column-sonar-processing might be problematic. Click here for more details.
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/.github/workflows/test_action.yaml +2 -2
- water_column_sonar_processing-25.3.0/.pre-commit-config.yaml +53 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/PKG-INFO +21 -12
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/README.md +6 -6
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/pyproject.toml +30 -7
- water_column_sonar_processing-25.3.0/tests/conftest.py +77 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/aws/dynamodb_manager.py +27 -32
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/aws/s3_manager.py +52 -64
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/aws/s3fs_manager.py +3 -9
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/cruise/create_empty_zarr_store.py +14 -14
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/cruise/datatree_manager.py +3 -6
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/cruise/resample_regrid.py +67 -49
- water_column_sonar_processing-25.3.0/water_column_sonar_processing/geometry/__init__.py +11 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/geometry/elevation_manager.py +16 -17
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/geometry/geometry_manager.py +25 -25
- water_column_sonar_processing-25.3.0/water_column_sonar_processing/geometry/line_simplification.py +150 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/geometry/pmtile_generation.py +99 -64
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/index/index_manager.py +67 -32
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/model/zarr_manager.py +32 -21
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/process.py +15 -13
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/processing/__init__.py +2 -2
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/processing/batch_downloader.py +66 -41
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/processing/raw_to_zarr.py +121 -82
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/utility/constants.py +10 -1
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/utility/pipeline_status.py +11 -15
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing.egg-info/PKG-INFO +21 -12
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing.egg-info/SOURCES.txt +1 -1
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing.egg-info/requires.txt +10 -4
- water_column_sonar_processing-25.1.7/.pre-commit-config.yaml +0 -46
- water_column_sonar_processing-25.1.7/tests/conftest.py +0 -51
- water_column_sonar_processing-25.1.7/water_column_sonar_processing/geometry/__init__.py +0 -6
- water_column_sonar_processing-25.1.7/water_column_sonar_processing/geometry/geometry_simplification.py +0 -82
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/.env-test +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/.gitignore +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/.python-version +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/LICENSE +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/open-science-data-federation/ml/autoencoder_example.py +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/open-science-data-federation/osdf_examples/foo.ipynb +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/open-science-data-federation/osdf_examples/sonar_ai.ipynb +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/setup.cfg +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/tests/test_resources/index/calibrated_cruises.csv +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/tests/test_resources/raw_to_zarr/D20070724-T042400.bot +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/tests/test_resources/raw_to_zarr/D20070724-T042400.idx +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/tests/test_resources/raw_to_zarr/D20070724-T042400.raw +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/__init__.py +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/aws/__init__.py +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/aws/sns_manager.py +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/aws/sqs_manager.py +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/cruise/__init__.py +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/index/__init__.py +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/model/__init__.py +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/utility/__init__.py +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/utility/cleaner.py +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing/utility/timestamp.py +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing.egg-info/dependency_links.txt +0 -0
- {water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/water_column_sonar_processing.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v5.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: detect-aws-credentials
|
|
8
|
+
- id: check-docstring-first
|
|
9
|
+
- id: check-json
|
|
10
|
+
- id: check-toml
|
|
11
|
+
- id: check-yaml
|
|
12
|
+
- id: pretty-format-json
|
|
13
|
+
args: [ "--autofix", "--indent=2", "--no-sort-keys" ]
|
|
14
|
+
|
|
15
|
+
### Security Scan for AWS Secrets ###
|
|
16
|
+
- repo: local
|
|
17
|
+
hooks:
|
|
18
|
+
- id: trufflehog
|
|
19
|
+
name: TruffleHog
|
|
20
|
+
description: Detect secrets in your data.
|
|
21
|
+
entry: bash -c 'trufflehog git file://. --since-commit HEAD --no-verification --fail --no-update'
|
|
22
|
+
language: system
|
|
23
|
+
stages: [ "pre-commit", "pre-push" ]
|
|
24
|
+
|
|
25
|
+
# - repo: https://github.com/psf/black
|
|
26
|
+
# rev: 25.1.0
|
|
27
|
+
# hooks:
|
|
28
|
+
# - id: black
|
|
29
|
+
|
|
30
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
31
|
+
rev: v0.9.4
|
|
32
|
+
hooks:
|
|
33
|
+
# Run the linter.
|
|
34
|
+
- id: ruff
|
|
35
|
+
args: [ --fix ]
|
|
36
|
+
# Run the formatter.
|
|
37
|
+
- id: ruff-format
|
|
38
|
+
|
|
39
|
+
- repo: https://github.com/pycqa/isort
|
|
40
|
+
rev: 6.0.0
|
|
41
|
+
hooks:
|
|
42
|
+
- id: isort
|
|
43
|
+
name: isort (python)
|
|
44
|
+
args: ["--profile", "black", "--filter-files"]
|
|
45
|
+
|
|
46
|
+
### Static Security Scan ###
|
|
47
|
+
# To run manually you can do: "bandit -c pyproject.toml -r ."
|
|
48
|
+
- repo: https://github.com/PyCQA/bandit
|
|
49
|
+
rev: '1.8.0'
|
|
50
|
+
hooks:
|
|
51
|
+
- id: bandit
|
|
52
|
+
args: ["-c", "pyproject.toml"]
|
|
53
|
+
additional_dependencies: [ "bandit[toml]" ]
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: water_column_sonar_processing
|
|
3
|
-
Version: 25.
|
|
3
|
+
Version: 25.3.0
|
|
4
4
|
Summary: Processing tool for water column sonar data.
|
|
5
5
|
Author-email: Rudy Klucik <rudy.klucik@noaa.gov>
|
|
6
|
+
Maintainer-email: Rudy Klucik <rudy.klucik@noaa.gov>
|
|
6
7
|
Project-URL: Homepage, https://github.com/CI-CMG/water-column-sonar-processing
|
|
7
8
|
Project-URL: Issues, https://github.com/CI-CMG/water-column-sonar-processing/issues
|
|
9
|
+
Keywords: ocean,sonar,water column
|
|
8
10
|
Classifier: Programming Language :: Python :: 3
|
|
9
11
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
12
|
Classifier: Operating System :: OS Independent
|
|
@@ -20,13 +22,16 @@ Requires-Dist: geopandas==1.0.1
|
|
|
20
22
|
Requires-Dist: mock==5.1.0
|
|
21
23
|
Requires-Dist: moto[all]==5.0.27
|
|
22
24
|
Requires-Dist: moto[server]==5.0.27
|
|
25
|
+
Requires-Dist: networkx==3.4.2
|
|
23
26
|
Requires-Dist: numcodecs==0.13.1
|
|
24
27
|
Requires-Dist: numpy==1.26.4
|
|
25
28
|
Requires-Dist: pandas==2.2.3
|
|
26
29
|
Requires-Dist: pyarrow==18.1.0
|
|
30
|
+
Requires-Dist: pykalman==0.10.1
|
|
27
31
|
Requires-Dist: python-dotenv==1.0.1
|
|
28
32
|
Requires-Dist: requests==2.32.3
|
|
29
33
|
Requires-Dist: s3fs==2024.2.0
|
|
34
|
+
Requires-Dist: safety==3.2.14
|
|
30
35
|
Requires-Dist: scipy==1.14.1
|
|
31
36
|
Requires-Dist: setuptools
|
|
32
37
|
Requires-Dist: shapely==2.0.3
|
|
@@ -36,22 +41,26 @@ Requires-Dist: xbatcher==0.4.0
|
|
|
36
41
|
Requires-Dist: zarr==2.18.3
|
|
37
42
|
Provides-Extra: dev
|
|
38
43
|
Requires-Dist: bandit[toml]==1.8.0; extra == "dev"
|
|
44
|
+
Requires-Dist: bandit; extra == "dev"
|
|
39
45
|
Requires-Dist: build; extra == "dev"
|
|
40
|
-
Requires-Dist: pre-commit; extra == "dev"
|
|
41
|
-
Requires-Dist: pyinstaller; extra == "dev"
|
|
42
|
-
Requires-Dist: twine; extra == "dev"
|
|
43
46
|
Requires-Dist: flake8==7.1.1; extra == "dev"
|
|
47
|
+
Requires-Dist: isort; extra == "dev"
|
|
48
|
+
Requires-Dist: matplotlib==3.10.1; extra == "dev"
|
|
44
49
|
Requires-Dist: pooch==1.8.2; extra == "dev"
|
|
50
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
51
|
+
Requires-Dist: pyinstaller; extra == "dev"
|
|
45
52
|
Requires-Dist: pytest~=8.3.3; extra == "dev"
|
|
53
|
+
Requires-Dist: ruff; extra == "dev"
|
|
46
54
|
Requires-Dist: tqdm; extra == "dev"
|
|
47
|
-
Requires-Dist:
|
|
55
|
+
Requires-Dist: twine; extra == "dev"
|
|
48
56
|
Provides-Extra: test
|
|
49
57
|
Requires-Dist: pytest-cov; extra == "test"
|
|
58
|
+
Dynamic: license-file
|
|
50
59
|
|
|
51
60
|
# Water Column Sonar Processing
|
|
52
|
-
Processing tool for converting
|
|
61
|
+
Processing tool for converting Level_0 water column sonar data to Level_1 and Level_2 derived data sets as well as generating geospatial information.
|
|
53
62
|
|
|
54
|
-
     
|
|
55
64
|
|
|
56
65
|
# Setting up the Python Environment
|
|
57
66
|
> Python 3.10.12
|
|
@@ -89,8 +98,8 @@ Processing tool for converting L0 data to L1 and L2 as well as generating geospa
|
|
|
89
98
|
4. Choose ~/.pyenv/versions/mocking_aws/bin/python
|
|
90
99
|
3. Set up Python Facet (not sure if this is required)
|
|
91
100
|
1. File -> Project Structure or CMD + ;
|
|
92
|
-
2. Facets -> + -> Python
|
|
93
|
-
3. Set interpreter
|
|
101
|
+
2. Facets -> + -> Python
|
|
102
|
+
3. Set interpreter
|
|
94
103
|
|
|
95
104
|
# Installing Dependencies
|
|
96
105
|
```
|
|
@@ -136,13 +145,13 @@ https://colab.research.google.com/drive/1KiLMueXiz9WVB9o4RuzYeGjNZ6PsZU7a#scroll
|
|
|
136
145
|
# Tag a Release
|
|
137
146
|
Step 1 --> increment the semantic version in the zarr_manager.py "metadata" & the "pyproject.toml"
|
|
138
147
|
```commandline
|
|
139
|
-
git tag -a v25.1.
|
|
148
|
+
git tag -a v25.1.8 -m "Releasing version v25.1.8"
|
|
140
149
|
git push origin --tags
|
|
141
150
|
```
|
|
142
151
|
|
|
143
152
|
# To Publish To PROD
|
|
144
153
|
```commandline
|
|
145
|
-
|
|
154
|
+
uv build
|
|
146
155
|
python -m twine upload --repository pypi dist/*
|
|
147
156
|
```
|
|
148
157
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Water Column Sonar Processing
|
|
2
|
-
Processing tool for converting
|
|
2
|
+
Processing tool for converting Level_0 water column sonar data to Level_1 and Level_2 derived data sets as well as generating geospatial information.
|
|
3
3
|
|
|
4
|
-
     
|
|
5
5
|
|
|
6
6
|
# Setting up the Python Environment
|
|
7
7
|
> Python 3.10.12
|
|
@@ -39,8 +39,8 @@ Processing tool for converting L0 data to L1 and L2 as well as generating geospa
|
|
|
39
39
|
4. Choose ~/.pyenv/versions/mocking_aws/bin/python
|
|
40
40
|
3. Set up Python Facet (not sure if this is required)
|
|
41
41
|
1. File -> Project Structure or CMD + ;
|
|
42
|
-
2. Facets -> + -> Python
|
|
43
|
-
3. Set interpreter
|
|
42
|
+
2. Facets -> + -> Python
|
|
43
|
+
3. Set interpreter
|
|
44
44
|
|
|
45
45
|
# Installing Dependencies
|
|
46
46
|
```
|
|
@@ -86,13 +86,13 @@ https://colab.research.google.com/drive/1KiLMueXiz9WVB9o4RuzYeGjNZ6PsZU7a#scroll
|
|
|
86
86
|
# Tag a Release
|
|
87
87
|
Step 1 --> increment the semantic version in the zarr_manager.py "metadata" & the "pyproject.toml"
|
|
88
88
|
```commandline
|
|
89
|
-
git tag -a v25.1.
|
|
89
|
+
git tag -a v25.1.8 -m "Releasing version v25.1.8"
|
|
90
90
|
git push origin --tags
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
# To Publish To PROD
|
|
94
94
|
```commandline
|
|
95
|
-
|
|
95
|
+
uv build
|
|
96
96
|
python -m twine upload --repository pypi dist/*
|
|
97
97
|
```
|
|
98
98
|
|
{water_column_sonar_processing-25.1.7 → water_column_sonar_processing-25.3.0}/pyproject.toml
RENAMED
|
@@ -7,11 +7,15 @@ build-backend = "setuptools.build_meta"
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "water_column_sonar_processing"
|
|
10
|
-
version = "25.
|
|
10
|
+
version = "25.3.0"
|
|
11
11
|
authors = [
|
|
12
12
|
{ name="Rudy Klucik", email="rudy.klucik@noaa.gov" },
|
|
13
13
|
]
|
|
14
|
+
maintainers = [
|
|
15
|
+
{ name="Rudy Klucik", email="rudy.klucik@noaa.gov" },
|
|
16
|
+
]
|
|
14
17
|
description = "Processing tool for water column sonar data."
|
|
18
|
+
keywords = ["ocean", "sonar", "water column"]
|
|
15
19
|
readme = "README.md"
|
|
16
20
|
requires-python = ">=3.10"
|
|
17
21
|
classifiers = [
|
|
@@ -19,7 +23,6 @@ classifiers = [
|
|
|
19
23
|
"License :: OSI Approved :: MIT License",
|
|
20
24
|
"Operating System :: OS Independent",
|
|
21
25
|
]
|
|
22
|
-
|
|
23
26
|
dependencies = [
|
|
24
27
|
"aiobotocore==2.19.0",
|
|
25
28
|
"boto3==1.36.3",
|
|
@@ -30,13 +33,17 @@ dependencies = [
|
|
|
30
33
|
"mock==5.1.0",
|
|
31
34
|
"moto[all]==5.0.27",
|
|
32
35
|
"moto[server]==5.0.27",
|
|
36
|
+
"networkx==3.4.2",
|
|
33
37
|
"numcodecs==0.13.1",
|
|
34
38
|
"numpy==1.26.4",
|
|
35
39
|
"pandas==2.2.3",
|
|
40
|
+
#"pip-audit",
|
|
36
41
|
"pyarrow==18.1.0",
|
|
42
|
+
"pykalman==0.10.1",
|
|
37
43
|
"python-dotenv==1.0.1",
|
|
38
44
|
"requests==2.32.3",
|
|
39
45
|
"s3fs==2024.2.0",
|
|
46
|
+
"safety==3.2.14",
|
|
40
47
|
"scipy==1.14.1",
|
|
41
48
|
"setuptools",
|
|
42
49
|
"shapely==2.0.3",
|
|
@@ -49,15 +56,18 @@ dependencies = [
|
|
|
49
56
|
[project.optional-dependencies]
|
|
50
57
|
dev = [
|
|
51
58
|
"bandit[toml]==1.8.0",
|
|
59
|
+
"bandit",
|
|
52
60
|
"build",
|
|
53
|
-
"pre-commit",
|
|
54
|
-
"pyinstaller",
|
|
55
|
-
"twine",
|
|
56
61
|
"flake8==7.1.1",
|
|
62
|
+
"isort",
|
|
63
|
+
"matplotlib==3.10.1",
|
|
57
64
|
"pooch==1.8.2",
|
|
65
|
+
"pre-commit",
|
|
66
|
+
"pyinstaller",
|
|
58
67
|
"pytest~=8.3.3",
|
|
68
|
+
"ruff",
|
|
59
69
|
"tqdm",
|
|
60
|
-
"
|
|
70
|
+
"twine",
|
|
61
71
|
]
|
|
62
72
|
test = [
|
|
63
73
|
"pytest-cov",
|
|
@@ -69,5 +79,18 @@ Issues = "https://github.com/CI-CMG/water-column-sonar-processing/issues"
|
|
|
69
79
|
|
|
70
80
|
[tool.bandit]
|
|
71
81
|
exclude_dirs = ["tests"]
|
|
82
|
+
|
|
72
83
|
[tool.pre-commit-hooks.bandit]
|
|
73
|
-
exclude = ["*/tests/*"]
|
|
84
|
+
exclude = ["*/tests/*"]
|
|
85
|
+
|
|
86
|
+
#[tool.black]
|
|
87
|
+
#line-length = 150
|
|
88
|
+
|
|
89
|
+
[tool.isort]
|
|
90
|
+
known_first_party = "water_column_sonar_processing"
|
|
91
|
+
#known_third_party = ["_echopype_version", "setuptools"]
|
|
92
|
+
multi_line_output = 3
|
|
93
|
+
include_trailing_comma = true
|
|
94
|
+
force_grid_wrap = 0
|
|
95
|
+
combine_as_imports = true
|
|
96
|
+
#line_length = 150
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
import pooch
|
|
4
|
+
import pytest
|
|
5
|
+
|
|
6
|
+
HERE = Path(__file__).parent.absolute()
|
|
7
|
+
TEST_DATA_FOLDER = HERE / "test_resources"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
HB0707_RAW = pooch.create(
|
|
11
|
+
path=pooch.os_cache("water-column-sonar-processing"),
|
|
12
|
+
base_url="https://noaa-wcsd-pds.s3.amazonaws.com/data/raw/Henry_B._Bigelow/HB0707/EK60/",
|
|
13
|
+
retry_if_failed=1,
|
|
14
|
+
registry={
|
|
15
|
+
# https://noaa-wcsd-zarr-pds.s3.amazonaws.com/level_1/Henry_B._Bigelow/HB0707/EK60/D20070711-T182032.zarr/
|
|
16
|
+
# https://noaa-wcsd-pds.s3.amazonaws.com/data/raw/Henry_B._Bigelow/HB0707/EK60/D20070711-T182032.raw
|
|
17
|
+
# TODO: add bottom files
|
|
18
|
+
"D20070712-T124906.raw": "sha256:44f9b2402a8d6d51c69235d1e33c3e4ab570fc541e9f269009924378bf4d97a2", # 250 m, 158 MB
|
|
19
|
+
"D20070712-T124906.bot": "sha256:9eebd8b85a514f3df6b7c4ba127967302dfea7c5e9fb47c22e3182ad1a93c78f",
|
|
20
|
+
"D20070712-T152416.raw": "sha256:94a937eefd6ae5763c27c9ba1e4769b2b76fcc2d840e7db6c2e0edd925d6f70f", # 1000 m, 200 MB
|
|
21
|
+
"D20070712-T152416.bot": "sha256:65b16cff596502889f841e58061217660e066b07fb732ccf211f1c6e46ee8210",
|
|
22
|
+
},
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
HB1906_RAW = pooch.create(
|
|
26
|
+
path=pooch.os_cache("water-column-sonar-processing"),
|
|
27
|
+
base_url="https://noaa-wcsd-pds.s3.amazonaws.com/data/raw/Henry_B._Bigelow/HB1906/EK60/",
|
|
28
|
+
retry_if_failed=1,
|
|
29
|
+
registry={
|
|
30
|
+
# https://noaa-wcsd-pds.s3.amazonaws.com/data/raw/Henry_B._Bigelow/HB1906/EK60/D20191106-T034434.raw
|
|
31
|
+
# "D20190903-T171901.raw": "", # 6 meter depth
|
|
32
|
+
#
|
|
33
|
+
"D20191106-T034434.raw": "sha256:8df1da62bfaca5d8e3bfd7be0b0f385c585bfb1ed0743e6aa8a9f108f765b968", # has non-zero water_level
|
|
34
|
+
"D20191106-T034434.bot": "sha256:027edd2eeca18bf16030c8f3c7867ffc70ec9080f4af7eab2b7210134da6d950",
|
|
35
|
+
# Could also test: D20191106-T034434.raw & D20191106-T042540.raw
|
|
36
|
+
"D20191106-T042540.raw": "sha256:e3457b098f1818169fcd13a925792e21a80ce7641312ba149f84a3d7fda45bd0",
|
|
37
|
+
"D20191106-T042540.bot": "sha256:2aa7727a708cf2c25bca4bda650f599107be4a14c74850900be62fe6d83c6944",
|
|
38
|
+
},
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def fetch_raw_files():
|
|
43
|
+
HB1906_RAW.fetch(fname="D20191106-T034434.raw", progressbar=True)
|
|
44
|
+
HB1906_RAW.fetch(fname="D20191106-T034434.bot", progressbar=True)
|
|
45
|
+
|
|
46
|
+
HB1906_RAW.fetch(fname="D20191106-T042540.raw", progressbar=True)
|
|
47
|
+
HB1906_RAW.fetch(fname="D20191106-T042540.bot", progressbar=True)
|
|
48
|
+
|
|
49
|
+
HB0707_RAW.fetch(fname="D20070712-T124906.raw", progressbar=True)
|
|
50
|
+
HB0707_RAW.fetch(fname="D20070712-T124906.bot", progressbar=True)
|
|
51
|
+
HB0707_RAW.fetch(fname="D20070712-T152416.raw", progressbar=True)
|
|
52
|
+
file_name = HB0707_RAW.fetch(fname="D20070712-T152416.bot", progressbar=True)
|
|
53
|
+
|
|
54
|
+
return Path(file_name).parent # joinpath(Path(file_path).stem)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@pytest.fixture(scope="session")
|
|
58
|
+
def test_path():
|
|
59
|
+
return {
|
|
60
|
+
"RAW_TO_ZARR_TEST_PATH": TEST_DATA_FOLDER / "raw_to_zarr",
|
|
61
|
+
"INDEX_TEST_PATH": TEST_DATA_FOLDER / "index",
|
|
62
|
+
"ZARR_MANAGER_TEST_PATH": TEST_DATA_FOLDER / "zarr_manager",
|
|
63
|
+
"PMTILE_GENERATION_TEST_PATH": TEST_DATA_FOLDER / "pmtile",
|
|
64
|
+
"CREATE_EMPTY_ZARR_TEST_PATH": TEST_DATA_FOLDER / "create_empty_zarr",
|
|
65
|
+
# 'RESAMPLE_REGRID_TEST_PATH': TEST_DATA_FOLDER / "resample_regrid",
|
|
66
|
+
"RESAMPLE_REGRID_TEST_PATH": fetch_raw_files(),
|
|
67
|
+
"S3FS_MANAGER_TEST_PATH": TEST_DATA_FOLDER / "s3fs_manager",
|
|
68
|
+
"S3_MANAGER_TEST_PATH": TEST_DATA_FOLDER / "s3_manager",
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
# """
|
|
73
|
+
# Windows
|
|
74
|
+
# C:\Users\<user>\AppData\Local\echopype\Cache\2024.12.23.10.10
|
|
75
|
+
# MacOS
|
|
76
|
+
# /Users//Library/Caches/echopype/2024.12.23.10.10
|
|
77
|
+
# """
|
|
@@ -9,8 +9,8 @@ from boto3.dynamodb.types import TypeDeserializer, TypeSerializer
|
|
|
9
9
|
class DynamoDBManager:
|
|
10
10
|
#####################################################################
|
|
11
11
|
def __init__(
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
self,
|
|
13
|
+
# endpoint_url
|
|
14
14
|
):
|
|
15
15
|
# self.endpoint_url = endpoint_url
|
|
16
16
|
self.dynamodb_session = boto3.Session(
|
|
@@ -62,7 +62,7 @@ class DynamoDBManager:
|
|
|
62
62
|
{"AttributeName": "FILE_NAME", "AttributeType": "S"},
|
|
63
63
|
{"AttributeName": "CRUISE_NAME", "AttributeType": "S"},
|
|
64
64
|
],
|
|
65
|
-
BillingMode="PAY_PER_REQUEST"
|
|
65
|
+
BillingMode="PAY_PER_REQUEST",
|
|
66
66
|
# ProvisionedThroughput={
|
|
67
67
|
# 'ReadCapacityUnits': 1_000,
|
|
68
68
|
# 'WriteCapacityUnits': 1_000
|
|
@@ -70,7 +70,9 @@ class DynamoDBManager:
|
|
|
70
70
|
)
|
|
71
71
|
# TODO: after creating status is 'CREATING', wait until 'ACTIVE'
|
|
72
72
|
response = self.dynamodb_client.describe_table(TableName=table_name)
|
|
73
|
-
print(
|
|
73
|
+
print(
|
|
74
|
+
response
|
|
75
|
+
) # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/describe_table.html
|
|
74
76
|
# sleep then response['Table']['TableStatus'] == 'ACTIVE'
|
|
75
77
|
|
|
76
78
|
#####################################################################
|
|
@@ -111,7 +113,7 @@ class DynamoDBManager:
|
|
|
111
113
|
expression_attribute_names,
|
|
112
114
|
expression_attribute_values,
|
|
113
115
|
update_expression,
|
|
114
|
-
):
|
|
116
|
+
): # TODO: convert to boolean
|
|
115
117
|
try:
|
|
116
118
|
response = self.dynamodb_client.update_item(
|
|
117
119
|
TableName=table_name,
|
|
@@ -120,7 +122,7 @@ class DynamoDBManager:
|
|
|
120
122
|
ExpressionAttributeValues=expression_attribute_values,
|
|
121
123
|
UpdateExpression=update_expression,
|
|
122
124
|
)
|
|
123
|
-
|
|
125
|
+
return response["ResponseMetadata"]["HTTPStatusCode"] # TODO: should be 200
|
|
124
126
|
# print(f"HTTPStatusCode: {status_code}")
|
|
125
127
|
# assert status_code == 200, "Problem, unable to update dynamodb table."
|
|
126
128
|
# assert response['ConsumedCapacity']['TableName'] == table_name
|
|
@@ -131,22 +133,23 @@ class DynamoDBManager:
|
|
|
131
133
|
# TODO: change to "get_cruise_as_df"
|
|
132
134
|
def get_table_as_df(
|
|
133
135
|
self,
|
|
134
|
-
ship_name,
|
|
136
|
+
# ship_name,
|
|
135
137
|
cruise_name,
|
|
136
|
-
sensor_name,
|
|
138
|
+
# sensor_name,
|
|
137
139
|
table_name,
|
|
138
140
|
) -> pd.DataFrame:
|
|
139
141
|
"""
|
|
140
142
|
To be used to initialize a cruise, deletes all entries associated with that cruise
|
|
141
143
|
in the database.
|
|
144
|
+
#TODO: cruise names isn't good enough, there could be two instrument for a cruise...
|
|
142
145
|
"""
|
|
143
146
|
filter_expression = "CRUISE_NAME = :cr"
|
|
144
147
|
response = self.dynamodb_client.scan(
|
|
145
148
|
TableName=table_name,
|
|
146
149
|
# Limit=1000,
|
|
147
|
-
Select=
|
|
150
|
+
Select="ALL_ATTRIBUTES", # or 'SPECIFIC_ATTRIBUTES',
|
|
148
151
|
# ExclusiveStartKey=where to pick up
|
|
149
|
-
#ReturnConsumedCapacity='INDEXES' | 'TOTAL' | 'NONE', ...not sure
|
|
152
|
+
# ReturnConsumedCapacity='INDEXES' | 'TOTAL' | 'NONE', ...not sure
|
|
150
153
|
# ProjectionExpression='#SH, #CR, #FN', # what to specifically return — from expression_attribute_names
|
|
151
154
|
FilterExpression=filter_expression,
|
|
152
155
|
# ExpressionAttributeNames={
|
|
@@ -154,36 +157,36 @@ class DynamoDBManager:
|
|
|
154
157
|
# '#CR': 'CRUISE_NAME',
|
|
155
158
|
# '#FN': 'FILE_NAME',
|
|
156
159
|
# },
|
|
157
|
-
ExpressionAttributeValues={
|
|
158
|
-
|
|
159
|
-
|
|
160
|
+
ExpressionAttributeValues={ # criteria
|
|
161
|
+
":cr": {
|
|
162
|
+
"S": cruise_name,
|
|
160
163
|
},
|
|
161
164
|
},
|
|
162
|
-
ConsistentRead=True
|
|
165
|
+
ConsistentRead=True,
|
|
163
166
|
# ExclusiveStartKey=response["LastEvaluatedKey"],
|
|
164
167
|
)
|
|
165
168
|
# Note: table.scan() has 1 MB limit on results so pagination is used
|
|
166
169
|
|
|
167
170
|
if len(response["Items"]) == 0 and "LastEvaluatedKey" not in response:
|
|
168
|
-
return pd.DataFrame()
|
|
171
|
+
return pd.DataFrame() # If no results, return empty dataframe
|
|
169
172
|
|
|
170
173
|
data = response["Items"]
|
|
171
174
|
|
|
172
|
-
while response.get(
|
|
175
|
+
while response.get("LastEvaluatedKey"): # "LastEvaluatedKey" in response:
|
|
173
176
|
response = self.dynamodb_client.scan(
|
|
174
177
|
TableName=table_name,
|
|
175
178
|
### Either 'Select' or 'ExpressionAttributeNames'/'ProjectionExpression'
|
|
176
|
-
Select=
|
|
179
|
+
Select="ALL_ATTRIBUTES", # or 'SPECIFIC_ATTRIBUTES',
|
|
177
180
|
FilterExpression=filter_expression,
|
|
178
|
-
#ProjectionExpression='#SH, #CR, #FN', # what to specifically return — from expression_attribute_names
|
|
181
|
+
# ProjectionExpression='#SH, #CR, #FN', # what to specifically return — from expression_attribute_names
|
|
179
182
|
# ExpressionAttributeNames={ # would need to specify all cols in df
|
|
180
183
|
# '#SH': 'SHIP_NAME',
|
|
181
184
|
# '#CR': 'CRUISE_NAME',
|
|
182
185
|
# '#FN': 'FILE_NAME',
|
|
183
186
|
# },
|
|
184
187
|
ExpressionAttributeValues={ # criteria
|
|
185
|
-
|
|
186
|
-
|
|
188
|
+
":cr": {
|
|
189
|
+
"S": cruise_name,
|
|
187
190
|
},
|
|
188
191
|
},
|
|
189
192
|
ConsistentRead=True,
|
|
@@ -268,14 +271,7 @@ class DynamoDBManager:
|
|
|
268
271
|
Finds all rows associated with a cruise and deletes them.
|
|
269
272
|
"""
|
|
270
273
|
response = self.dynamodb_client.delete_item(
|
|
271
|
-
Key={
|
|
272
|
-
"CRUISE_NAME": {
|
|
273
|
-
"S": cruise_name
|
|
274
|
-
},
|
|
275
|
-
"FILE_NAME": {
|
|
276
|
-
"S": file_name
|
|
277
|
-
}
|
|
278
|
-
},
|
|
274
|
+
Key={"CRUISE_NAME": {"S": cruise_name}, "FILE_NAME": {"S": file_name}},
|
|
279
275
|
TableName=table_name,
|
|
280
276
|
ReturnConsumedCapacity="TOTALS",
|
|
281
277
|
)
|
|
@@ -286,8 +282,8 @@ class DynamoDBManager:
|
|
|
286
282
|
|
|
287
283
|
#####################################################################
|
|
288
284
|
def describe_table(
|
|
289
|
-
|
|
290
|
-
|
|
285
|
+
self,
|
|
286
|
+
table_name,
|
|
291
287
|
):
|
|
292
288
|
"""
|
|
293
289
|
Get a description of the table. Used to verify that records were added/removed.
|
|
@@ -296,8 +292,6 @@ class DynamoDBManager:
|
|
|
296
292
|
print(response)
|
|
297
293
|
return response
|
|
298
294
|
|
|
299
|
-
|
|
300
|
-
|
|
301
295
|
#####################################################################
|
|
302
296
|
# TODO: from test_raw_to_zarr get enum and use here
|
|
303
297
|
# def __update_processing_status(
|
|
@@ -357,4 +351,5 @@ class DynamoDBManager:
|
|
|
357
351
|
# )
|
|
358
352
|
# print("Done updating processing status.")
|
|
359
353
|
|
|
354
|
+
|
|
360
355
|
#########################################################################
|