Skip to content

Commit

Permalink
test errors fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leijerry888 committed Nov 19, 2024
1 parent 50abe47 commit 08c945e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
11 changes: 5 additions & 6 deletions constrain/api/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ def configure(
logging.error("The specificed output directory does not exist.")
return None

if time_series_csv_export_name is not None:
if time_series_csv_export_name is None:
self.time_series_csv_export_name = time_series_csv_export_name
else:
if not isinstance(time_series_csv_export_name, str):
logging.error("time_series_csv_export_name should be a string.")
return None
if time_series_csv_export_name[-4:] == ".csv":
self.time_series_csv_export_name = time_series_csv_export_name[:-4]

# TODO: lib_items_path now only needed when user provides their own lib items, and the default lib items from
# ConStrain will be loaded without user inputs. This is no longer an error to be logged.
Expand Down Expand Up @@ -145,11 +149,6 @@ def configure(
return None

self.output_path = output_path

self.time_series_csv_export_name = time_series_csv_export_name
if time_series_csv_export_name[-4:] == ".csv":
self.time_series_csv_export_name = time_series_csv_export_name[:-4]

self.lib_items_path = lib_items_path
self.lib_classes_py_file = lib_classes_py_file
self.plot_option = plot_option
Expand Down
4 changes: 3 additions & 1 deletion constrain/library/AppendixGHVACSystemFanOperation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
ASHRAE 90.1-2022
ASHRAE 90.1-2022
### Description
Section G3.1.4 HVAC System Fan Schedules
Expand Down Expand Up @@ -103,3 +103,5 @@ def verify(self):
self.result = self.df.apply(
lambda d: self.hvac_system_fan_operation(d), axis=1
)
else:
self.result = self.df.apply(lambda d: "Untested", axis=1)
11 changes: 10 additions & 1 deletion tests/test_lib_automatic_oa_damper_controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,16 @@ def test_automatic_oa_damper_control(self):
results = list(
run_test_verification_with_data("AutomaticOADamperControl", df).result
)
expected_results = [np.nan, True, False, False, False, np.nan, np.nan, np.nan]
expected_results = [
"Untested",
True,
False,
False,
False,
"Untested",
"Untested",
"Untested",
]

# Perform verification
for i in range(len(data[0])):
Expand Down

0 comments on commit 08c945e

Please sign in to comment.