Skip to content

Commit

Permalink
Fix: make sure that precip_models variable has the correct length
Browse files Browse the repository at this point in the history
Fix to ensure that the `_check_inputs` function in `/blending/steps.py` looks for the correct `precip_models` length when a list of timesteps instead of an integer is provided.
  • Loading branch information
RubenImhoff committed Jul 3, 2024
1 parent 3121cbf commit 192837b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pysteps/blending/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,7 @@ def _check_inputs(
if isinstance(timesteps, list) and not sorted(timesteps) == timesteps:
raise ValueError("timesteps is not in ascending order")
if isinstance(timesteps, list):
if precip_models.shape[1] != len(timesteps) + 1:
if precip_models.shape[1] != timesteps[-1] + 1:

Check warning on line 1811 in pysteps/blending/steps.py

View check run for this annotation

Codecov / codecov/patch

pysteps/blending/steps.py#L1811

Added line #L1811 was not covered by tests
raise ValueError(
"precip_models does not contain sufficient lead times for this forecast"
)
Expand Down

0 comments on commit 192837b

Please sign in to comment.