Skip to content

Commit

Permalink
lint: ankle_draft.py output lower case
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoTartarini committed Dec 18, 2024
1 parent 82d13de commit 027b7e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions pythermalcomfort/models/ankle_draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class AnkleDraft:
Attributes
----------
PPD_ad : float
ppd_ad : float
Predicted Percentage of Dissatisfied occupants with ankle draft, [%].
Acceptability : bool
acceptability : bool
Indicates if the air speed at the ankle level is acceptable according to ASHRAE 55 2020 standard.
"""

PPD_ad: Union[float, npt.ArrayLike]
Acceptability: Union[bool, npt.ArrayLike]
ppd_ad: Union[float, npt.ArrayLike]
acceptability: Union[bool, npt.ArrayLike]

def __getitem__(self, item):
return getattr(self, item)
Expand Down Expand Up @@ -130,7 +130,7 @@ def ankle_draft(
from pythermalcomfort.models import ankle_draft
results = ankle_draft(25, 25, 0.2, 50, 1.2, 0.5, 0.3, units="SI")
print(results)
# AnkleDraft(PPD_ad=18.5, Acceptability=True)
# AnkleDraft(ppd_ad=18.5, acceptability=True)
"""
# Validate inputs using the AnkleDraftInputs class
AnkleDraftInputs(
Expand Down Expand Up @@ -170,7 +170,7 @@ def ankle_draft(
1,
)
acceptability = ppd_val <= 20
return AnkleDraft(PPD_ad=ppd_val, Acceptability=acceptability)
return AnkleDraft(ppd_ad=ppd_val, acceptability=acceptability)


if __name__ == "__main__":
Expand Down
10 changes: 5 additions & 5 deletions tests/test_ankle_draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_ankle_draft(get_test_url, retrieve_data):
inputs = entry["inputs"]
outputs = entry["outputs"]
result = ankle_draft(**inputs)

validate_result(result, outputs, tolerance)


Expand All @@ -30,10 +30,10 @@ def test_ankle_draft_invalid_input_range():

def test_ankle_draft_outside_ashrae_range():
r = ankle_draft(50, 25, 0.1, 50, 1.2, 0.5, 0.1)
assert np.isnan(r.PPD_ad)
assert np.isnan(r.ppd_ad)

r = ankle_draft([50, 45], 25, 0.1, 50, 1.2, 0.5, 0.1)
assert np.all(np.isnan(r.PPD_ad))
assert np.all(np.isnan(r.ppd_ad))


def test_ankle_draft_list_inputs():
Expand All @@ -48,8 +48,8 @@ def test_ankle_draft_list_inputs():
units="SI",
)
assert isinstance(results, AnkleDraft)
assert len(results.PPD_ad) == 3
assert len(results.Acceptability) == 3
assert len(results.ppd_ad) == 3
assert len(results.acceptability) == 3


def test_ankle_draft_invalid_list_inputs():
Expand Down

0 comments on commit 027b7e9

Please sign in to comment.