ecopipeline 0.10.1__py3-none-any.whl → 0.10.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.
@@ -77,12 +77,12 @@ def flag_abnormal_COP(daily_data: pd.DataFrame, config : ConfigManager, system:
77
77
  if bound_var in cop_columns:
78
78
  for day, day_values in daily_data.iterrows():
79
79
  if day_values[bound_var] > bounds['high_alarm'] or day_values[bound_var] < bounds['low_alarm']:
80
- alarm_str = f"{bounds['pretty_name']} = {round(day_values[bound_var],2)}"
80
+ alarm_str = f"Unexpected COP Value detected: {bounds['pretty_name']} = {round(day_values[bound_var],2)}"
81
81
  if day in alarms_dict:
82
- alarms_dict[day] = alarms_dict[day] + f", {alarm_str}"
82
+ alarms_dict[day].append([bound_var, alarm_str])
83
83
  else:
84
- alarms_dict[day] = f"Unexpected COP Value(s) detected: {alarm_str}"
85
- return _convert_event_type_dict_to_df(alarms_dict)
84
+ alarms_dict[day] = [[bound_var, alarm_str]]
85
+ return _convert_event_type_dict_to_df(alarms_dict, event_type="SILENT_ALARM")
86
86
 
87
87
  def _check_if_during_ongoing_cop_alarm(daily_df : pd.DataFrame, config : ConfigManager, site_name : str = None) -> bool:
88
88
  if site_name is None:
@@ -212,11 +212,12 @@ def _convert_event_type_dict_to_df(alarm_dict : dict, event_type = 'DATA_LOSS_CO
212
212
  'variable_name' : []
213
213
  }
214
214
  for key, value in alarm_dict.items():
215
- events['start_time_pt'].append(key)
216
- events['end_time_pt'].append(key)
217
- events['event_type'].append(event_type)
218
- events['event_detail'].append(value)
219
- events['variable_name'].append(None)
215
+ for i in range(len(value)):
216
+ events['start_time_pt'].append(key)
217
+ events['end_time_pt'].append(key)
218
+ events['event_type'].append(event_type)
219
+ events['event_detail'].append(value[i][1])
220
+ events['variable_name'].append(value[i][0])
220
221
 
221
222
  event_df = pd.DataFrame(events)
222
223
  event_df.set_index('start_time_pt', inplace=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ecopipeline
3
- Version: 0.10.1
3
+ Version: 0.10.2
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
  ecopipeline/__init__.py,sha256=d48mO5La6OrQDkRe_qqoY6lUx7x-e8krOH388jmWjwU,218
2
2
  ecopipeline/event_tracking/__init__.py,sha256=SV2kkvJgptjeyLQlqHWcDRpQO6-JC433_dRZ3H9-ZNU,131
3
- ecopipeline/event_tracking/event_tracking.py,sha256=ly6y6IM8_jlwa9dZ-FlAYEC-rbNKPc1NByYD12lyl2w,23168
3
+ ecopipeline/event_tracking/event_tracking.py,sha256=LhL2qffLbEqpRE2PmRvZjj67oUxTKC2MKSqawI4XqEA,23264
4
4
  ecopipeline/extract/__init__.py,sha256=gQ3sak6NJ63Gpo-hZXrtZfeKOTHLRyAVXfTgxxRpqPo,675
5
5
  ecopipeline/extract/extract.py,sha256=y32feIIzgABwrwfduNQM1hICmkVOU4PYu6-M07zCLpU,51422
6
6
  ecopipeline/load/__init__.py,sha256=NLa_efQJZ8aP-J0Y5xx9DP7mtfRH9jY6Jz1ZMZN_BAA,292
@@ -12,8 +12,8 @@ ecopipeline/transform/transform.py,sha256=wL4B00XBwLWVlf7goOLSHKgLFmIsXprQNepGLL
12
12
  ecopipeline/utils/ConfigManager.py,sha256=-g1wtExdvhYO5Y6Q3cRbywa__DxRMFruLrB4YanwaPY,12168
13
13
  ecopipeline/utils/__init__.py,sha256=ccWUR0m7gD9DfcgsxBCLOfi4lho6RdYuB2Ugy_g6ZdQ,28
14
14
  ecopipeline/utils/unit_convert.py,sha256=VFh1we2Y8KV3u21BeWb-U3TlZJXo83q5vdxxkpgcuME,3064
15
- ecopipeline-0.10.1.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- ecopipeline-0.10.1.dist-info/METADATA,sha256=LqVlpLeTsKuQTy_LhAcziKYvS_NgAiquydrzALKypDc,2330
17
- ecopipeline-0.10.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
- ecopipeline-0.10.1.dist-info/top_level.txt,sha256=WOPFJH2LIgKqm4lk2OnFF5cgVkYibkaBxIxgvLgO7y0,12
19
- ecopipeline-0.10.1.dist-info/RECORD,,
15
+ ecopipeline-0.10.2.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ ecopipeline-0.10.2.dist-info/METADATA,sha256=hKZenaQpTLsiAohHLP92cdWypwupi9yJgRTwZjG4GHM,2330
17
+ ecopipeline-0.10.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
+ ecopipeline-0.10.2.dist-info/top_level.txt,sha256=WOPFJH2LIgKqm4lk2OnFF5cgVkYibkaBxIxgvLgO7y0,12
19
+ ecopipeline-0.10.2.dist-info/RECORD,,