ecopipeline 0.10.0__tar.gz → 0.10.1__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.
Files changed (25) hide show
  1. {ecopipeline-0.10.0/src/ecopipeline.egg-info → ecopipeline-0.10.1}/PKG-INFO +1 -1
  2. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/setup.cfg +1 -1
  3. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/load/load.py +14 -5
  4. {ecopipeline-0.10.0 → ecopipeline-0.10.1/src/ecopipeline.egg-info}/PKG-INFO +1 -1
  5. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/LICENSE +0 -0
  6. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/README.md +0 -0
  7. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/pyproject.toml +0 -0
  8. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/setup.py +0 -0
  9. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/__init__.py +0 -0
  10. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/event_tracking/__init__.py +0 -0
  11. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/event_tracking/event_tracking.py +0 -0
  12. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/extract/__init__.py +0 -0
  13. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/extract/extract.py +0 -0
  14. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/load/__init__.py +0 -0
  15. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/transform/__init__.py +0 -0
  16. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/transform/bayview.py +0 -0
  17. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/transform/lbnl.py +0 -0
  18. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/transform/transform.py +0 -0
  19. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/utils/ConfigManager.py +0 -0
  20. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/utils/__init__.py +0 -0
  21. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline/utils/unit_convert.py +0 -0
  22. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline.egg-info/SOURCES.txt +0 -0
  23. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline.egg-info/dependency_links.txt +0 -0
  24. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline.egg-info/requires.txt +0 -0
  25. {ecopipeline-0.10.0 → ecopipeline-0.10.1}/src/ecopipeline.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ecopipeline
3
- Version: 0.10.0
3
+ Version: 0.10.1
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,6 +1,6 @@
1
1
  [metadata]
2
2
  name = ecopipeline
3
- version = 0.10.0
3
+ version = 0.10.1
4
4
  authors = ["Carlos Bello, <bellocarlos@seattleu.edu>, Emil Fahrig <fahrigemil@seattleu.edu>, Casey Mang <cmang@seattleu.edu>, Julian Harris <harrisjulian@seattleu.edu>, Roger Tram <rtram@seattleu.edu>, Nolan Price <nolan@ecotope.com>"]
5
5
  description = Contains functions for use in Ecotope Datapipelines
6
6
  long_description = file: README.md
@@ -302,6 +302,11 @@ def load_event_table(config : ConfigManager, event_df: pd.DataFrame, site_name :
302
302
  bool:
303
303
  A boolean value indicating if the data was successfully written to the database.
304
304
  """
305
+ # define constants
306
+ proj_cop_filters = ['MV_COMMISSIONED','PLANT_COMMISSIONED','DATA_LOSS_COP','SYSTEM_MAINTENANCE','SYSTEM_TESTING']
307
+ optim_cop_filters = ['MV_COMMISSIONED','PLANT_COMMISSIONED','DATA_LOSS_COP','INSTALLATION_ERROR_COP',
308
+ 'PARTIAL_OCCUPANCY','SOO_PERIOD_COP','SYSTEM_TESTING','EQUIPMENT_MALFUNCTION',
309
+ 'SYSTEM_MAINTENANCE']
305
310
  # Drop empty columns
306
311
  event_df = event_df.dropna(axis=1, how='all')
307
312
 
@@ -329,7 +334,7 @@ def load_event_table(config : ConfigManager, event_df: pd.DataFrame, site_name :
329
334
  column_names += "," + column
330
335
 
331
336
  # create SQL statement
332
- insert_str = "INSERT INTO " + table_name + " (" + column_names + ", variable_name, last_modified_date, last_modified_by) VALUES (%s,%s,%s,%s,%s,%s,'"+datetime.now().strftime('%Y-%m-%d %H:%M:%S')+"','automatic_upload')"
337
+ insert_str = "INSERT INTO " + table_name + " (" + column_names + ", variable_name, summary_filtered, optim_filtered, last_modified_date, last_modified_by) VALUES (%s, %s, %s,%s,%s,%s,%s,%s,'"+datetime.now().strftime('%Y-%m-%d %H:%M:%S')+"','automatic_upload')"
333
338
 
334
339
  if not 'variable_name' in event_df.columns:
335
340
  event_df['variable_name'] = None
@@ -338,11 +343,15 @@ def load_event_table(config : ConfigManager, event_df: pd.DataFrame, site_name :
338
343
  full_column_names.append('last_modified_date')
339
344
  full_column_names.append('last_modified_by')
340
345
  full_column_names.append('variable_name')
346
+ full_column_names.append('summary_filtered')
347
+ full_column_names.append('optim_filtered')
348
+
341
349
  full_column_types = column_types[1:]
342
350
  full_column_types.append('datetime')
343
351
  full_column_types.append('varchar(60)')
344
352
  full_column_types.append('varchar(70)')
345
-
353
+ full_column_types.append('tinyint(1)')
354
+ full_column_types.append('tinyint(1)')
346
355
 
347
356
  existing_rows = pd.DataFrame({
348
357
  'start_time_pt' : [],
@@ -376,7 +385,7 @@ def load_event_table(config : ConfigManager, event_df: pd.DataFrame, site_name :
376
385
  ignoredRows = 0
377
386
  try:
378
387
  for index, row in event_df.iterrows():
379
- time_data = [index,site_name,row['end_time_pt'],row['event_type'],row['event_detail'],row['variable_name']]
388
+ time_data = [index,site_name,row['end_time_pt'],row['event_type'],row['event_detail'],row['variable_name'], row['event_type'] in proj_cop_filters, row['event_type'] in optim_cop_filters]
380
389
  #remove nans and infinites
381
390
  time_data = [None if (x is None or pd.isna(x)) else x for x in time_data]
382
391
  time_data = [None if (x == float('inf') or x == float('-inf')) else x for x in time_data]
@@ -436,8 +445,8 @@ def report_data_loss(config : ConfigManager, site_name : str = None):
436
445
  print(f"logging DATA_LOSS_COP into {table_name}")
437
446
 
438
447
  # create SQL statement
439
- insert_str = "INSERT INTO " + table_name + " (start_time_pt, site_name, event_detail, event_type, last_modified_date, last_modified_by) VALUES "
440
- 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')"
448
+ insert_str = "INSERT INTO " + table_name + " (start_time_pt, site_name, event_detail, event_type, summary_filtered, optim_filtered, last_modified_date, last_modified_by) VALUES "
449
+ insert_str += f"('{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}','{site_name}','{error_string}','DATA_LOSS_COP', true, true, '{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}','automatic_upload')"
441
450
 
442
451
  existing_rows = pd.DataFrame({
443
452
  'id' : []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ecopipeline
3
- Version: 0.10.0
3
+ Version: 0.10.1
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)
File without changes
File without changes
File without changes