ecopipeline 0.8.1__py3-none-any.whl → 0.8.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.
- ecopipeline/event_tracking/event_tracking.py +8 -5
- {ecopipeline-0.8.1.dist-info → ecopipeline-0.8.2.dist-info}/METADATA +1 -1
- {ecopipeline-0.8.1.dist-info → ecopipeline-0.8.2.dist-info}/RECORD +6 -6
- {ecopipeline-0.8.1.dist-info → ecopipeline-0.8.2.dist-info}/WHEEL +0 -0
- {ecopipeline-0.8.1.dist-info → ecopipeline-0.8.2.dist-info}/licenses/LICENSE +0 -0
- {ecopipeline-0.8.1.dist-info → ecopipeline-0.8.2.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,
|
|
6
|
+
def flag_boundary_alarms(df: pd.DataFrame, config : ConfigManager, default_fault_time : int = 15, site: str = "") -> 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
|
|
@@ -11,9 +11,8 @@ def flag_boundary_alarms(df: pd.DataFrame, daily_df : pd.DataFrame, config : Con
|
|
|
11
11
|
Parameters
|
|
12
12
|
----------
|
|
13
13
|
df: pd.DataFrame
|
|
14
|
-
post-transformed dataframe for minute data
|
|
15
|
-
|
|
16
|
-
post-transformed dataframe for daily data
|
|
14
|
+
post-transformed dataframe for minute data. It should be noted that this function expects consecutive, in order minutes. If minutes
|
|
15
|
+
are out of order or have gaps, the function may return erroneous alarms.
|
|
17
16
|
config : ecopipeline.ConfigManager
|
|
18
17
|
The ConfigManager object that holds configuration data for the pipeline. Among other things, this object will point to a file
|
|
19
18
|
called Varriable_Names.csv in the input folder of the pipeline (e.g. "full/path/to/pipeline/input/Variable_Names.csv").
|
|
@@ -51,6 +50,10 @@ def flag_boundary_alarms(df: pd.DataFrame, daily_df : pd.DataFrame, config : Con
|
|
|
51
50
|
bounds_df['pretty_name'] = bounds_df['variable_name']
|
|
52
51
|
if not 'fault_time' in bounds_df.columns:
|
|
53
52
|
bounds_df['fault_time'] = default_fault_time
|
|
53
|
+
|
|
54
|
+
idx = df.index
|
|
55
|
+
unique_days = pd.to_datetime(pd.Series(idx).dt.normalize().unique())
|
|
56
|
+
|
|
54
57
|
bounds_df = bounds_df.loc[:, ["variable_name", "high_alarm", "low_alarm", "fault_time", "pretty_name"]]
|
|
55
58
|
bounds_df.dropna(axis=0, thresh=2, inplace=True)
|
|
56
59
|
bounds_df.set_index(['variable_name'], inplace=True)
|
|
@@ -66,7 +69,7 @@ def flag_boundary_alarms(df: pd.DataFrame, daily_df : pd.DataFrame, config : Con
|
|
|
66
69
|
upper_mask = df[bound_var] > bounds["high_alarm"]
|
|
67
70
|
if pd.isna(bounds['fault_time']):
|
|
68
71
|
bounds['fault_time'] = default_fault_time
|
|
69
|
-
for day in
|
|
72
|
+
for day in unique_days:
|
|
70
73
|
next_day = day + pd.Timedelta(days=1)
|
|
71
74
|
# low alert
|
|
72
75
|
low_filtered_df = lower_mask.loc[(lower_mask.index >= day) & (lower_mask.index < next_day)]
|
|
@@ -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=PHy4xYv71u79UZqFuXnMU7KRwbzOCIc-NNqArcmG9FM,12311
|
|
4
4
|
ecopipeline/extract/__init__.py,sha256=gQ3sak6NJ63Gpo-hZXrtZfeKOTHLRyAVXfTgxxRpqPo,675
|
|
5
5
|
ecopipeline/extract/extract.py,sha256=ITXr8XuadQ81kYA006hygvIYgmkpQXTL6KN4QTpNOvE,46707
|
|
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.2.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
ecopipeline-0.8.2.dist-info/METADATA,sha256=WJrjohUVWYfCqlmpuhjcbt7VMSg5U7B5DpyJWUUOIfQ,2329
|
|
17
|
+
ecopipeline-0.8.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
18
|
+
ecopipeline-0.8.2.dist-info/top_level.txt,sha256=WOPFJH2LIgKqm4lk2OnFF5cgVkYibkaBxIxgvLgO7y0,12
|
|
19
|
+
ecopipeline-0.8.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|