-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add outdoor air damper verification for configuration with return fan…
… with airflow tracking.
- Loading branch information
Showing
4 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/library/G36OutdoorAirDamperPositionForReturnFanAirflowTracking.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
""" | ||
G36 2021 | ||
### Description | ||
Section 5.16.2.3 | ||
### Verification Logic | ||
``` | ||
if abs(oa_p - max_oa_p) < oa_p_tol | ||
pass | ||
else | ||
fail | ||
end | ||
``` | ||
""" | ||
|
||
import pandas as pd | ||
from checklib import RuleCheckBase | ||
import numpy as np | ||
|
||
|
||
class G36OutdoorAirDamperPositionForReturnFanAirflowTracking(RuleCheckBase): | ||
points = [ | ||
"oa_p", | ||
"max_oa_p", | ||
"oa_p_tol", | ||
] | ||
|
||
def outdoor_air_damper(self, data): | ||
if abs(data["oa_p"] - data["max_oa_p"]) < data["oa_p_tol"]: | ||
return True | ||
else: | ||
return False | ||
|
||
def verify(self): | ||
self.result = self.df.apply(lambda d: self.outdoor_air_damper(d), axis=1) | ||
|
||
def check_bool(self): | ||
if len(self.result[self.result == False] > 0): | ||
return False | ||
else: | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
tests/TestG36OutdoorAirDamperPositionForReturnFanAirflowTracking.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import unittest, sys | ||
|
||
sys.path.append("./src") | ||
from lib_unit_test_runner import * | ||
from library import * | ||
|
||
import pandas as pd | ||
import numpy as np | ||
|
||
|
||
class TestG36OutdoorAirDamperPositionForReliefDamperOrFanConfig(unittest.TestCase): | ||
def test_return_air_damper_positiong(self): | ||
points = [ | ||
"oa_p", | ||
"max_oa_p", | ||
"oa_p_tol", | ||
] | ||
data = [ | ||
[0.1, 1, 0.05], # False | ||
[0.98, 1, 0.05], # True | ||
] | ||
|
||
df = pd.DataFrame(data, columns=points) | ||
|
||
verification_obj = run_test_verification_with_data( | ||
"G36OutdoorAirDamperPositionForReturnFanAirflowTracking", df | ||
) | ||
|
||
results = pd.Series(list(verification_obj.result)) | ||
expected_results = pd.Series([False, True]) | ||
self.assertTrue(results.equals(expected_results)) | ||
|
||
binary_result = verification_obj.check_bool() | ||
self.assertFalse(binary_result) |