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

24 hour precip diff issue #3989

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
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
6 changes: 3 additions & 3 deletions api/app/weather_models/precip_rdps_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@
"""
(yesterday_key, today_key) = get_raster_keys_to_diff(timestamp)
(day_data, day_geotransform, day_projection) = await read_into_memory(today_key)
if day_data is None:
raise ValueError("No precip raster data for today_key: %s" % today_key)
if yesterday_key is None:
if day_data is None:
raise ValueError("No precip raster data for %s" % today_key)
return (day_data, day_geotransform, day_projection)

yesterday_time = timestamp - timedelta(days=1)
(yesterday_data, _, _) = await read_into_memory(yesterday_key)
if yesterday_data is None:
raise ValueError("No precip raster data for %s" % yesterday_key)
raise ValueError("No precip raster data for yesterday_key: %s" % yesterday_key)

Check warning on line 102 in api/app/weather_models/precip_rdps_model.py

View check run for this annotation

Codecov / codecov/patch

api/app/weather_models/precip_rdps_model.py#L102

Added line #L102 was not covered by tests

later_precip = TemporalPrecip(timestamp=timestamp, precip_amount=day_data)
earlier_precip = TemporalPrecip(timestamp=yesterday_time, precip_amount=yesterday_data)
Expand Down
Loading