Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Force convert into float (np.nan if fails) #126

Merged
merged 3 commits into from
Apr 23, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Return invalid description instead of raising exception
This will allow for invalid AQIs (e.g., np.nan) to be passed without
raising exception. This can better handle cases where WAQI data is out of bound.
I've personally seen cases of AQI values '999' and '-'.
  • Loading branch information
lahdjirayhan committed Apr 23, 2022
commit bb34bd285170fffda1ea9383003b0dfab6fdce58
6 changes: 2 additions & 4 deletions src/ozone/ozone.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,8 @@ def _AQI_meaning(self, aqi: float) -> Tuple[str, str]:
"Health alert: everyone may experience more serious health effects."
)
else:
raise Exception(
f"{aqi} is not valid air quality index value. "
"Should be between 0 to 500."
)
AQI_meaning = "Invalid AQI value"
Milind220 marked this conversation as resolved.
Show resolved Hide resolved
AQI_health_implications = "Invalid AQI value"

return AQI_meaning, AQI_health_implications

Expand Down