-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from TwinGan/release_ver.1.0
Convert old unit test to url type
- Loading branch information
Showing
25 changed files
with
673 additions
and
1,133 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
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 |
---|---|---|
@@ -1,10 +1,24 @@ | ||
import numpy as np | ||
|
||
from pythermalcomfort.models import a_pmv | ||
|
||
|
||
def test_a_pmv(): | ||
np.testing.assert_equal( | ||
a_pmv([24, 30], 30, vr=0.22, rh=50, met=1.4, clo=0.5, a_coefficient=0.293), | ||
[0.48, 1.09], | ||
) | ||
def test_a_pmv(get_a_pmv_url, retrieve_data, is_equal): | ||
reference_table = retrieve_data(get_a_pmv_url) | ||
for entry in reference_table["data"]: | ||
inputs = entry["inputs"] | ||
outputs = entry["outputs"] | ||
result = a_pmv( | ||
inputs["tdb"], | ||
inputs["tr"], | ||
inputs["vr"], | ||
inputs["rh"], | ||
inputs["met"], | ||
inputs["clo"], | ||
inputs["a_coefficient"], | ||
) | ||
try: | ||
assert is_equal(result, outputs["a_pmv"]) | ||
except AssertionError as e: | ||
print( | ||
f"Assertion failed for a_pmv. Expected {outputs}, got {result}, inputs={inputs}\nError: {str(e)}" | ||
) | ||
raise |
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
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
Oops, something went wrong.