Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fault rules to incorporate a "combined check" to initiate a fault #19

Closed
bbartling opened this issue Feb 3, 2024 · 1 comment
Closed
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bbartling
Copy link
Owner

2024 goal am hoping to overhaul tests and fault rules in this style below that incorporates a combined check before initiating a fault. IE., 5 faults need to come through in a row before the function returns a "true fault" hopefully to cut down any false positives.rolling_sum = df["combined_check"].rolling(window=5).sum(). Chime in with any suggestions this may not apply to every fault rule for the HVAC system at hand and may need to be some adjustable global tuning variable or something...

def apply(self, df: pd.DataFrame) -> pd.DataFrame:
    # Existing checks
    df['static_check_'] = (
        df[self.duct_static_col] < df[self.duct_static_setpoint_col] - self.duct_static_inches_err_thres)
    df['fan_check_'] = (
        df[self.supply_vfd_speed_col] >= self.vfd_speed_percent_max - self.vfd_speed_percent_err_thres)

    # Combined condition check
    df["combined_check"] = df['static_check_'] & df['fan_check_']

    # Rolling sum to count consecutive trues
    rolling_sum = df["combined_check"].rolling(window=5).sum()
    # Set flag to 1 if rolling sum equals the window size (5)
    df["fc1_flag"] = (rolling_sum == 5).astype(int)

    return df
@bbartling bbartling added enhancement New feature or request help wanted Extra attention is needed labels Feb 3, 2024
@bbartling
Copy link
Owner Author

this is complete and built into the fault equations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant