Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Dylan H. Morris <[email protected]>
  • Loading branch information
sbidari and dylanhmorris authored Dec 30, 2024
1 parent 00ed69a commit 73b3128
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pyrenew/convolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ def daily_to_weekly(
input_data_first_dow : int
First day of the week in the input timeseries `daily_values`.
An integer between 0 and 6, inclusive (0 for Monday, 6 for Sunday).
If first_dow is not 0, the incomplete first
If `input_data_first_dow` does not match `week_start_dow`, the incomplete first
week is ignored and weekly values starting
from second week is returned. Defaults to 0.
from the second week are returned. Defaults to 0.
week_start_dow : int
The desired starting day of the week for the output weekly aggregation.
An integer between 0 and 6, inclusive. Defaults to 0 (Monday).
Expand All @@ -249,11 +249,11 @@ def daily_to_weekly(
with the first full week available.
"""
if input_data_first_dow < 0 or input_data_first_dow > 6:
raise ValueError("First day of the week must be between 0 and 6.")
raise ValueError("First day of the week for input timeseries must be between 0 and 6.")

if week_start_dow < 0 or week_start_dow > 6:
raise ValueError(
"First day of aggregated data must be between 0 and 6."
"Week start date for output aggregated values must be between 0 and 6."
)

if input_data_first_dow != week_start_dow:
Expand Down
2 changes: 1 addition & 1 deletion test/test_daily_to_weekly.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_daily_to_weekly_missing_daily_values():
aggregates the available daily values
into weekly values when there are
fewer daily values than required for
complete weekly totals.
complete weekly totals in the final week.
"""
daily_values = jnp.arange(1, 10)
result = daily_to_weekly(daily_values, input_data_first_dow=0)
Expand Down

0 comments on commit 73b3128

Please sign in to comment.