open-fdd 0.1.1__py3-none-any.whl → 0.1.4__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 +38 -18
- open_fdd/air_handling_unit/faults/fault_condition_eight.py +91 -31
- open_fdd/air_handling_unit/faults/fault_condition_eleven.py +93 -35
- open_fdd/air_handling_unit/faults/fault_condition_fifteen.py +111 -49
- open_fdd/air_handling_unit/faults/fault_condition_five.py +89 -34
- open_fdd/air_handling_unit/faults/fault_condition_four.py +136 -61
- open_fdd/air_handling_unit/faults/fault_condition_fourteen.py +103 -40
- open_fdd/air_handling_unit/faults/fault_condition_nine.py +95 -35
- open_fdd/air_handling_unit/faults/fault_condition_one.py +83 -31
- open_fdd/air_handling_unit/faults/fault_condition_seven.py +85 -26
- open_fdd/air_handling_unit/faults/fault_condition_six.py +134 -73
- open_fdd/air_handling_unit/faults/fault_condition_ten.py +91 -30
- open_fdd/air_handling_unit/faults/fault_condition_thirteen.py +95 -34
- open_fdd/air_handling_unit/faults/fault_condition_three.py +84 -29
- open_fdd/air_handling_unit/faults/fault_condition_twelve.py +98 -37
- open_fdd/air_handling_unit/faults/fault_condition_two.py +84 -32
- open_fdd/air_handling_unit/faults/helper_utils.py +295 -93
- open_fdd/air_handling_unit/images/ahu1_fc1_2024-06_1.jpg +0 -0
- open_fdd/air_handling_unit/images/ahu1_fc1_2024-06_2.jpg +0 -0
- open_fdd/air_handling_unit/images/example1.jpg +0 -0
- open_fdd/air_handling_unit/images/example2.jpg +0 -0
- open_fdd/air_handling_unit/images/fc10_definition.png +0 -0
- open_fdd/air_handling_unit/images/fc11_definition.png +0 -0
- open_fdd/air_handling_unit/images/fc12_definition.png +0 -0
- open_fdd/air_handling_unit/images/fc13_definition.png +0 -0
- open_fdd/air_handling_unit/images/fc1_definition.png +0 -0
- open_fdd/air_handling_unit/images/fc1_report_screenshot_all.png +0 -0
- open_fdd/air_handling_unit/images/fc2_definition.png +0 -0
- open_fdd/air_handling_unit/images/fc3_definition.png +0 -0
- open_fdd/air_handling_unit/images/fc4_definition.png +0 -0
- open_fdd/air_handling_unit/images/fc5_definition.png +0 -0
- open_fdd/air_handling_unit/images/fc6_definition.png +0 -0
- open_fdd/air_handling_unit/images/fc7_definition.png +0 -0
- open_fdd/air_handling_unit/images/fc8_definition.png +0 -0
- open_fdd/air_handling_unit/images/fc9_definition.png +0 -0
- open_fdd/air_handling_unit/images/latex_generator.py +175 -0
- open_fdd/air_handling_unit/images/params.docx +0 -0
- open_fdd/air_handling_unit/images/params.pdf +0 -0
- open_fdd/air_handling_unit/images/plot_for_repo.png +0 -0
- open_fdd/air_handling_unit/reports/base_report.py +47 -0
- open_fdd/air_handling_unit/reports/report_fc7.py +3 -1
- open_fdd/tests/ahu/test_ahu_fc1.py +18 -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 +2 -2
- 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.1.dist-info → open_fdd-0.1.4.dist-info}/METADATA +34 -5
- open_fdd-0.1.4.dist-info/RECORD +82 -0
- open_fdd-0.1.1.dist-info/RECORD +0 -59
- {open_fdd-0.1.1.dist-info → open_fdd-0.1.4.dist-info}/LICENSE +0 -0
- {open_fdd-0.1.1.dist-info → open_fdd-0.1.4.dist-info}/WHEEL +0 -0
- {open_fdd-0.1.1.dist-info → open_fdd-0.1.4.dist-info}/top_level.txt +0 -0
@@ -4,6 +4,13 @@ import pandas as pd
|
|
4
4
|
|
5
5
|
|
6
6
|
class HelperUtils:
|
7
|
+
|
8
|
+
def __init__(self):
|
9
|
+
self.config_dict = None
|
10
|
+
|
11
|
+
def set_config_dict(self, config_dict):
|
12
|
+
self.config_dict = config_dict
|
13
|
+
|
7
14
|
def float_int_check_err(self, col):
|
8
15
|
return SharedUtils.float_int_check_err(col)
|
9
16
|
|
@@ -22,51 +29,33 @@ class HelperUtils:
|
|
22
29
|
def apply_rolling_average_if_needed(self, df, freq="1min", rolling_window="5min"):
|
23
30
|
return SharedUtils.apply_rolling_average_if_needed(df, freq, rolling_window)
|
24
31
|
|
32
|
+
def validate_config(self, required_columns):
|
33
|
+
"""
|
34
|
+
Check if all required columns are present and not None in the config dictionary.
|
35
|
+
"""
|
36
|
+
if not self.config_dict:
|
37
|
+
raise ValueError("Config dictionary is not set.")
|
38
|
+
return all(self.config_dict.get(col) is not None for col in required_columns)
|
39
|
+
|
25
40
|
def process_all_faults(self, df, config_dict):
|
26
|
-
#
|
27
|
-
|
41
|
+
# Set the config dictionary
|
42
|
+
self.set_config_dict(config_dict)
|
43
|
+
|
44
|
+
from open_fdd.air_handling_unit.faults import (
|
28
45
|
FaultConditionOne,
|
29
|
-
)
|
30
|
-
from open_fdd.air_handling_unit.faults.fault_condition_two import (
|
31
46
|
FaultConditionTwo,
|
32
|
-
)
|
33
|
-
from open_fdd.air_handling_unit.faults.fault_condition_three import (
|
34
47
|
FaultConditionThree,
|
35
|
-
)
|
36
|
-
from open_fdd.air_handling_unit.faults.fault_condition_four import (
|
37
48
|
FaultConditionFour,
|
38
|
-
)
|
39
|
-
from open_fdd.air_handling_unit.faults.fault_condition_five import (
|
40
49
|
FaultConditionFive,
|
41
|
-
)
|
42
|
-
from open_fdd.air_handling_unit.faults.fault_condition_six import (
|
43
50
|
FaultConditionSix,
|
44
|
-
)
|
45
|
-
from open_fdd.air_handling_unit.faults.fault_condition_seven import (
|
46
51
|
FaultConditionSeven,
|
47
|
-
)
|
48
|
-
from open_fdd.air_handling_unit.faults.fault_condition_eight import (
|
49
52
|
FaultConditionEight,
|
50
|
-
)
|
51
|
-
from open_fdd.air_handling_unit.faults.fault_condition_nine import (
|
52
53
|
FaultConditionNine,
|
53
|
-
)
|
54
|
-
from open_fdd.air_handling_unit.faults.fault_condition_ten import (
|
55
54
|
FaultConditionTen,
|
56
|
-
)
|
57
|
-
from open_fdd.air_handling_unit.faults.fault_condition_eleven import (
|
58
55
|
FaultConditionEleven,
|
59
|
-
)
|
60
|
-
from open_fdd.air_handling_unit.faults.fault_condition_twelve import (
|
61
56
|
FaultConditionTwelve,
|
62
|
-
)
|
63
|
-
from open_fdd.air_handling_unit.faults.fault_condition_thirteen import (
|
64
57
|
FaultConditionThirteen,
|
65
|
-
)
|
66
|
-
from open_fdd.air_handling_unit.faults.fault_condition_fourteen import (
|
67
58
|
FaultConditionFourteen,
|
68
|
-
)
|
69
|
-
from open_fdd.air_handling_unit.faults.fault_condition_fifteen import (
|
70
59
|
FaultConditionFifteen,
|
71
60
|
)
|
72
61
|
|
@@ -75,112 +64,325 @@ class HelperUtils:
|
|
75
64
|
# Apply rolling average if needed
|
76
65
|
df = self.apply_rolling_average_if_needed(df)
|
77
66
|
|
78
|
-
# Initialize Fault Condition Classes
|
79
|
-
fc1 =
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
67
|
+
# Initialize Fault Condition Classes with necessary checks
|
68
|
+
fc1 = None
|
69
|
+
if self.validate_config(
|
70
|
+
["DUCT_STATIC_COL", "DUCT_STATIC_SETPOINT_COL", "SUPPLY_VFD_SPEED_COL"]
|
71
|
+
):
|
72
|
+
print("Info: Running fc1")
|
73
|
+
fc1 = FaultConditionOne(config_dict)
|
74
|
+
else:
|
75
|
+
print("Info: Skipping fc1")
|
76
|
+
|
77
|
+
sys.stdout.flush()
|
78
|
+
|
79
|
+
fc2 = None
|
80
|
+
if self.validate_config(
|
81
|
+
["SUPPLY_VFD_SPEED_COL", "MAT_COL", "OAT_COL", "SAT_COL", "RAT_COL"]
|
82
|
+
):
|
83
|
+
print("Info: Running fc2 Go!")
|
84
|
+
fc2 = FaultConditionTwo(config_dict)
|
85
|
+
else:
|
86
|
+
print("Info: Skipping fc2")
|
87
|
+
|
88
|
+
sys.stdout.flush()
|
89
|
+
|
90
|
+
fc3 = None
|
91
|
+
if self.validate_config(
|
92
|
+
["SUPPLY_VFD_SPEED_COL", "MAT_COL", "OAT_COL", "SAT_COL", "RAT_COL"]
|
93
|
+
):
|
94
|
+
print("Info: Running fc3 Go!")
|
95
|
+
fc3 = FaultConditionThree(config_dict)
|
96
|
+
else:
|
97
|
+
print("Info: Skipping fc3")
|
98
|
+
|
99
|
+
sys.stdout.flush()
|
100
|
+
|
101
|
+
fc4 = None
|
102
|
+
if self.validate_config(
|
103
|
+
[
|
104
|
+
"SUPPLY_VFD_SPEED_COL",
|
105
|
+
"COOLING_SIG_COL",
|
106
|
+
"HEATING_SIG_COL",
|
107
|
+
"ECONOMIZER_SIG_COL",
|
108
|
+
]
|
109
|
+
):
|
110
|
+
print("Info: Running fc4 Go!")
|
111
|
+
fc4 = FaultConditionFour(config_dict)
|
112
|
+
else:
|
113
|
+
print("Info: Skipping fc4")
|
114
|
+
|
115
|
+
sys.stdout.flush()
|
116
|
+
|
117
|
+
fc5 = None
|
118
|
+
if self.validate_config(
|
119
|
+
["SUPPLY_VFD_SPEED_COL", "HEATING_SIG_COL", "SAT_COL", "MAT_COL"]
|
120
|
+
):
|
121
|
+
print("Info: Running fc5 Go!")
|
122
|
+
fc5 = FaultConditionFive(config_dict)
|
123
|
+
else:
|
124
|
+
print("Info: Skipping fc5")
|
125
|
+
|
126
|
+
sys.stdout.flush()
|
127
|
+
|
93
128
|
fc6 = None
|
94
|
-
if
|
129
|
+
if self.validate_config(
|
130
|
+
[
|
131
|
+
"SUPPLY_VFD_SPEED_COL",
|
132
|
+
"COOLING_SIG_COL",
|
133
|
+
"HEATING_SIG_COL",
|
134
|
+
"ECONOMIZER_SIG_COL",
|
135
|
+
"SUPPLY_FAN_AIR_VOLUME_COL",
|
136
|
+
]
|
137
|
+
):
|
138
|
+
print("Info: Running fc6 Go!")
|
95
139
|
fc6 = FaultConditionSix(config_dict)
|
140
|
+
else:
|
141
|
+
print("Info: Skipping fc6")
|
142
|
+
|
143
|
+
sys.stdout.flush()
|
144
|
+
|
145
|
+
fc7 = None
|
146
|
+
if self.validate_config(
|
147
|
+
["SUPPLY_VFD_SPEED_COL", "SAT_COL", "SAT_SETPOINT_COL", "HEATING_SIG_COL"]
|
148
|
+
):
|
149
|
+
print("Info: Running fc7 Go!")
|
150
|
+
fc7 = FaultConditionSeven(config_dict)
|
151
|
+
else:
|
152
|
+
print("Info: Skipping fc7")
|
153
|
+
|
154
|
+
sys.stdout.flush()
|
155
|
+
|
156
|
+
fc8 = None
|
157
|
+
if self.validate_config(
|
158
|
+
[
|
159
|
+
"COOLING_SIG_COL",
|
160
|
+
"ECONOMIZER_SIG_COL",
|
161
|
+
"MAT_COL",
|
162
|
+
"SUPPLY_VFD_SPEED_COL",
|
163
|
+
"SAT_COL",
|
164
|
+
]
|
165
|
+
):
|
166
|
+
print("Info: Running fc8 Go!")
|
167
|
+
fc8 = FaultConditionEight(config_dict)
|
168
|
+
else:
|
169
|
+
print("Info: Skipping fc8")
|
170
|
+
|
171
|
+
sys.stdout.flush()
|
172
|
+
|
173
|
+
fc9 = None
|
174
|
+
if self.validate_config(
|
175
|
+
[
|
176
|
+
"OAT_COL",
|
177
|
+
"SUPPLY_VFD_SPEED_COL",
|
178
|
+
"SAT_COL",
|
179
|
+
"SAT_SETPOINT_COL",
|
180
|
+
"COOLING_SIG_COL",
|
181
|
+
"ECONOMIZER_SIG_COL",
|
182
|
+
]
|
183
|
+
):
|
184
|
+
print("Info: Running fc9 Go!")
|
185
|
+
fc9 = FaultConditionNine(config_dict)
|
186
|
+
else:
|
187
|
+
print("Info: Skipping fc9")
|
188
|
+
|
189
|
+
sys.stdout.flush()
|
190
|
+
|
191
|
+
fc10 = None
|
192
|
+
if self.validate_config(
|
193
|
+
[
|
194
|
+
"MAT_COL",
|
195
|
+
"OAT_COL",
|
196
|
+
"SUPPLY_VFD_SPEED_COL",
|
197
|
+
"COOLING_SIG_COL",
|
198
|
+
"ECONOMIZER_SIG_COL",
|
199
|
+
]
|
200
|
+
):
|
201
|
+
print("Info: Running fc10 Go!")
|
202
|
+
fc10 = FaultConditionTen(config_dict)
|
203
|
+
else:
|
204
|
+
print("Info: Skipping fc10")
|
205
|
+
|
206
|
+
sys.stdout.flush()
|
207
|
+
|
208
|
+
fc11 = None
|
209
|
+
if self.validate_config(
|
210
|
+
[
|
211
|
+
"OAT_COL",
|
212
|
+
"SUPPLY_VFD_SPEED_COL",
|
213
|
+
"COOLING_SIG_COL",
|
214
|
+
"ECONOMIZER_SIG_COL",
|
215
|
+
"SAT_SETPOINT_COL",
|
216
|
+
]
|
217
|
+
):
|
218
|
+
print("Info: Running fc11 Go!")
|
219
|
+
fc11 = FaultConditionEleven(config_dict)
|
220
|
+
else:
|
221
|
+
print("Info: Skipping fc11")
|
222
|
+
|
223
|
+
sys.stdout.flush()
|
224
|
+
|
225
|
+
fc12 = None
|
226
|
+
if self.validate_config(
|
227
|
+
[
|
228
|
+
"SUPPLY_VFD_SPEED_COL",
|
229
|
+
"ECONOMIZER_SIG_COL",
|
230
|
+
"COOLING_SIG_COL",
|
231
|
+
"SAT_COL",
|
232
|
+
"MAT_COL",
|
233
|
+
]
|
234
|
+
):
|
235
|
+
print("Info: Running fc12 Go!")
|
236
|
+
fc12 = FaultConditionTwelve(config_dict)
|
237
|
+
else:
|
238
|
+
print("Info: Skipping fc12")
|
239
|
+
|
240
|
+
sys.stdout.flush()
|
241
|
+
|
242
|
+
fc13 = None
|
243
|
+
if self.validate_config(
|
244
|
+
[
|
245
|
+
"SUPPLY_VFD_SPEED_COL",
|
246
|
+
"ECONOMIZER_SIG_COL",
|
247
|
+
"COOLING_SIG_COL",
|
248
|
+
"SAT_SETPOINT_COL",
|
249
|
+
"SAT_COL",
|
250
|
+
]
|
251
|
+
):
|
252
|
+
print("Info: Running fc13 Go!")
|
253
|
+
fc13 = FaultConditionThirteen(config_dict)
|
254
|
+
else:
|
255
|
+
print("Info: Skipping fc13")
|
256
|
+
|
257
|
+
sys.stdout.flush()
|
96
258
|
|
97
|
-
# Optionally initialize Fault Condition Fourteen
|
98
259
|
fc14 = None
|
99
260
|
if (
|
100
261
|
config_dict.get("COOLING_SIG_COL") is not None
|
101
262
|
and config_dict.get("CLG_COIL_LEAVE_TEMP_COL") is not None
|
102
263
|
):
|
264
|
+
print("Info: Running fc14 Go!")
|
103
265
|
fc14 = FaultConditionFourteen(config_dict)
|
266
|
+
else:
|
267
|
+
print("Info: Skipping fc14")
|
268
|
+
|
269
|
+
sys.stdout.flush()
|
104
270
|
|
105
|
-
# Optionally initialize Fault Condition Fifteen
|
106
271
|
fc15 = None
|
107
272
|
if (
|
108
273
|
config_dict.get("HTG_COIL_ENTER_TEMP_COL") is not None
|
109
274
|
and config_dict.get("HTG_COIL_LEAVE_TEMP_COL") is not None
|
110
275
|
):
|
276
|
+
print("Info: Running fc15 Go!")
|
111
277
|
fc15 = FaultConditionFifteen(config_dict)
|
278
|
+
else:
|
279
|
+
print("Info: Skipping fc15")
|
280
|
+
|
281
|
+
sys.stdout.flush()
|
112
282
|
|
113
283
|
# Apply fault conditions and calculate fault counts
|
114
|
-
df_fc1 = fc1.apply(df.copy())
|
115
|
-
|
284
|
+
df_fc1 = fc1.apply(df.copy()) if fc1 is not None else None
|
285
|
+
if df_fc1 is not None:
|
286
|
+
fault_counts["fc1_fault_sum"] = df_fc1["fc1_flag"].sum()
|
116
287
|
|
117
|
-
df_fc2 = fc2.apply(df.copy())
|
118
|
-
|
288
|
+
df_fc2 = fc2.apply(df.copy()) if fc2 is not None else None
|
289
|
+
if df_fc2 is not None:
|
290
|
+
fault_counts["fc2_fault_sum"] = df_fc2["fc2_flag"].sum()
|
119
291
|
|
120
|
-
df_fc3 = fc3.apply(df.copy())
|
121
|
-
|
292
|
+
df_fc3 = fc3.apply(df.copy()) if fc3 is not None else None
|
293
|
+
if df_fc3 is not None:
|
294
|
+
fault_counts["fc3_fault_sum"] = df_fc3["fc3_flag"].sum()
|
122
295
|
|
123
|
-
df_fc4 = fc4.apply(df.copy())
|
124
|
-
|
296
|
+
df_fc4 = fc4.apply(df.copy()) if fc4 is not None else pd.DataFrame()
|
297
|
+
if not df_fc4.empty:
|
298
|
+
fault_counts["fc4_fault_sum"] = df_fc4["fc4_flag"].sum()
|
125
299
|
|
126
|
-
df_fc5 = fc5.apply(df.copy())
|
127
|
-
|
300
|
+
df_fc5 = fc5.apply(df.copy()) if fc5 is not None else None
|
301
|
+
if df_fc5 is not None:
|
302
|
+
fault_counts["fc5_fault_sum"] = df_fc5["fc5_flag"].sum()
|
128
303
|
|
129
|
-
if fc6 is not None
|
130
|
-
|
304
|
+
df_fc6 = fc6.apply(df.copy()) if fc6 is not None else None
|
305
|
+
if df_fc6 is not None:
|
131
306
|
fault_counts["fc6_fault_sum"] = df_fc6["fc6_flag"].sum()
|
132
307
|
|
133
|
-
df_fc7 = fc7.apply(df.copy())
|
134
|
-
|
308
|
+
df_fc7 = fc7.apply(df.copy()) if fc7 is not None else None
|
309
|
+
if df_fc7 is not None:
|
310
|
+
fault_counts["fc7_fault_sum"] = df_fc7["fc7_flag"].sum()
|
135
311
|
|
136
|
-
df_fc8 = fc8.apply(df.copy())
|
137
|
-
|
312
|
+
df_fc8 = fc8.apply(df.copy()) if fc8 is not None else None
|
313
|
+
if df_fc8 is not None:
|
314
|
+
fault_counts["fc8_fault_sum"] = df_fc8["fc8_flag"].sum()
|
138
315
|
|
139
|
-
df_fc9 = fc9.apply(df.copy())
|
140
|
-
|
316
|
+
df_fc9 = fc9.apply(df.copy()) if fc9 is not None else None
|
317
|
+
if df_fc9 is not None:
|
318
|
+
fault_counts["fc9_fault_sum"] = df_fc9["fc9_flag"].sum()
|
141
319
|
|
142
|
-
df_fc10 = fc10.apply(df.copy())
|
143
|
-
|
320
|
+
df_fc10 = fc10.apply(df.copy()) if fc10 is not None else None
|
321
|
+
if df_fc10 is not None:
|
322
|
+
fault_counts["fc10_fault_sum"] = df_fc10["fc10_flag"].sum()
|
144
323
|
|
145
|
-
df_fc11 = fc11.apply(df.copy())
|
146
|
-
|
324
|
+
df_fc11 = fc11.apply(df.copy()) if fc11 is not None else None
|
325
|
+
if df_fc11 is not None:
|
326
|
+
fault_counts["fc11_fault_sum"] = df_fc11["fc11_flag"].sum()
|
147
327
|
|
148
|
-
df_fc12 = fc12.apply(df.copy())
|
149
|
-
|
328
|
+
df_fc12 = fc12.apply(df.copy()) if fc12 is not None else None
|
329
|
+
if df_fc12 is not None:
|
330
|
+
fault_counts["fc12_fault_sum"] = df_fc12["fc12_flag"].sum()
|
150
331
|
|
151
|
-
df_fc13 = fc13.apply(df.copy())
|
152
|
-
|
332
|
+
df_fc13 = fc13.apply(df.copy()) if fc13 is not None else None
|
333
|
+
if df_fc13 is not None:
|
334
|
+
fault_counts["fc13_fault_sum"] = df_fc13["fc13_flag"].sum()
|
153
335
|
|
154
|
-
if fc14 is not None
|
155
|
-
|
336
|
+
df_fc14 = fc14.apply(df.copy()) if fc14 is not None else None
|
337
|
+
if df_fc14 is not None:
|
156
338
|
fault_counts["fc14_fault_sum"] = df_fc14["fc14_flag"].sum()
|
157
339
|
|
158
|
-
if fc15 is not None
|
159
|
-
|
340
|
+
df_fc15 = fc15.apply(df.copy()) if fc15 is not None else None
|
341
|
+
if df_fc15 is not None:
|
160
342
|
fault_counts["fc15_fault_sum"] = df_fc15["fc15_flag"].sum()
|
161
343
|
|
162
344
|
# Combine fault condition results
|
163
|
-
df_combined = df_fc1.copy()
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
345
|
+
df_combined = df_fc1.copy() if df_fc1 is not None else df.copy()
|
346
|
+
|
347
|
+
if df_fc2 is not None:
|
348
|
+
df_combined["fc2_flag"] = df_fc2["fc2_flag"]
|
349
|
+
|
350
|
+
if df_fc3 is not None:
|
351
|
+
df_combined["fc3_flag"] = df_fc3["fc3_flag"]
|
352
|
+
|
353
|
+
# Skip combining df_fc4 since it is resampled
|
354
|
+
|
355
|
+
if df_fc5 is not None:
|
356
|
+
df_combined["fc5_flag"] = df_fc5["fc5_flag"]
|
168
357
|
|
169
|
-
if
|
358
|
+
if df_fc6 is not None:
|
170
359
|
df_combined["fc6_flag"] = df_fc6["fc6_flag"]
|
171
360
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
361
|
+
if df_fc7 is not None:
|
362
|
+
df_combined["fc7_flag"] = df_fc7["fc7_flag"]
|
363
|
+
|
364
|
+
if df_fc8 is not None:
|
365
|
+
df_combined["fc8_flag"] = df_fc8["fc8_flag"]
|
366
|
+
|
367
|
+
if df_fc9 is not None:
|
368
|
+
df_combined["fc9_flag"] = df_fc9["fc9_flag"]
|
369
|
+
|
370
|
+
if df_fc10 is not None:
|
371
|
+
df_combined["fc10_flag"] = df_fc10["fc10_flag"]
|
372
|
+
|
373
|
+
if df_fc11 is not None:
|
374
|
+
df_combined["fc11_flag"] = df_fc11["fc11_flag"]
|
375
|
+
|
376
|
+
if df_fc12 is not None:
|
377
|
+
df_combined["fc12_flag"] = df_fc12["fc12_flag"]
|
378
|
+
|
379
|
+
if df_fc13 is not None:
|
380
|
+
df_combined["fc13_flag"] = df_fc13["fc13_flag"]
|
179
381
|
|
180
|
-
if
|
382
|
+
if df_fc14 is not None:
|
181
383
|
df_combined["fc14_flag"] = df_fc14["fc14_flag"]
|
182
384
|
|
183
|
-
if
|
385
|
+
if df_fc15 is not None:
|
184
386
|
df_combined["fc15_flag"] = df_fc15["fc15_flag"]
|
185
387
|
|
186
388
|
# Save fault counts to CSV
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|