open-fdd 0.1.3__py3-none-any.whl → 0.1.5__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.
- open_fdd/air_handling_unit/faults/__init__.py +2253 -0
- open_fdd/air_handling_unit/faults/fault_condition.py +12 -10
- open_fdd/air_handling_unit/faults/fault_condition_eight.py +38 -2
- open_fdd/air_handling_unit/faults/fault_condition_eleven.py +38 -2
- open_fdd/air_handling_unit/faults/fault_condition_fifteen.py +38 -2
- open_fdd/air_handling_unit/faults/fault_condition_five.py +38 -2
- open_fdd/air_handling_unit/faults/fault_condition_four.py +34 -2
- open_fdd/air_handling_unit/faults/fault_condition_fourteen.py +38 -2
- open_fdd/air_handling_unit/faults/fault_condition_nine.py +38 -2
- open_fdd/air_handling_unit/faults/fault_condition_one.py +37 -6
- open_fdd/air_handling_unit/faults/fault_condition_seven.py +38 -2
- open_fdd/air_handling_unit/faults/fault_condition_six.py +39 -2
- open_fdd/air_handling_unit/faults/fault_condition_ten.py +39 -3
- open_fdd/air_handling_unit/faults/fault_condition_thirteen.py +38 -2
- open_fdd/air_handling_unit/faults/fault_condition_three.py +32 -2
- open_fdd/air_handling_unit/faults/fault_condition_twelve.py +40 -3
- open_fdd/air_handling_unit/faults/fault_condition_two.py +32 -2
- open_fdd/air_handling_unit/faults/helper_utils.py +1 -29
- open_fdd/air_handling_unit/reports/__init__.py +894 -0
- open_fdd/air_handling_unit/reports/fault_report.py +41 -0
- open_fdd/tests/ahu/test_ahu_fc1.py +1 -1
- open_fdd/tests/ahu/test_ahu_fc10.py +1 -1
- open_fdd/tests/ahu/test_ahu_fc11.py +1 -1
- open_fdd/tests/ahu/test_ahu_fc12.py +1 -1
- open_fdd/tests/ahu/test_ahu_fc13.py +1 -1
- open_fdd/tests/ahu/test_ahu_fc14.py +1 -1
- open_fdd/tests/ahu/test_ahu_fc15.py +1 -1
- open_fdd/tests/ahu/test_ahu_fc2.py +1 -1
- open_fdd/tests/ahu/test_ahu_fc3.py +1 -1
- open_fdd/tests/ahu/test_ahu_fc4.py +199 -127
- open_fdd/tests/ahu/test_ahu_fc5.py +1 -1
- open_fdd/tests/ahu/test_ahu_fc6.py +2 -2
- open_fdd/tests/ahu/test_ahu_fc7.py +1 -1
- open_fdd/tests/ahu/test_ahu_fc8.py +1 -1
- open_fdd/tests/ahu/test_ahu_fc9.py +1 -1
- {open_fdd-0.1.3.dist-info → open_fdd-0.1.5.dist-info}/METADATA +21 -14
- {open_fdd-0.1.3.dist-info → open_fdd-0.1.5.dist-info}/RECORD +40 -39
- {open_fdd-0.1.3.dist-info → open_fdd-0.1.5.dist-info}/LICENSE +0 -0
- {open_fdd-0.1.3.dist-info → open_fdd-0.1.5.dist-info}/WHEEL +0 -0
- {open_fdd-0.1.3.dist-info → open_fdd-0.1.5.dist-info}/top_level.txt +0 -0
@@ -24,6 +24,20 @@ class FaultConditionTen(FaultCondition):
|
|
24
24
|
self.troubleshoot_mode = bool # default False,
|
25
25
|
self.rolling_window_size = int
|
26
26
|
|
27
|
+
self.equation_string = (
|
28
|
+
"fc10_flag = 1 if |OAT - MAT| > √(εOAT² + εMAT²) in "
|
29
|
+
"economizer + mech cooling mode for N consecutive values else 0 \n"
|
30
|
+
)
|
31
|
+
self.description_string = (
|
32
|
+
"Fault Condition 10: Outdoor air temperature and mixed air temperature "
|
33
|
+
"should be approximately equal in economizer plus mechanical cooling mode \n"
|
34
|
+
)
|
35
|
+
self.required_column_description = (
|
36
|
+
"Required inputs are the outside air temperature, mixed air temperature, "
|
37
|
+
"cooling signal, and economizer signal \n"
|
38
|
+
)
|
39
|
+
self.error_string = f"One or more required columns are missing or None \n"
|
40
|
+
|
27
41
|
self.set_attributes(dict_)
|
28
42
|
|
29
43
|
# Set required columns specific to this fault condition
|
@@ -34,9 +48,31 @@ class FaultConditionTen(FaultCondition):
|
|
34
48
|
self.economizer_sig_col,
|
35
49
|
]
|
36
50
|
|
51
|
+
# Check if any of the required columns are None
|
52
|
+
if any(col is None for col in self.required_columns):
|
53
|
+
raise MissingColumnError(
|
54
|
+
f"{self.error_string}"
|
55
|
+
f"{self.equation_string}"
|
56
|
+
f"{self.description_string}"
|
57
|
+
f"{self.required_column_description}"
|
58
|
+
f"{self.required_columns}"
|
59
|
+
)
|
60
|
+
|
61
|
+
# Ensure all required columns are strings
|
62
|
+
self.required_columns = [str(col) for col in self.required_columns]
|
63
|
+
|
64
|
+
self.mapped_columns = (
|
65
|
+
f"Your config dictionary is mapped as: {', '.join(self.required_columns)}"
|
66
|
+
)
|
67
|
+
|
37
68
|
def get_required_columns(self) -> str:
|
38
69
|
"""Returns a string representation of the required columns."""
|
39
|
-
return
|
70
|
+
return (
|
71
|
+
f"{self.equation_string}"
|
72
|
+
f"{self.description_string}"
|
73
|
+
f"{self.required_column_description}"
|
74
|
+
f"{self.mapped_columns}"
|
75
|
+
)
|
40
76
|
|
41
77
|
def apply(self, df: pd.DataFrame) -> pd.DataFrame:
|
42
78
|
try:
|
@@ -60,7 +96,7 @@ class FaultConditionTen(FaultCondition):
|
|
60
96
|
|
61
97
|
df["combined_check"] = (
|
62
98
|
(df["abs_mat_minus_oat"] > df["mat_oat_sqrted"])
|
63
|
-
# verify
|
99
|
+
# verify AHU is running in OS 3 clg mode in min OA
|
64
100
|
& (df[self.cooling_sig_col] > 0.01)
|
65
101
|
& (df[self.economizer_sig_col] > 0.9)
|
66
102
|
)
|
@@ -84,4 +120,4 @@ class FaultConditionTen(FaultCondition):
|
|
84
120
|
except MissingColumnError as e:
|
85
121
|
print(f"Error: {e.message}")
|
86
122
|
sys.stdout.flush()
|
87
|
-
raise e
|
123
|
+
raise e
|
@@ -24,6 +24,20 @@ class FaultConditionThirteen(FaultCondition):
|
|
24
24
|
self.troubleshoot_mode = bool # default False
|
25
25
|
self.rolling_window_size = int
|
26
26
|
|
27
|
+
self.equation_string = (
|
28
|
+
"fc13_flag = 1 if SAT > (SATSP + εSAT) in "
|
29
|
+
"economizer + mech cooling mode for N consecutive values else 0 \n"
|
30
|
+
)
|
31
|
+
self.description_string = (
|
32
|
+
"Fault Condition 13: Supply air temperature too high in full cooling "
|
33
|
+
"in economizer plus mechanical cooling mode \n"
|
34
|
+
)
|
35
|
+
self.required_column_description = (
|
36
|
+
"Required inputs are the supply air temperature, supply air temperature setpoint, "
|
37
|
+
"cooling signal, and economizer signal \n"
|
38
|
+
)
|
39
|
+
self.error_string = f"One or more required columns are missing or None \n"
|
40
|
+
|
27
41
|
self.set_attributes(dict_)
|
28
42
|
|
29
43
|
# Set required columns specific to this fault condition
|
@@ -34,9 +48,31 @@ class FaultConditionThirteen(FaultCondition):
|
|
34
48
|
self.economizer_sig_col,
|
35
49
|
]
|
36
50
|
|
51
|
+
# Check if any of the required columns are None
|
52
|
+
if any(col is None for col in self.required_columns):
|
53
|
+
raise MissingColumnError(
|
54
|
+
f"{self.error_string}"
|
55
|
+
f"{self.equation_string}"
|
56
|
+
f"{self.description_string}"
|
57
|
+
f"{self.required_column_description}"
|
58
|
+
f"{self.required_columns}"
|
59
|
+
)
|
60
|
+
|
61
|
+
# Ensure all required columns are strings
|
62
|
+
self.required_columns = [str(col) for col in self.required_columns]
|
63
|
+
|
64
|
+
self.mapped_columns = (
|
65
|
+
f"Your config dictionary is mapped as: {', '.join(self.required_columns)}"
|
66
|
+
)
|
67
|
+
|
37
68
|
def get_required_columns(self) -> str:
|
38
69
|
"""Returns a string representation of the required columns."""
|
39
|
-
return
|
70
|
+
return (
|
71
|
+
f"{self.equation_string}"
|
72
|
+
f"{self.description_string}"
|
73
|
+
f"{self.required_column_description}"
|
74
|
+
f"{self.mapped_columns}"
|
75
|
+
)
|
40
76
|
|
41
77
|
def apply(self, df: pd.DataFrame) -> pd.DataFrame:
|
42
78
|
try:
|
@@ -88,4 +124,4 @@ class FaultConditionThirteen(FaultCondition):
|
|
88
124
|
except MissingColumnError as e:
|
89
125
|
print(f"Error: {e.message}")
|
90
126
|
sys.stdout.flush()
|
91
|
-
raise e
|
127
|
+
raise e
|
@@ -24,6 +24,14 @@ class FaultConditionThree(FaultCondition):
|
|
24
24
|
self.troubleshoot_mode = bool # default to False
|
25
25
|
self.rolling_window_size = int
|
26
26
|
|
27
|
+
self.equation_string = (
|
28
|
+
"fc3_flag = 1 if (MAT - εMAT > max(RAT + εRAT, OAT + εOAT)) and (VFDSPD > 0) "
|
29
|
+
"for N consecutive values else 0 \n"
|
30
|
+
)
|
31
|
+
self.description_string = "Fault Condition 3: Mix temperature too high; should be between outside and return air \n"
|
32
|
+
self.required_column_description = "Required inputs are the mix air temperature, return air temperature, outside air temperature, and supply fan VFD speed \n"
|
33
|
+
self.error_string = f"One or more required columns are missing or None \n"
|
34
|
+
|
27
35
|
self.set_attributes(dict_)
|
28
36
|
|
29
37
|
# Set required columns specific to this fault condition
|
@@ -34,9 +42,31 @@ class FaultConditionThree(FaultCondition):
|
|
34
42
|
self.supply_vfd_speed_col,
|
35
43
|
]
|
36
44
|
|
45
|
+
# Check if any of the required columns are None
|
46
|
+
if any(col is None for col in self.required_columns):
|
47
|
+
raise MissingColumnError(
|
48
|
+
f"{self.error_string}"
|
49
|
+
f"{self.equation_string}"
|
50
|
+
f"{self.description_string}"
|
51
|
+
f"{self.required_column_description}"
|
52
|
+
f"{self.required_columns}"
|
53
|
+
)
|
54
|
+
|
55
|
+
# Ensure all required columns are strings
|
56
|
+
self.required_columns = [str(col) for col in self.required_columns]
|
57
|
+
|
58
|
+
self.mapped_columns = (
|
59
|
+
f"Your config dictionary is mapped as: {', '.join(self.required_columns)}"
|
60
|
+
)
|
61
|
+
|
37
62
|
def get_required_columns(self) -> str:
|
38
63
|
"""Returns a string representation of the required columns."""
|
39
|
-
return
|
64
|
+
return (
|
65
|
+
f"{self.equation_string}"
|
66
|
+
f"{self.description_string}"
|
67
|
+
f"{self.required_column_description}"
|
68
|
+
f"{self.mapped_columns}"
|
69
|
+
)
|
40
70
|
|
41
71
|
def apply(self, df: pd.DataFrame) -> pd.DataFrame:
|
42
72
|
try:
|
@@ -80,4 +110,4 @@ class FaultConditionThree(FaultCondition):
|
|
80
110
|
except MissingColumnError as e:
|
81
111
|
print(f"Error: {e.message}")
|
82
112
|
sys.stdout.flush()
|
83
|
-
raise e
|
113
|
+
raise e
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import pandas as pd
|
2
|
+
import numpy as np
|
2
3
|
import operator
|
3
4
|
from open_fdd.air_handling_unit.faults.fault_condition import (
|
4
5
|
FaultCondition,
|
@@ -26,6 +27,20 @@ class FaultConditionTwelve(FaultCondition):
|
|
26
27
|
self.troubleshoot_mode = bool # default False
|
27
28
|
self.rolling_window_size = int
|
28
29
|
|
30
|
+
self.equation_string = (
|
31
|
+
"fc12_flag = 1 if SAT >= MAT + εMAT in "
|
32
|
+
"economizer + mech cooling mode for N consecutive values else 0 \n"
|
33
|
+
)
|
34
|
+
self.description_string = (
|
35
|
+
"Fault Condition 12: Supply air temperature too high; should be less than "
|
36
|
+
"mixed air temperature in economizer plus mechanical cooling mode \n"
|
37
|
+
)
|
38
|
+
self.required_column_description = (
|
39
|
+
"Required inputs are the supply air temperature, mixed air temperature, "
|
40
|
+
"cooling signal, and economizer signal \n"
|
41
|
+
)
|
42
|
+
self.error_string = f"One or more required columns are missing or None \n"
|
43
|
+
|
29
44
|
self.set_attributes(dict_)
|
30
45
|
|
31
46
|
# Set required columns specific to this fault condition
|
@@ -36,9 +51,31 @@ class FaultConditionTwelve(FaultCondition):
|
|
36
51
|
self.economizer_sig_col,
|
37
52
|
]
|
38
53
|
|
54
|
+
# Check if any of the required columns are None
|
55
|
+
if any(col is None for col in self.required_columns):
|
56
|
+
raise MissingColumnError(
|
57
|
+
f"{self.error_string}"
|
58
|
+
f"{self.equation_string}"
|
59
|
+
f"{self.description_string}"
|
60
|
+
f"{self.required_column_description}"
|
61
|
+
f"{self.required_columns}"
|
62
|
+
)
|
63
|
+
|
64
|
+
# Ensure all required columns are strings
|
65
|
+
self.required_columns = [str(col) for col in self.required_columns]
|
66
|
+
|
67
|
+
self.mapped_columns = (
|
68
|
+
f"Your config dictionary is mapped as: {', '.join(self.required_columns)}"
|
69
|
+
)
|
70
|
+
|
39
71
|
def get_required_columns(self) -> str:
|
40
72
|
"""Returns a string representation of the required columns."""
|
41
|
-
return
|
73
|
+
return (
|
74
|
+
f"{self.equation_string}"
|
75
|
+
f"{self.description_string}"
|
76
|
+
f"{self.required_column_description}"
|
77
|
+
f"{self.mapped_columns}"
|
78
|
+
)
|
42
79
|
|
43
80
|
def apply(self, df: pd.DataFrame) -> pd.DataFrame:
|
44
81
|
try:
|
@@ -68,7 +105,7 @@ class FaultConditionTwelve(FaultCondition):
|
|
68
105
|
& (df[self.cooling_sig_col] > 0.01)
|
69
106
|
& (df[self.economizer_sig_col] == self.ahu_min_oa_dpr), # OR
|
70
107
|
(df["sat_minus_saterr_delta_supply_fan"] > df["mat_plus_materr"])
|
71
|
-
# verify
|
108
|
+
# verify AHU is running in OS 3 clg mode in 100 OA
|
72
109
|
& (df[self.cooling_sig_col] > 0.01)
|
73
110
|
& (df[self.economizer_sig_col] > 0.9),
|
74
111
|
)
|
@@ -92,4 +129,4 @@ class FaultConditionTwelve(FaultCondition):
|
|
92
129
|
except MissingColumnError as e:
|
93
130
|
print(f"Error: {e.message}")
|
94
131
|
sys.stdout.flush()
|
95
|
-
raise e
|
132
|
+
raise e
|
@@ -24,6 +24,14 @@ class FaultConditionTwo(FaultCondition):
|
|
24
24
|
self.troubleshoot_mode = bool # default to False
|
25
25
|
self.rolling_window_size = int
|
26
26
|
|
27
|
+
self.equation_string = (
|
28
|
+
"fc2_flag = 1 if (MAT + εMAT < min(RAT - εRAT, OAT - εOAT)) and (VFDSPD > 0) "
|
29
|
+
"for N consecutive values else 0 \n"
|
30
|
+
)
|
31
|
+
self.description_string = "Fault Condition 2: Mix temperature too low; should be between outside and return air \n"
|
32
|
+
self.required_column_description = "Required inputs are the mix air temperature, return air temperature, outside air temperature, and supply fan VFD speed \n"
|
33
|
+
self.error_string = f"One or more required columns are missing or None \n"
|
34
|
+
|
27
35
|
self.set_attributes(dict_)
|
28
36
|
|
29
37
|
# Set required columns specific to this fault condition
|
@@ -34,9 +42,31 @@ class FaultConditionTwo(FaultCondition):
|
|
34
42
|
self.supply_vfd_speed_col,
|
35
43
|
]
|
36
44
|
|
45
|
+
# Check if any of the required columns are None
|
46
|
+
if any(col is None for col in self.required_columns):
|
47
|
+
raise MissingColumnError(
|
48
|
+
f"{self.error_string}"
|
49
|
+
f"{self.equation_string}"
|
50
|
+
f"{self.description_string}"
|
51
|
+
f"{self.required_column_description}"
|
52
|
+
f"{self.required_columns}"
|
53
|
+
)
|
54
|
+
|
55
|
+
# Ensure all required columns are strings
|
56
|
+
self.required_columns = [str(col) for col in self.required_columns]
|
57
|
+
|
58
|
+
self.mapped_columns = (
|
59
|
+
f"Your config dictionary is mapped as: {', '.join(self.required_columns)}"
|
60
|
+
)
|
61
|
+
|
37
62
|
def get_required_columns(self) -> str:
|
38
63
|
"""Returns a string representation of the required columns."""
|
39
|
-
return
|
64
|
+
return (
|
65
|
+
f"{self.equation_string}"
|
66
|
+
f"{self.description_string}"
|
67
|
+
f"{self.required_column_description}"
|
68
|
+
f"{self.mapped_columns}"
|
69
|
+
)
|
40
70
|
|
41
71
|
def apply(self, df: pd.DataFrame) -> pd.DataFrame:
|
42
72
|
try:
|
@@ -80,4 +110,4 @@ class FaultConditionTwo(FaultCondition):
|
|
80
110
|
except MissingColumnError as e:
|
81
111
|
print(f"Error: {e.message}")
|
82
112
|
sys.stdout.flush()
|
83
|
-
raise e
|
113
|
+
raise e
|
@@ -41,49 +41,21 @@ class HelperUtils:
|
|
41
41
|
# Set the config dictionary
|
42
42
|
self.set_config_dict(config_dict)
|
43
43
|
|
44
|
-
from open_fdd.air_handling_unit.faults
|
44
|
+
from open_fdd.air_handling_unit.faults import (
|
45
45
|
FaultConditionOne,
|
46
|
-
)
|
47
|
-
from open_fdd.air_handling_unit.faults.fault_condition_two import (
|
48
46
|
FaultConditionTwo,
|
49
|
-
)
|
50
|
-
from open_fdd.air_handling_unit.faults.fault_condition_three import (
|
51
47
|
FaultConditionThree,
|
52
|
-
)
|
53
|
-
from open_fdd.air_handling_unit.faults.fault_condition_four import (
|
54
48
|
FaultConditionFour,
|
55
|
-
)
|
56
|
-
from open_fdd.air_handling_unit.faults.fault_condition_five import (
|
57
49
|
FaultConditionFive,
|
58
|
-
)
|
59
|
-
from open_fdd.air_handling_unit.faults.fault_condition_six import (
|
60
50
|
FaultConditionSix,
|
61
|
-
)
|
62
|
-
from open_fdd.air_handling_unit.faults.fault_condition_seven import (
|
63
51
|
FaultConditionSeven,
|
64
|
-
)
|
65
|
-
from open_fdd.air_handling_unit.faults.fault_condition_eight import (
|
66
52
|
FaultConditionEight,
|
67
|
-
)
|
68
|
-
from open_fdd.air_handling_unit.faults.fault_condition_nine import (
|
69
53
|
FaultConditionNine,
|
70
|
-
)
|
71
|
-
from open_fdd.air_handling_unit.faults.fault_condition_ten import (
|
72
54
|
FaultConditionTen,
|
73
|
-
)
|
74
|
-
from open_fdd.air_handling_unit.faults.fault_condition_eleven import (
|
75
55
|
FaultConditionEleven,
|
76
|
-
)
|
77
|
-
from open_fdd.air_handling_unit.faults.fault_condition_twelve import (
|
78
56
|
FaultConditionTwelve,
|
79
|
-
)
|
80
|
-
from open_fdd.air_handling_unit.faults.fault_condition_thirteen import (
|
81
57
|
FaultConditionThirteen,
|
82
|
-
)
|
83
|
-
from open_fdd.air_handling_unit.faults.fault_condition_fourteen import (
|
84
58
|
FaultConditionFourteen,
|
85
|
-
)
|
86
|
-
from open_fdd.air_handling_unit.faults.fault_condition_fifteen import (
|
87
59
|
FaultConditionFifteen,
|
88
60
|
)
|
89
61
|
|