Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
pulkkins committed Jan 14, 2021
1 parent c46a001 commit b4198d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pysteps/extrapolation/semilagrangian.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def extrapolate(
if velocity.ndim != 3:
raise ValueError("velocity must be a three-dimensional array")

if precip is not None and not allow_nonfinite_values:
if np.any(~np.isfinite(precip)):
if not allow_nonfinite_values:
if precip is not None and np.any(~np.isfinite(precip)):
raise ValueError("precip contains non-finite values")

if np.any(~np.isfinite(velocity)):
Expand Down

0 comments on commit b4198d3

Please sign in to comment.