water-column-sonar-processing 25.1.1__py3-none-any.whl → 25.1.2__py3-none-any.whl
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/aws/dynamodb_manager.py +52 -23
- water_column_sonar_processing/model/zarr_manager.py +1 -1
- {water_column_sonar_processing-25.1.1.dist-info → water_column_sonar_processing-25.1.2.dist-info}/METADATA +7 -10
- {water_column_sonar_processing-25.1.1.dist-info → water_column_sonar_processing-25.1.2.dist-info}/RECORD +7 -7
- {water_column_sonar_processing-25.1.1.dist-info → water_column_sonar_processing-25.1.2.dist-info}/LICENSE +0 -0
- {water_column_sonar_processing-25.1.1.dist-info → water_column_sonar_processing-25.1.2.dist-info}/WHEEL +0 -0
- {water_column_sonar_processing-25.1.1.dist-info → water_column_sonar_processing-25.1.2.dist-info}/top_level.txt +0 -0
|
@@ -13,16 +13,16 @@ class DynamoDBManager:
|
|
|
13
13
|
# endpoint_url
|
|
14
14
|
):
|
|
15
15
|
# self.endpoint_url = endpoint_url
|
|
16
|
-
self.
|
|
16
|
+
self.dynamodb_session = boto3.Session(
|
|
17
17
|
aws_access_key_id=os.environ.get("ACCESS_KEY_ID"),
|
|
18
18
|
aws_secret_access_key=os.environ.get("SECRET_ACCESS_KEY"),
|
|
19
19
|
region_name=os.environ.get("AWS_REGION", default="us-east-1"),
|
|
20
20
|
)
|
|
21
|
-
self.
|
|
21
|
+
self.dynamodb_resource = self.dynamodb_session.resource(
|
|
22
22
|
service_name="dynamodb",
|
|
23
23
|
# endpoint_url=self.endpoint_url
|
|
24
24
|
)
|
|
25
|
-
self.
|
|
25
|
+
self.dynamodb_client = self.dynamodb_session.client(
|
|
26
26
|
service_name="dynamodb",
|
|
27
27
|
# endpoint_url=self.endpoint_url
|
|
28
28
|
)
|
|
@@ -46,7 +46,7 @@ class DynamoDBManager:
|
|
|
46
46
|
self,
|
|
47
47
|
table_name,
|
|
48
48
|
):
|
|
49
|
-
self.
|
|
49
|
+
self.dynamodb_client.create_table(
|
|
50
50
|
TableName=table_name,
|
|
51
51
|
KeySchema=[
|
|
52
52
|
{
|
|
@@ -69,7 +69,7 @@ class DynamoDBManager:
|
|
|
69
69
|
# }
|
|
70
70
|
)
|
|
71
71
|
# TODO: after creating status is 'CREATING', wait until 'ACTIVE'
|
|
72
|
-
response = self.
|
|
72
|
+
response = self.dynamodb_client.describe_table(TableName=table_name)
|
|
73
73
|
print(response) # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/describe_table.html
|
|
74
74
|
# sleep then response['Table']['TableStatus'] == 'ACTIVE'
|
|
75
75
|
|
|
@@ -80,7 +80,7 @@ class DynamoDBManager:
|
|
|
80
80
|
# table_name,
|
|
81
81
|
# key
|
|
82
82
|
# ):
|
|
83
|
-
# response = self.
|
|
83
|
+
# response = self.dynamodb_client.get_item(TableName=table_name, Key=key)
|
|
84
84
|
# item = None
|
|
85
85
|
# if response["ResponseMetadata"]["HTTPStatusCode"] == 200:
|
|
86
86
|
# if "Item" in response:
|
|
@@ -96,7 +96,7 @@ class DynamoDBManager:
|
|
|
96
96
|
"""
|
|
97
97
|
Gets a single row from the db.
|
|
98
98
|
"""
|
|
99
|
-
table = self.
|
|
99
|
+
table = self.dynamodb_resource.Table(table_name)
|
|
100
100
|
response = table.get_item(Key=key)
|
|
101
101
|
# TODO:
|
|
102
102
|
# if response["ResponseMetadata"]["HTTPStatusCode"] != 200:
|
|
@@ -113,7 +113,7 @@ class DynamoDBManager:
|
|
|
113
113
|
update_expression,
|
|
114
114
|
): # TODO: convert to boolean
|
|
115
115
|
try:
|
|
116
|
-
response = self.
|
|
116
|
+
response = self.dynamodb_client.update_item(
|
|
117
117
|
TableName=table_name,
|
|
118
118
|
Key=key,
|
|
119
119
|
ExpressionAttributeNames=expression_attribute_names,
|
|
@@ -145,28 +145,57 @@ class DynamoDBManager:
|
|
|
145
145
|
":se": {"S": sensor_name},
|
|
146
146
|
":sh": {"S": ship_name},
|
|
147
147
|
}
|
|
148
|
-
|
|
149
148
|
filter_expression = (
|
|
150
149
|
"CRUISE_NAME = :cr and SENSOR_NAME = :se and SHIP_NAME = :sh"
|
|
151
150
|
)
|
|
152
|
-
|
|
151
|
+
# filter_expression = "CRUISE_NAME = :cr"
|
|
152
|
+
response = self.dynamodb_client.scan(
|
|
153
153
|
TableName=table_name,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
# Limit=1000,
|
|
155
|
+
Select='ALL_ATTRIBUTES', # or 'SPECIFIC_ATTRIBUTES',
|
|
156
|
+
# ExclusiveStartKey=where to pick up
|
|
157
|
+
#ReturnConsumedCapacity='INDEXES' | 'TOTAL' | 'NONE', ...not sure
|
|
158
|
+
# ProjectionExpression='#SH, #CR, #FN', # what to specifically return — from expression_attribute_names
|
|
159
|
+
FilterExpression='CRUISE_NAME = :cr',#
|
|
160
|
+
# ExpressionAttributeNames={
|
|
161
|
+
# '#SH': 'SHIP_NAME',
|
|
162
|
+
# '#CR': 'CRUISE_NAME',
|
|
163
|
+
# '#FN': 'FILE_NAME',
|
|
164
|
+
# },
|
|
165
|
+
ExpressionAttributeValues={ # criteria
|
|
166
|
+
':cr': {
|
|
167
|
+
'S': cruise_name,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
ConsistentRead=True
|
|
171
|
+
# ExclusiveStartKey=response["LastEvaluatedKey"],
|
|
157
172
|
)
|
|
173
|
+
print(response)
|
|
158
174
|
# Note: table.scan() has 1 MB limit on results so pagination is used
|
|
159
|
-
|
|
175
|
+
|
|
176
|
+
if len(response["Items"]) == 0 and "LastEvaluatedKey" not in response:
|
|
160
177
|
return pd.DataFrame() # If no results, return empty dataframe
|
|
161
178
|
|
|
162
179
|
data = response["Items"]
|
|
163
180
|
|
|
164
|
-
while "LastEvaluatedKey" in response:
|
|
165
|
-
response = self.
|
|
181
|
+
while response.get('LastEvaluatedKey'): #"LastEvaluatedKey" in response:
|
|
182
|
+
response = self.dynamodb_client.scan(
|
|
166
183
|
TableName=table_name,
|
|
167
|
-
Select
|
|
168
|
-
|
|
169
|
-
FilterExpression=
|
|
184
|
+
### Either 'Select' or 'ExpressionAttributeNames'/'ProjectionExpression'
|
|
185
|
+
Select='ALL_ATTRIBUTES', # or 'SPECIFIC_ATTRIBUTES',
|
|
186
|
+
FilterExpression='CRUISE_NAME = :cr', #
|
|
187
|
+
#ProjectionExpression='#SH, #CR, #FN', # what to specifically return — from expression_attribute_names
|
|
188
|
+
# ExpressionAttributeNames={ # would need to specify all cols in df
|
|
189
|
+
# '#SH': 'SHIP_NAME',
|
|
190
|
+
# '#CR': 'CRUISE_NAME',
|
|
191
|
+
# '#FN': 'FILE_NAME',
|
|
192
|
+
# },
|
|
193
|
+
ExpressionAttributeValues={ # criteria
|
|
194
|
+
':cr': {
|
|
195
|
+
'S': cruise_name,
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
ConsistentRead=True,
|
|
170
199
|
ExclusiveStartKey=response["LastEvaluatedKey"],
|
|
171
200
|
)
|
|
172
201
|
data.extend(response["Items"])
|
|
@@ -187,7 +216,7 @@ class DynamoDBManager:
|
|
|
187
216
|
"""
|
|
188
217
|
Finds all rows associated with a cruise and deletes them.
|
|
189
218
|
"""
|
|
190
|
-
response = self.
|
|
219
|
+
response = self.dynamodb_client.delete_item(
|
|
191
220
|
Key={
|
|
192
221
|
"CRUISE_NAME": {
|
|
193
222
|
"S": cruise_name
|
|
@@ -212,7 +241,7 @@ class DynamoDBManager:
|
|
|
212
241
|
"""
|
|
213
242
|
Get a description of the table. Used to verify that records were added/removed.
|
|
214
243
|
"""
|
|
215
|
-
response = self.
|
|
244
|
+
response = self.dynamodb_client.describe_table(TableName=table_name)
|
|
216
245
|
print(response)
|
|
217
246
|
return response
|
|
218
247
|
|
|
@@ -230,7 +259,7 @@ class DynamoDBManager:
|
|
|
230
259
|
# print(f"Updating processing status to {pipeline_status}.")
|
|
231
260
|
# if error_message:
|
|
232
261
|
# print(f"Error message: {error_message}")
|
|
233
|
-
# self.
|
|
262
|
+
# self.dynamo.update_item(
|
|
234
263
|
# table_name=self.__table_name,
|
|
235
264
|
# key={
|
|
236
265
|
# 'FILE_NAME': {'S': file_name}, # Partition Key
|
|
@@ -255,7 +284,7 @@ class DynamoDBManager:
|
|
|
255
284
|
# }
|
|
256
285
|
# )
|
|
257
286
|
# else:
|
|
258
|
-
# self.
|
|
287
|
+
# self.dynamo.update_item(
|
|
259
288
|
# table_name=self.__table_name,
|
|
260
289
|
# key={
|
|
261
290
|
# 'FILE_NAME': {'S': file_name}, # Partition Key
|
|
@@ -250,7 +250,7 @@ class ZarrManager:
|
|
|
250
250
|
#
|
|
251
251
|
root.attrs["processing_software_name"] = Coordinates.PROJECT_NAME.value
|
|
252
252
|
root.attrs["processing_software_version"] = (
|
|
253
|
-
"25.1.
|
|
253
|
+
"25.1.2" # TODO: get programmatically, echopype>utils>prov.py
|
|
254
254
|
)
|
|
255
255
|
root.attrs["processing_software_time"] = Timestamp.get_timestamp()
|
|
256
256
|
#
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: water_column_sonar_processing
|
|
3
|
-
Version: 25.1.
|
|
3
|
+
Version: 25.1.2
|
|
4
4
|
Summary: A processing tool for water column sonar data.
|
|
5
5
|
Author-email: Rudy Klucik <rudy.klucik@noaa.gov>
|
|
6
6
|
Project-URL: Homepage, https://github.com/CI-CMG/water-column-sonar-processing
|
|
@@ -11,15 +11,15 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.8
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: aiobotocore==2.
|
|
15
|
-
Requires-Dist: boto3==1.
|
|
16
|
-
Requires-Dist: botocore==1.
|
|
14
|
+
Requires-Dist: aiobotocore==2.19.0
|
|
15
|
+
Requires-Dist: boto3==1.36.3
|
|
16
|
+
Requires-Dist: botocore==1.36.3
|
|
17
17
|
Requires-Dist: echopype==0.9.0
|
|
18
18
|
Requires-Dist: fiona==1.10.1
|
|
19
19
|
Requires-Dist: geopandas==1.0.1
|
|
20
20
|
Requires-Dist: mock==5.1.0
|
|
21
|
-
Requires-Dist: moto[all]==5.0.
|
|
22
|
-
Requires-Dist: moto[server]==5.0.
|
|
21
|
+
Requires-Dist: moto[all]==5.0.27
|
|
22
|
+
Requires-Dist: moto[server]==5.0.27
|
|
23
23
|
Requires-Dist: numcodecs==0.13.1
|
|
24
24
|
Requires-Dist: numpy==1.26.4
|
|
25
25
|
Requires-Dist: pandas==2.2.3
|
|
@@ -120,10 +120,7 @@ https://colab.research.google.com/drive/1KiLMueXiz9WVB9o4RuzYeGjNZ6PsZU7a#scroll
|
|
|
120
120
|
# Tag a Release
|
|
121
121
|
Step 1 --> increment the semantic version in the zarr_manager.py "metadata" & the "pyproject.toml"
|
|
122
122
|
```commandline
|
|
123
|
-
git tag -a v25.
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
```commandline
|
|
123
|
+
git tag -a v25.1.2 -m "Releasing version v25.1.2"
|
|
127
124
|
git push origin --tags
|
|
128
125
|
```
|
|
129
126
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
water_column_sonar_processing/__init__.py,sha256=fvRK4uFo_A0l7w_T4yckvDqJ3wMUq4JB3VVPXqWfewE,226
|
|
2
2
|
water_column_sonar_processing/process.py,sha256=-yQtK3rnZq6lGAr3q02zLDe1NuMH9c0PiUOxKzG_r18,5386
|
|
3
3
|
water_column_sonar_processing/aws/__init__.py,sha256=KJqK8oYMn-u8n8i-Jp_lG5BvCOTjwWSjWP8yAyDlWVo,297
|
|
4
|
-
water_column_sonar_processing/aws/dynamodb_manager.py,sha256
|
|
4
|
+
water_column_sonar_processing/aws/dynamodb_manager.py,sha256=-OARhOcvfctpPTuQQAqZ6wb4NHrqFjyVpe31CZyyE6c,11631
|
|
5
5
|
water_column_sonar_processing/aws/s3_manager.py,sha256=-PCiW7YF31nGIPa1oVOVTzjTSExAAkT_IyNNnvWv2HU,16214
|
|
6
6
|
water_column_sonar_processing/aws/s3fs_manager.py,sha256=Vo-DXj6vgb8t1l4LdtNu7JCtq_RfFsnl33RuGeBUXhk,2561
|
|
7
7
|
water_column_sonar_processing/aws/sns_manager.py,sha256=Dp9avG5VSugSWPR1dZ-askuAw1fCZkNUHbOUP65iR-k,1867
|
|
@@ -18,7 +18,7 @@ water_column_sonar_processing/geometry/pmtile_generation.py,sha256=7Lm08Jr6YaM4n
|
|
|
18
18
|
water_column_sonar_processing/index/__init__.py,sha256=izEObsKiOoIJ0kZCFhvaYsBd6Ga71XJxnogjrNInw68,68
|
|
19
19
|
water_column_sonar_processing/index/index_manager.py,sha256=qsS6rKObJlFXKyzRuT1bk2_qW1YagW-Fg_AkQ1U_KRs,14213
|
|
20
20
|
water_column_sonar_processing/model/__init__.py,sha256=FXaCdbPqxp0ogmZm9NplRirqpgMiYs1iRYgJbFbbX2Y,65
|
|
21
|
-
water_column_sonar_processing/model/zarr_manager.py,sha256=
|
|
21
|
+
water_column_sonar_processing/model/zarr_manager.py,sha256=LlpmUPUoVgNknVPpWFnMoYR5XmDbFDkdXCPJoOipfr4,15505
|
|
22
22
|
water_column_sonar_processing/processing/__init__.py,sha256=tdpSfwnY6lbAS_yBTu4aG0SjPgCKqh6LAFvIj_t3j3U,168
|
|
23
23
|
water_column_sonar_processing/processing/batch_downloader.py,sha256=qXoruHdbgzAolmroK6eRn9bWgeHFgaVQLwhJ6X5oHRE,6299
|
|
24
24
|
water_column_sonar_processing/processing/raw_to_zarr.py,sha256=Sn0_zBT7yYP6abbSTlQBPA6iZSBxeVqPYYSgoroiBEU,17599
|
|
@@ -27,8 +27,8 @@ water_column_sonar_processing/utility/cleaner.py,sha256=bNbs-hopWxtKAFBK0Eu18xdR
|
|
|
27
27
|
water_column_sonar_processing/utility/constants.py,sha256=AD6RlDrJRVN1GYwRvo7cunLhrdC0F8CyOlbkB_GxL-s,2180
|
|
28
28
|
water_column_sonar_processing/utility/pipeline_status.py,sha256=O-0SySqdRGJ6bs3zQe1NV9vkOpmsRM7zj5QoHgzYioY,4395
|
|
29
29
|
water_column_sonar_processing/utility/timestamp.py,sha256=bO0oir7KxxoEHPGRkz9FCBfOligkocUyRiWRzAq8fnU,361
|
|
30
|
-
water_column_sonar_processing-25.1.
|
|
31
|
-
water_column_sonar_processing-25.1.
|
|
32
|
-
water_column_sonar_processing-25.1.
|
|
33
|
-
water_column_sonar_processing-25.1.
|
|
34
|
-
water_column_sonar_processing-25.1.
|
|
30
|
+
water_column_sonar_processing-25.1.2.dist-info/LICENSE,sha256=lz4IpJ5_adG3S0ali-WaIpQFVTnEAOucMDQPECUVEYw,1110
|
|
31
|
+
water_column_sonar_processing-25.1.2.dist-info/METADATA,sha256=BkcPnxcolpi8A3smtLG-nb9wBQwC52fx2bAqfnBHFiY,5448
|
|
32
|
+
water_column_sonar_processing-25.1.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
33
|
+
water_column_sonar_processing-25.1.2.dist-info/top_level.txt,sha256=aRYU4A7RNBlNrL4vzjytFAir3BNnmOgsvIGKKA36tg4,30
|
|
34
|
+
water_column_sonar_processing-25.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|