water-column-sonar-processing 25.1.1__py3-none-any.whl → 25.1.3__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.

@@ -13,16 +13,16 @@ class DynamoDBManager:
13
13
  # endpoint_url
14
14
  ):
15
15
  # self.endpoint_url = endpoint_url
16
- self.__dynamodb_session = boto3.Session(
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.__dynamodb_resource = self.__dynamodb_session.resource(
21
+ self.dynamodb_resource = self.dynamodb_session.resource(
22
22
  service_name="dynamodb",
23
23
  # endpoint_url=self.endpoint_url
24
24
  )
25
- self.__dynamodb_client = self.__dynamodb_session.client(
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.__dynamodb_client.create_table(
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.__dynamodb_client.describe_table(TableName=table_name)
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.__dynamodb_client.get_item(TableName=table_name, Key=key)
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.__dynamodb_resource.Table(table_name)
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.__dynamodb_client.update_item(
116
+ response = self.dynamodb_client.update_item(
117
117
  TableName=table_name,
118
118
  Key=key,
119
119
  ExpressionAttributeNames=expression_attribute_names,
@@ -140,33 +140,53 @@ class DynamoDBManager:
140
140
  To be used to initialize a cruise, deletes all entries associated with that cruise
141
141
  in the database.
142
142
  """
143
- expression_attribute_values = {
144
- ":cr": {"S": cruise_name},
145
- ":se": {"S": sensor_name},
146
- ":sh": {"S": ship_name},
147
- }
148
-
149
- filter_expression = (
150
- "CRUISE_NAME = :cr and SENSOR_NAME = :se and SHIP_NAME = :sh"
151
- )
152
- response = self.__dynamodb_client.scan(
143
+ filter_expression = "CRUISE_NAME = :cr"
144
+ response = self.dynamodb_client.scan(
153
145
  TableName=table_name,
154
- Select="ALL_ATTRIBUTES",
155
- ExpressionAttributeValues=expression_attribute_values,
146
+ # Limit=1000,
147
+ Select='ALL_ATTRIBUTES', # or 'SPECIFIC_ATTRIBUTES',
148
+ # ExclusiveStartKey=where to pick up
149
+ #ReturnConsumedCapacity='INDEXES' | 'TOTAL' | 'NONE', ...not sure
150
+ # ProjectionExpression='#SH, #CR, #FN', # what to specifically return — from expression_attribute_names
156
151
  FilterExpression=filter_expression,
152
+ # ExpressionAttributeNames={
153
+ # '#SH': 'SHIP_NAME',
154
+ # '#CR': 'CRUISE_NAME',
155
+ # '#FN': 'FILE_NAME',
156
+ # },
157
+ ExpressionAttributeValues={ # criteria
158
+ ':cr': {
159
+ 'S': cruise_name,
160
+ },
161
+ },
162
+ ConsistentRead=True
163
+ # ExclusiveStartKey=response["LastEvaluatedKey"],
157
164
  )
158
165
  # Note: table.scan() has 1 MB limit on results so pagination is used
159
- if len(response["Items"]) == 0:
166
+
167
+ if len(response["Items"]) == 0 and "LastEvaluatedKey" not in response:
160
168
  return pd.DataFrame() # If no results, return empty dataframe
161
169
 
162
170
  data = response["Items"]
163
171
 
164
- while "LastEvaluatedKey" in response:
165
- response = self.__dynamodb_client.scan(
172
+ while response.get('LastEvaluatedKey'): #"LastEvaluatedKey" in response:
173
+ response = self.dynamodb_client.scan(
166
174
  TableName=table_name,
167
- Select="ALL_ATTRIBUTES",
168
- ExpressionAttributeValues=expression_attribute_values,
175
+ ### Either 'Select' or 'ExpressionAttributeNames'/'ProjectionExpression'
176
+ Select='ALL_ATTRIBUTES', # or 'SPECIFIC_ATTRIBUTES',
169
177
  FilterExpression=filter_expression,
178
+ #ProjectionExpression='#SH, #CR, #FN', # what to specifically return — from expression_attribute_names
179
+ # ExpressionAttributeNames={ # would need to specify all cols in df
180
+ # '#SH': 'SHIP_NAME',
181
+ # '#CR': 'CRUISE_NAME',
182
+ # '#FN': 'FILE_NAME',
183
+ # },
184
+ ExpressionAttributeValues={ # criteria
185
+ ':cr': {
186
+ 'S': cruise_name,
187
+ },
188
+ },
189
+ ConsistentRead=True,
170
190
  ExclusiveStartKey=response["LastEvaluatedKey"],
171
191
  )
172
192
  data.extend(response["Items"])
@@ -176,6 +196,66 @@ class DynamoDBManager:
176
196
 
177
197
  return df.sort_values(by="START_TIME", ignore_index=True)
178
198
 
199
+ #####################################################################
200
+ # def get_cruise_list(
201
+ # self,
202
+ # table_name,
203
+ # ) -> list:
204
+ # """
205
+ # Experimental, gets all cruise names as list
206
+ # """
207
+ # filter_expression = "CRUISE_NAME = :cr"
208
+ # response = self.dynamodb_client.scan(
209
+ # TableName=table_name,
210
+ # Select='SPECIFIC_ATTRIBUTES',
211
+ # #ReturnConsumedCapacity='INDEXES' | 'TOTAL' | 'NONE', ...not sure
212
+ # # ProjectionExpression='#SH, #CR, #FN', # what to specifically return — from expression_attribute_names
213
+ # FilterExpression=filter_expression,
214
+ # # ExpressionAttributeNames={
215
+ # # '#SH': 'SHIP_NAME',
216
+ # # '#CR': 'CRUISE_NAME',
217
+ # # '#FN': 'FILE_NAME',
218
+ # # },
219
+ # # ExpressionAttributeValues={ # criteria
220
+ # # ':cr': {
221
+ # # 'S': cruise_name,
222
+ # # },
223
+ # # },
224
+ # )
225
+ # # Note: table.scan() has 1 MB limit on results so pagination is used
226
+ #
227
+ # if len(response["Items"]) == 0 and "LastEvaluatedKey" not in response:
228
+ # return pd.DataFrame() # If no results, return empty dataframe
229
+ #
230
+ # data = response["Items"]
231
+ #
232
+ # while response.get('LastEvaluatedKey'): #"LastEvaluatedKey" in response:
233
+ # response = self.dynamodb_client.scan(
234
+ # TableName=table_name,
235
+ # ### Either 'Select' or 'ExpressionAttributeNames'/'ProjectionExpression'
236
+ # Select='ALL_ATTRIBUTES', # or 'SPECIFIC_ATTRIBUTES',
237
+ # FilterExpression=filter_expression,
238
+ # #ProjectionExpression='#SH, #CR, #FN', # what to specifically return — from expression_attribute_names
239
+ # # ExpressionAttributeNames={ # would need to specify all cols in df
240
+ # # '#SH': 'SHIP_NAME',
241
+ # # '#CR': 'CRUISE_NAME',
242
+ # # '#FN': 'FILE_NAME',
243
+ # # },
244
+ # ExpressionAttributeValues={ # criteria
245
+ # ':cr': {
246
+ # 'S': cruise_name,
247
+ # },
248
+ # },
249
+ # ConsistentRead=True,
250
+ # ExclusiveStartKey=response["LastEvaluatedKey"],
251
+ # )
252
+ # data.extend(response["Items"])
253
+ #
254
+ # deserializer = self.type_deserializer
255
+ # df = pd.DataFrame([deserializer.deserialize({"M": i}) for i in data])
256
+ #
257
+ # return df.sort_values(by="START_TIME", ignore_index=True)
258
+
179
259
  #####################################################################
180
260
  # TODO: WIP
181
261
  def delete_item(
@@ -187,7 +267,7 @@ class DynamoDBManager:
187
267
  """
188
268
  Finds all rows associated with a cruise and deletes them.
189
269
  """
190
- response = self.__dynamodb_client.delete_item(
270
+ response = self.dynamodb_client.delete_item(
191
271
  Key={
192
272
  "CRUISE_NAME": {
193
273
  "S": cruise_name
@@ -212,7 +292,7 @@ class DynamoDBManager:
212
292
  """
213
293
  Get a description of the table. Used to verify that records were added/removed.
214
294
  """
215
- response = self.__dynamodb_client.describe_table(TableName=table_name)
295
+ response = self.dynamodb_client.describe_table(TableName=table_name)
216
296
  print(response)
217
297
  return response
218
298
 
@@ -230,7 +310,7 @@ class DynamoDBManager:
230
310
  # print(f"Updating processing status to {pipeline_status}.")
231
311
  # if error_message:
232
312
  # print(f"Error message: {error_message}")
233
- # self.__dynamo.update_item(
313
+ # self.dynamo.update_item(
234
314
  # table_name=self.__table_name,
235
315
  # key={
236
316
  # 'FILE_NAME': {'S': file_name}, # Partition Key
@@ -255,7 +335,7 @@ class DynamoDBManager:
255
335
  # }
256
336
  # )
257
337
  # else:
258
- # self.__dynamo.update_item(
338
+ # self.dynamo.update_item(
259
339
  # table_name=self.__table_name,
260
340
  # key={
261
341
  # 'FILE_NAME': {'S': file_name}, # Partition Key
@@ -1,5 +1,4 @@
1
1
  import gc
2
- import os
3
2
  from pathlib import Path
4
3
 
5
4
  import numcodecs
@@ -311,6 +310,12 @@ class ResampleRegrid:
311
310
  output_zarr_store.bottom[
312
311
  start_ping_time_index:end_ping_time_index
313
312
  ] = detected_seafloor_depths
313
+ #
314
+ #
315
+ #
316
+ # TODO: write the time variable last so that I can parse that as check
317
+ #
318
+ #
314
319
  #########################################################################
315
320
  #########################################################################
316
321
  except Exception as err:
@@ -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.1" # TODO: get programmatically, echopype>utils>prov.py
253
+ "25.1.3" # TODO: get programmatically, echopype>utils>prov.py
254
254
  )
255
255
  root.attrs["processing_software_time"] = Timestamp.get_timestamp()
256
256
  #
@@ -3,7 +3,7 @@ from enum import Enum, Flag, unique
3
3
 
4
4
  @unique
5
5
  class Constants(Flag):
6
- TILE_SIZE = 256 # TODO: add tile size to metadata?
6
+ TILE_SIZE = 1024 # TODO: add tile size to metadata?
7
7
 
8
8
  # Average https://noaa-wcsd-zarr-pds.s3.us-east-1.amazonaws.com/level_2/Henry_B._Bigelow/HB0902/EK60/HB0902.zarr/time/927
9
9
  # chunk size is ~1.3 kB, HB0902 cruise takes ~30 seconds to load all time/lat/lon data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: water_column_sonar_processing
3
- Version: 25.1.1
3
+ Version: 25.1.3
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.2
15
- Requires-Dist: boto3==1.35.36
16
- Requires-Dist: botocore==1.35.36
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.21
22
- Requires-Dist: moto[server]==5.0.21
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.01.01 -m "Releasing version v25.01.01"
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=LQ3eh7Zf1fBLG-RKovod9KbQwhE-0Qdq1JPk4Ro5bdo,10252
4
+ water_column_sonar_processing/aws/dynamodb_manager.py,sha256=htP4Y2rmOSFtdzUFrgK14Bn-UXAFG22Ow-dDrR2alSw,13949
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
@@ -9,7 +9,7 @@ water_column_sonar_processing/aws/sqs_manager.py,sha256=NSUrWmnSC8h8Gf7gT0U8zFaQ
9
9
  water_column_sonar_processing/cruise/__init__.py,sha256=H5hW0JMORuaFvQk_R31B4VL8RnRyKeanOOiWmqEMZJk,156
10
10
  water_column_sonar_processing/cruise/create_empty_zarr_store.py,sha256=ZsFQTDA0gXfQHlxDsXBGD1qQ0ipmx4kS81DcY6ml5Ew,7767
11
11
  water_column_sonar_processing/cruise/datatree_manager.py,sha256=Qy4dZCW8_q31lbjxbMsx3JtBS4BvQT17_2P0QD1RQcY,639
12
- water_column_sonar_processing/cruise/resample_regrid.py,sha256=gz_uP-mBD4JSBRBr69ZvsfmXX4yyBdRG9-P1z3If43E,14246
12
+ water_column_sonar_processing/cruise/resample_regrid.py,sha256=986oZm6G8kngAmTg1GTTyxdx8Zy9fXAUGlK533GcrZ8,14413
13
13
  water_column_sonar_processing/geometry/__init__.py,sha256=GIzzc-_7pwEwbOkGpc4i_fmjWI5ymllXqzdHq_d3Rio,299
14
14
  water_column_sonar_processing/geometry/elevation_manager.py,sha256=eq9w691WJknPwWYkvO3giKTPleIxCVc2tMGR0e8ZRxQ,4267
15
15
  water_column_sonar_processing/geometry/geometry_manager.py,sha256=nz5T1vCDWHYIfQ853EqKYHDetTul7jRWS3y8Evep8QU,10855
@@ -18,17 +18,17 @@ 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=TkYP-FwQkW2I3IcpVQFzrmHQjD25mtN8epGjTDn5jWI,15505
21
+ water_column_sonar_processing/model/zarr_manager.py,sha256=UT3GSEQ6-_kd62dDZf9AOvueR8jEiUPbzoFcpiwy8IY,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
25
25
  water_column_sonar_processing/utility/__init__.py,sha256=yDObMOL0_OxKWet5wffK2-XVJgoE9iwiY2q04GZrtBQ,234
26
26
  water_column_sonar_processing/utility/cleaner.py,sha256=bNbs-hopWxtKAFBK0Eu18xdRErZCGZvtla3j-1bTwQw,619
27
- water_column_sonar_processing/utility/constants.py,sha256=AD6RlDrJRVN1GYwRvo7cunLhrdC0F8CyOlbkB_GxL-s,2180
27
+ water_column_sonar_processing/utility/constants.py,sha256=nAThVjJGpFp8kMdv3I1g6I1hVvOBJBDbGCTEEYewB4o,2181
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.1.dist-info/LICENSE,sha256=lz4IpJ5_adG3S0ali-WaIpQFVTnEAOucMDQPECUVEYw,1110
31
- water_column_sonar_processing-25.1.1.dist-info/METADATA,sha256=M_ZpXvB7bE70nptx6DMHvlsUr0VoGWzmBaXrxzrmrWo,5474
32
- water_column_sonar_processing-25.1.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
33
- water_column_sonar_processing-25.1.1.dist-info/top_level.txt,sha256=aRYU4A7RNBlNrL4vzjytFAir3BNnmOgsvIGKKA36tg4,30
34
- water_column_sonar_processing-25.1.1.dist-info/RECORD,,
30
+ water_column_sonar_processing-25.1.3.dist-info/LICENSE,sha256=lz4IpJ5_adG3S0ali-WaIpQFVTnEAOucMDQPECUVEYw,1110
31
+ water_column_sonar_processing-25.1.3.dist-info/METADATA,sha256=R0wRzg_ywppwzCzyY1MOyqRtFrPl6lyq1ltldgisbe4,5448
32
+ water_column_sonar_processing-25.1.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
33
+ water_column_sonar_processing-25.1.3.dist-info/top_level.txt,sha256=aRYU4A7RNBlNrL4vzjytFAir3BNnmOgsvIGKKA36tg4,30
34
+ water_column_sonar_processing-25.1.3.dist-info/RECORD,,