Skip to content

Commit

Permalink
faults moved into __init__ and examples updated publish new version t…
Browse files Browse the repository at this point in the history
…o pypi and working chiller boiler plant faults next
  • Loading branch information
bbartling committed Aug 26, 2024
1 parent 26f83bd commit c2b0a16
Show file tree
Hide file tree
Showing 36 changed files with 3,179 additions and 2,202 deletions.
25 changes: 12 additions & 13 deletions examples/csv_data_source/ahu_example.ipynb

Large diffs are not rendered by default.

711 changes: 686 additions & 25 deletions examples/csv_data_source/ahu_individual_faults.ipynb

Large diffs are not rendered by default.

2,253 changes: 2,253 additions & 0 deletions open_fdd/air_handling_unit/faults/__init__.py

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions open_fdd/air_handling_unit/faults/fault_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from open_fdd.air_handling_unit.faults.helper_utils import HelperUtils
import sys

"""see __init__.py for fault classes"""


class MissingColumnError(Exception):
"""Custom exception raised when a required column is missing or None."""
Expand All @@ -12,6 +14,14 @@ def __init__(self, message):
super().__init__(self.message)


class InvalidParameterError(Exception):
"""Custom exception raised when a parameter is not valid (e.g., not a float)."""

def __init__(self, message):
self.message = message
super().__init__(self.message)


class FaultCondition:
"""Parent class for Fault Conditions. Methods are inherited to all children."""

Expand All @@ -36,11 +46,7 @@ def check_required_columns(self, df: pd.DataFrame):
raise MissingColumnError(f"Missing required columns: {missing_columns}")

def troubleshoot_cols(self, df):
"""print troubleshoot columns mapping
:param df:
:return:
"""
"""Print troubleshoot columns mapping."""
print("Troubleshoot mode enabled - not removing helper columns")
for col in df.columns:
print(
Expand All @@ -54,11 +60,7 @@ def troubleshoot_cols(self, df):
sys.stdout.flush()

def check_analog_pct(self, df, columns):
"""check analog outputs [data with units of %] are floats only
:param columns:
:return:
"""
"""Check analog outputs [data with units of %] are floats only."""
helper = HelperUtils()
for col in columns:
if not pdtypes.is_float_dtype(df[col]):
Expand Down
127 changes: 0 additions & 127 deletions open_fdd/air_handling_unit/faults/fault_condition_eight.py

This file was deleted.

126 changes: 0 additions & 126 deletions open_fdd/air_handling_unit/faults/fault_condition_eleven.py

This file was deleted.

Loading

0 comments on commit c2b0a16

Please sign in to comment.