ecopipeline 0.8.4__py3-none-any.whl → 0.8.6__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.
- ecopipeline/event_tracking/event_tracking.py +8 -8
- {ecopipeline-0.8.4.dist-info → ecopipeline-0.8.6.dist-info}/METADATA +1 -1
- {ecopipeline-0.8.4.dist-info → ecopipeline-0.8.6.dist-info}/RECORD +6 -6
- {ecopipeline-0.8.4.dist-info → ecopipeline-0.8.6.dist-info}/WHEEL +0 -0
- {ecopipeline-0.8.4.dist-info → ecopipeline-0.8.6.dist-info}/licenses/LICENSE +0 -0
- {ecopipeline-0.8.4.dist-info → ecopipeline-0.8.6.dist-info}/top_level.txt +0 -0
|
@@ -3,7 +3,7 @@ import numpy as np
|
|
|
3
3
|
import datetime as dt
|
|
4
4
|
from ecopipeline import ConfigManager
|
|
5
5
|
|
|
6
|
-
def flag_boundary_alarms(df: pd.DataFrame, config : ConfigManager, default_fault_time : int = 15,
|
|
6
|
+
def flag_boundary_alarms(df: pd.DataFrame, config : ConfigManager, default_fault_time : int = 15, system: str = "", full_days : list = None) -> pd.DataFrame:
|
|
7
7
|
"""
|
|
8
8
|
Function will take a pandas dataframe and location of alarm information in a csv,
|
|
9
9
|
and create an dataframe with applicable alarm events
|
|
@@ -22,8 +22,8 @@ def flag_boundary_alarms(df: pd.DataFrame, config : ConfigManager, default_fault
|
|
|
22
22
|
default_fault_time : int
|
|
23
23
|
Number of consecutive minutes that a sensor must be out of bounds for to trigger an alarm. Can be customized for each variable with
|
|
24
24
|
the fault_time column in Varriable_Names.csv
|
|
25
|
-
|
|
26
|
-
string of
|
|
25
|
+
system: str
|
|
26
|
+
string of system name if processing a particular system in a Variable_Names.csv file with multiple systems. Leave as an empty string if not aplicable.
|
|
27
27
|
full_days : list
|
|
28
28
|
list of pd.Datetimes that should be considered full days here. If set to none, will take any day at all present in df
|
|
29
29
|
|
|
@@ -39,10 +39,10 @@ def flag_boundary_alarms(df: pd.DataFrame, config : ConfigManager, default_fault
|
|
|
39
39
|
print("File Not Found: ", variable_names_path)
|
|
40
40
|
return pd.DataFrame()
|
|
41
41
|
|
|
42
|
-
if (
|
|
43
|
-
if not '
|
|
44
|
-
raise Exception("
|
|
45
|
-
bounds_df = bounds_df.loc[bounds_df['
|
|
42
|
+
if (system != ""):
|
|
43
|
+
if not 'system' in bounds_df.columns:
|
|
44
|
+
raise Exception("system parameter is non null, however, system is not present in Variable_Names.csv")
|
|
45
|
+
bounds_df = bounds_df.loc[bounds_df['system'] == system]
|
|
46
46
|
|
|
47
47
|
required_columns = ["variable_name", "high_alarm", "low_alarm"]
|
|
48
48
|
for required_column in required_columns:
|
|
@@ -118,7 +118,7 @@ def _check_and_add_alarm(df : pd.DataFrame, mask : pd.Series, alarms_dict, day,
|
|
|
118
118
|
# because first (fault_time-1) minutes don't count in window
|
|
119
119
|
adjusted_time = starting_index - pd.Timedelta(minutes=fault_time-1)
|
|
120
120
|
adjusted_longest_streak_length = longest_streak_length + fault_time-1
|
|
121
|
-
alarm_string = f"{alarm_type} bound alarm for {pretty_name} (longest at {adjusted_time.strftime('%H:%M')} for {adjusted_longest_streak_length} minutes). Avg fault time : {avg_streak_length} minutes, Avg value during fault: {average_value}"
|
|
121
|
+
alarm_string = f"{alarm_type} bound alarm for {pretty_name} (longest at {adjusted_time.strftime('%H:%M')} for {adjusted_longest_streak_length} minutes). Avg fault time : {round(avg_streak_length,1)} minutes, Avg value during fault: {round(average_value,2)}"
|
|
122
122
|
if day in alarms_dict:
|
|
123
123
|
alarms_dict[day].append([var_name, alarm_string])
|
|
124
124
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
ecopipeline/__init__.py,sha256=d48mO5La6OrQDkRe_qqoY6lUx7x-e8krOH388jmWjwU,218
|
|
2
2
|
ecopipeline/event_tracking/__init__.py,sha256=q49j46fXMUjNUPzL4FvXEppB93i3lUni-QUZpp61tt0,64
|
|
3
|
-
ecopipeline/event_tracking/event_tracking.py,sha256=
|
|
3
|
+
ecopipeline/event_tracking/event_tracking.py,sha256=LOCLE7ju320O7CrwnWRIqHRa2uAqoq-KvXZ3zWQ2S74,13224
|
|
4
4
|
ecopipeline/extract/__init__.py,sha256=gQ3sak6NJ63Gpo-hZXrtZfeKOTHLRyAVXfTgxxRpqPo,675
|
|
5
5
|
ecopipeline/extract/extract.py,sha256=Fch2IvqGxMClKGniiJiKqyJhcFDwkckaeiGQRVnUGUg,46708
|
|
6
6
|
ecopipeline/load/__init__.py,sha256=NLa_efQJZ8aP-J0Y5xx9DP7mtfRH9jY6Jz1ZMZN_BAA,292
|
|
@@ -12,8 +12,8 @@ ecopipeline/transform/transform.py,sha256=DBQD4WqKmdXnGQMAj6tg75HtXiSemIc7c6nZxz
|
|
|
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.8.
|
|
16
|
-
ecopipeline-0.8.
|
|
17
|
-
ecopipeline-0.8.
|
|
18
|
-
ecopipeline-0.8.
|
|
19
|
-
ecopipeline-0.8.
|
|
15
|
+
ecopipeline-0.8.6.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
ecopipeline-0.8.6.dist-info/METADATA,sha256=-VzwnJWFOLTa3NoreQAXc0PFJNGn0eJoiRTFf8i1jmc,2329
|
|
17
|
+
ecopipeline-0.8.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
18
|
+
ecopipeline-0.8.6.dist-info/top_level.txt,sha256=WOPFJH2LIgKqm4lk2OnFF5cgVkYibkaBxIxgvLgO7y0,12
|
|
19
|
+
ecopipeline-0.8.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|