open-fdd 0.1.6__py3-none-any.whl → 0.1.8__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 +632 -1398
- open_fdd/air_handling_unit/faults/helper_utils.py +3 -0
- open_fdd/air_handling_unit/faults/shared_utils.py +16 -1
- open_fdd/air_handling_unit/reports/__init__.py +23 -10
- open_fdd/chiller_plant/__init__.py +0 -0
- open_fdd/chiller_plant/faults/__init__.py +2280 -0
- open_fdd/tests/ahu/test_ahu_fc1.py +1 -0
- open_fdd/tests/ahu/test_ahu_fc11.py +22 -30
- open_fdd/tests/ahu/test_ahu_fc12.py +54 -15
- open_fdd/tests/ahu/test_ahu_fc13.py +13 -5
- open_fdd/tests/ahu/test_ahu_fc14.py +9 -0
- open_fdd/tests/ahu/test_ahu_fc15.py +13 -1
- open_fdd/tests/ahu/test_ahu_fc16.py +33 -10
- open_fdd/tests/chiller/__init__.py +0 -0
- open_fdd/tests/chiller/test_chiller_fc1.py +122 -0
- open_fdd/tests/chiller/test_chiller_fc2.py +95 -0
- open_fdd-0.1.8.dist-info/METADATA +136 -0
- open_fdd-0.1.8.dist-info/RECORD +36 -0
- {open_fdd-0.1.6.dist-info → open_fdd-0.1.8.dist-info}/WHEEL +1 -1
- open_fdd-0.1.6.dist-info/METADATA +0 -95
- open_fdd-0.1.6.dist-info/RECORD +0 -31
- {open_fdd-0.1.6.dist-info → open_fdd-0.1.8.dist-info}/LICENSE +0 -0
- {open_fdd-0.1.6.dist-info → open_fdd-0.1.8.dist-info}/top_level.txt +0 -0
@@ -11,6 +11,9 @@ class HelperUtils:
|
|
11
11
|
def set_config_dict(self, config_dict):
|
12
12
|
self.config_dict = config_dict
|
13
13
|
|
14
|
+
def clean_nan_values(self, df):
|
15
|
+
return SharedUtils.clean_nan_values(df)
|
16
|
+
|
14
17
|
def float_int_check_err(self, col):
|
15
18
|
return SharedUtils.float_int_check_err(col)
|
16
19
|
|
@@ -48,8 +48,10 @@ class SharedUtils:
|
|
48
48
|
"""
|
49
49
|
|
50
50
|
print(
|
51
|
-
"Warning: If data has a one minute or less sampling
|
51
|
+
"Warning: If data has a one minute or less sampling \n"
|
52
|
+
"frequency a rolling average will be automatically applied"
|
52
53
|
)
|
54
|
+
|
53
55
|
sys.stdout.flush()
|
54
56
|
|
55
57
|
time_diff = df.index.to_series().diff().iloc[1:]
|
@@ -73,3 +75,16 @@ class SharedUtils:
|
|
73
75
|
)
|
74
76
|
sys.stdout.flush()
|
75
77
|
return df
|
78
|
+
|
79
|
+
@staticmethod
|
80
|
+
def clean_nan_values(df: pd.DataFrame) -> pd.DataFrame:
|
81
|
+
for col in df.columns:
|
82
|
+
if df[col].isnull().any():
|
83
|
+
print(f"NaN values found in column: {col}")
|
84
|
+
|
85
|
+
# Remove rows with any NaN values, then forward and backfill
|
86
|
+
df = df.dropna().ffill().bfill()
|
87
|
+
print("DataFrame has been cleaned for NaNs")
|
88
|
+
print("and has also been forward and backfilled.")
|
89
|
+
sys.stdout.flush()
|
90
|
+
return df
|
@@ -914,16 +914,8 @@ class FaultCodeSixteenReport(BaseFaultReport):
|
|
914
914
|
# Calculate the efficiency before plotting using FaultConditionSixteen method
|
915
915
|
df = self.fc16.calculate_erv_efficiency(df)
|
916
916
|
|
917
|
-
|
918
|
-
|
919
|
-
print("summary statistics ")
|
920
|
-
print(df["erv_efficiency_oa"].describe())
|
921
|
-
print("=" * 50)
|
922
|
-
|
923
|
-
sys.stdout.flush()
|
924
|
-
|
925
|
-
# Create the plot with four subplots
|
926
|
-
fig, (ax1, ax2, ax3, ax4) = plt.subplots(4, 1, figsize=(25, 10))
|
917
|
+
# Create the plot with five subplots
|
918
|
+
fig, (ax1, ax2, ax3, ax4, ax5) = plt.subplots(5, 1, figsize=(25, 14))
|
927
919
|
fig.suptitle("Fault Conditions 16 Plot")
|
928
920
|
|
929
921
|
# Plot ERV Outdoor Air Side Temps
|
@@ -953,6 +945,27 @@ class FaultCodeSixteenReport(BaseFaultReport):
|
|
953
945
|
ax4.set_ylabel("Fault Flags")
|
954
946
|
ax4.legend(loc="best")
|
955
947
|
|
948
|
+
# New Plot: Compare Distribution of OAT (Overall vs Fault True)
|
949
|
+
fault_true_df = df[df[self.fault_col] == 1]
|
950
|
+
data_to_plot = [
|
951
|
+
df[self.erv_oat_enter_col].dropna(), # Overall OAT
|
952
|
+
fault_true_df[self.erv_oat_enter_col].dropna(), # OAT when Fault is True
|
953
|
+
]
|
954
|
+
ax5.boxplot(
|
955
|
+
data_to_plot,
|
956
|
+
vert=False,
|
957
|
+
patch_artist=True,
|
958
|
+
labels=["Overall OAT", "OAT when Fault 16 is True"],
|
959
|
+
boxprops=dict(facecolor="lightblue"),
|
960
|
+
medianprops=dict(color="red"),
|
961
|
+
showmeans=True,
|
962
|
+
meanline=True,
|
963
|
+
meanprops=dict(color="green"),
|
964
|
+
)
|
965
|
+
ax5.set_xlabel("Outside Air Temperature (°F)")
|
966
|
+
ax5.set_title("Comparison of OAT Distribution")
|
967
|
+
ax5.grid(True)
|
968
|
+
|
956
969
|
plt.tight_layout(rect=[0, 0.03, 1, 0.95])
|
957
970
|
plt.show()
|
958
971
|
plt.close()
|
File without changes
|