Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bbartling committed Sep 2, 2024
1 parent 720e112 commit 902042f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
5 changes: 2 additions & 3 deletions open_fdd/air_handling_unit/faults/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2072,7 +2072,6 @@ def apply(self, df: pd.DataFrame) -> pd.DataFrame:
raise e



class FaultConditionSixteen(FaultCondition):
"""Class provides the definitions for Fault Condition 16.
ERV Ineffective Process based on outdoor air temperature ranges.
Expand Down Expand Up @@ -2181,10 +2180,10 @@ def calculate_erv_efficiency(self, df: pd.DataFrame) -> pd.DataFrame:
# Calculate the temperature differences
delta_temp_oa = df[self.erv_oat_leaving_col] - df[self.erv_oat_enter_col]
delta_temp_ea = df[self.erv_eat_enter_col] - df[self.erv_oat_enter_col]

# Use the absolute value to handle both heating and cooling applications
df["erv_efficiency_oa"] = np.abs(delta_temp_oa) / np.abs(delta_temp_ea)

return df

def apply(self, df: pd.DataFrame) -> pd.DataFrame:
Expand Down
15 changes: 8 additions & 7 deletions open_fdd/air_handling_unit/reports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ def create_plot(self, df: pd.DataFrame):
print("summary statistics ")
print(df["erv_efficiency_oa"].describe())
print("=" * 50)

sys.stdout.flush()

# Create the plot with four subplots
Expand All @@ -934,16 +934,19 @@ def create_plot(self, df: pd.DataFrame):

# Plot ERV Exhaust Air Side Temps
ax2.plot(df.index, df[self.erv_eat_enter_col], label="Enter", color="red")
ax2.plot(df.index, df[self.erv_eat_leaving_col], label="Leaving", color="purple")
ax2.plot(
df.index, df[self.erv_eat_leaving_col], label="Leaving", color="purple"
)
ax2.legend(loc="best")
ax2.set_ylabel("ERV Exhaust Air Side Temps °F")


# Plot ERV Efficiency
ax3.plot(df.index, df["erv_efficiency_oa"], label="ERV Efficiency OA", color="b")
ax3.plot(
df.index, df["erv_efficiency_oa"], label="ERV Efficiency OA", color="b"
)
ax3.legend(loc="best")
ax3.set_ylabel("ERV Efficiency OA")

# Plot Fault Flags
ax4.plot(df.index, df[self.fault_col], label="Fault", color="k")
ax4.set_xlabel("Date")
Expand All @@ -970,14 +973,12 @@ def summarize_fault_times(self, df: pd.DataFrame) -> dict:
"flag_true_erv_oat_leave_temp": round(
df[self.erv_oat_leaving_col].where(df[self.fault_col] == 1).mean(), 2
),

"flag_true_erv_eat_enter_temp": round(
df[self.erv_eat_enter_col].where(df[self.fault_col] == 1).mean(), 2
),
"flag_true_erv_eat_leave_temp": round(
df[self.erv_eat_leaving_col].where(df[self.fault_col] == 1).mean(), 2
),

"hours_motor_runtime": round(
(delta * df[self.supply_vfd_speed_col].gt(0.01).astype(int)).sum()
/ pd.Timedelta(hours=1),
Expand Down

0 comments on commit 902042f

Please sign in to comment.