Event Tracking Documentation

ecopipeline.event_tracking.central_alarm_df_creator(df: DataFrame, daily_data: DataFrame, config: ConfigManager, system: str = '', default_cop_high_bound: float = 4.5, default_cop_low_bound: float = 0, default_boundary_fault_time: int = 15, site_name: str = None, day_table_name_header: str = 'day', power_ratio_period_days: int = 7) DataFrame
ecopipeline.event_tracking.flag_abnormal_COP(daily_data: DataFrame, config: ConfigManager, system: str = '', default_high_bound: float = 4.5, default_low_bound: float = 0) DataFrame
ecopipeline.event_tracking.flag_boundary_alarms(df: DataFrame, config: ConfigManager, default_fault_time: int = 15, system: str = '', full_days: list = None) DataFrame

Function will take a pandas dataframe and location of alarm information in a csv, and create an dataframe with applicable alarm events

Parameters:
df: pd.DataFrame

post-transformed dataframe for minute data. It should be noted that this function expects consecutive, in order minutes. If minutes are out of order or have gaps, the function may return erroneous alarms.

configecopipeline.ConfigManager

The ConfigManager object that holds configuration data for the pipeline. Among other things, this object will point to a file called Varriable_Names.csv in the input folder of the pipeline (e.g. “full/path/to/pipeline/input/Variable_Names.csv”). The file must have at least three columns which must be titled “variable_name”, “low_alarm”, and “high_alarm” which should contain the name of each variable in the dataframe that requires the alarming, the lower bound for acceptable data, and the upper bound for acceptable data respectively

default_fault_timeint

Number of consecutive minutes that a sensor must be out of bounds for to trigger an alarm. Can be customized for each variable with the fault_time column in Varriable_Names.csv

system: str

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.

full_dayslist

list of pd.Datetimes that should be considered full days here. If set to none, will take any day at all present in df

Returns:
pd.DataFrame:

Pandas dataframe with alarm events

ecopipeline.event_tracking.power_ratio_alarm(daily_df: DataFrame, config: ConfigManager, day_table_name: str, system: str = '', verbose: bool = False, ratio_period_days: int = 7) DataFrame

Function will take a pandas dataframe of daily data and location of alarm information in a csv, and create an dataframe with applicable alarm events

Parameters:
daily_df: pd.DataFrame

post-transformed dataframe for daily data. It should be noted that this function expects consecutive, in order days. If days are out of order or have gaps, the function may return erroneous alarms.

configecopipeline.ConfigManager

The ConfigManager object that holds configuration data for the pipeline. Among other things, this object will point to a file called Varriable_Names.csv in the input folder of the pipeline (e.g. “full/path/to/pipeline/input/Variable_Names.csv”). The file must have at least two columns which must be titled “variable_name”, “alarm_codes” which should contain the name of each variable in the dataframe that requires the alarming and the ratio alarm code in the form “PR_{Power Ratio Name}:{low percentage}-{high percentage}

system: str

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.

verbosebool

add print statements in power ratio

Returns:
pd.DataFrame:

Pandas dataframe with alarm events, empty if no alarms triggered