ecopipeline 0.6.5__py3-none-any.whl → 0.6.7__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.
@@ -141,7 +141,7 @@ def extract_new(startTime: datetime, filenames: List[str], decihex = False, time
141
141
 
142
142
  if decihex:
143
143
  base_date = datetime(1970, 1, 1)
144
- file_dates = [pd.Timestamp(base_date + timedelta(seconds = int(re.search(r'\.(.*?)_', filename).group(1), 16))) for filename in filenames] #convert decihex to dates, these are in utc
144
+ file_dates = [pd.Timestamp(base_date + timedelta(seconds = int(re.search(r'\.(.*?)_', filename.split("/")[-1]).group(1), 16))) for filename in filenames] #convert decihex to dates, these are in utc
145
145
  if timeZone == None:
146
146
  file_dates_local = [file_date.tz_localize('UTC').tz_localize(None) for file_date in file_dates] #convert utc
147
147
  else:
ecopipeline/load/load.py CHANGED
@@ -396,7 +396,8 @@ def load_event_table(config : ConfigManager, event_df: pd.DataFrame, site_name :
396
396
 
397
397
  def report_data_loss(config : ConfigManager, site_name : str = None):
398
398
  """
399
- Logs data loss event in event database (assumes one exists)
399
+ Logs data loss event in event database (assumes one exists) as a DATA_LOSS_COP event to
400
+ note that COP calculations have been effected
400
401
 
401
402
  Parameters
402
403
  ----------
@@ -418,11 +419,11 @@ def report_data_loss(config : ConfigManager, site_name : str = None):
418
419
  site_name = config.get_site_name()
419
420
  error_string = "Error processing data. Please check logs to resolve."
420
421
 
421
- print(f"logging DATA_LOSS into {table_name}")
422
+ print(f"logging DATA_LOSS_COP into {table_name}")
422
423
 
423
424
  # create SQL statement
424
425
  insert_str = "INSERT INTO " + table_name + " (start_time_pt, site_name, event_detail, event_type, last_modified_date, last_modified_by) VALUES "
425
- insert_str += f"('{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}','{site_name}','{error_string}','DATA_LOSS','{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}','automatic_upload')"
426
+ insert_str += f"('{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}','{site_name}','{error_string}','DATA_LOSS_COP','{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}','automatic_upload')"
426
427
 
427
428
  existing_rows = pd.DataFrame({
428
429
  'id' : []
@@ -438,7 +439,7 @@ def report_data_loss(config : ConfigManager, site_name : str = None):
438
439
  try:
439
440
  # find existing times in database for upsert statement
440
441
  cursor.execute(
441
- f"SELECT id FROM {table_name} WHERE end_time_pt IS NULL AND site_name = '{site_name}' AND event_type = 'DATA_LOSS'")
442
+ f"SELECT id FROM {table_name} WHERE end_time_pt IS NULL AND site_name = '{site_name}' AND event_type = 'DATA_LOSS_COP'")
442
443
  # Fetch the results into a DataFrame
443
444
  existing_rows = pd.DataFrame(cursor.fetchall(), columns=['id'])
444
445
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ecopipeline
3
- Version: 0.6.5
3
+ Version: 0.6.7
4
4
  Summary: Contains functions for use in Ecotope Datapipelines
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: License :: OSI Approved :: GNU General Public License (GPL)
@@ -1,8 +1,8 @@
1
1
  ecopipeline/__init__.py,sha256=vCRzwd781ciCSXMP1ycM_BXAqxj3KVaNKIjsLOPcbwc,171
2
2
  ecopipeline/extract/__init__.py,sha256=3u_CUMdCguVewU3kN8x6xhVNyo1-p-gwTrhjOh7Psqg,645
3
- ecopipeline/extract/extract.py,sha256=ryorqnu1RgyNK7joZRcbMmTajlTlB5hwaYzzpo8Z8Ho,43369
3
+ ecopipeline/extract/extract.py,sha256=heWcWTeRVTRITh_1sHVnkaKOOi5PwUOEVIi4k5tw2Z8,43384
4
4
  ecopipeline/load/__init__.py,sha256=oDAVF8AhK_qugqegjW7jK16p-nb9QzKhiNQOkEBniKM,235
5
- ecopipeline/load/load.py,sha256=YfCuzsJYFNZqwR58GeF55-gRI7LpOeaK_DXYHg_0frU,21415
5
+ ecopipeline/load/load.py,sha256=X7JIakIxyjzZbLuUjJ991kcQpyK4cFEZ0Lk36eXBEfI,21506
6
6
  ecopipeline/transform/__init__.py,sha256=DcIJfkRs4OmZzDeEfW_OiOIXNqN6CUl1_lW0SS7-eN8,2280
7
7
  ecopipeline/transform/bayview.py,sha256=TP24dnTsUD95X-f6732egPZKjepFLJgDm9ImGr-fppY,17899
8
8
  ecopipeline/transform/lbnl.py,sha256=EQ54G4rJXaZ7pwVusKcdK2KBehSdCsNo2ybphtMGs7o,33400
@@ -10,8 +10,8 @@ ecopipeline/transform/transform.py,sha256=sRUgfJrvRh0fET-EDa1WPq_tSqxxgIKEjA73ZI
10
10
  ecopipeline/utils/ConfigManager.py,sha256=t4sfTjGO0g5P50XBQqGVFWaXfAlW1GMDh1DLoBuFGks,9826
11
11
  ecopipeline/utils/__init__.py,sha256=ccWUR0m7gD9DfcgsxBCLOfi4lho6RdYuB2Ugy_g6ZdQ,28
12
12
  ecopipeline/utils/unit_convert.py,sha256=VFh1we2Y8KV3u21BeWb-U3TlZJXo83q5vdxxkpgcuME,3064
13
- ecopipeline-0.6.5.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- ecopipeline-0.6.5.dist-info/METADATA,sha256=c7YcK4QIA1gROEcCHeXJiQHcB_ka_95hyi74H0wOLSc,2307
15
- ecopipeline-0.6.5.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
16
- ecopipeline-0.6.5.dist-info/top_level.txt,sha256=WOPFJH2LIgKqm4lk2OnFF5cgVkYibkaBxIxgvLgO7y0,12
17
- ecopipeline-0.6.5.dist-info/RECORD,,
13
+ ecopipeline-0.6.7.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ ecopipeline-0.6.7.dist-info/METADATA,sha256=GWoN_vw2GGv5kfQrGYVdb5wCmvBB3schemn_KhFsxO4,2307
15
+ ecopipeline-0.6.7.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
16
+ ecopipeline-0.6.7.dist-info/top_level.txt,sha256=WOPFJH2LIgKqm4lk2OnFF5cgVkYibkaBxIxgvLgO7y0,12
17
+ ecopipeline-0.6.7.dist-info/RECORD,,