File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -473,7 +473,7 @@ def set_max_vel(max_vel: Optional[float], max_abs_model_vel: float) -> float:
473473 """Sets or validates the maximum velocity for the CFL condition.
474474
475475 Args:
476- max_vel: The user-specified maximum velocity. If None, `max_model_vel `
476+ max_vel: The user-specified maximum velocity. If None, `max_abs_model_vel `
477477 is used.
478478 max_abs_model_vel: The maximum absolute velocity present in the model.
479479
@@ -494,11 +494,11 @@ def set_max_vel(max_vel: Optional[float], max_abs_model_vel: float) -> float:
494494 max_abs_model_vel = float (max_abs_model_vel )
495495 except (TypeError , ValueError ) as e :
496496 raise TypeError ("max_abs_model_vel must be convertible to a float." ) from e
497- if max_abs_model_vel <= 0 :
498- raise ValueError ("max_abs_model_vel must be greater than zero." )
499497 if max_vel is None :
500498 return max_abs_model_vel
501499 max_vel = abs (max_vel )
500+ if max_vel <= 0 :
501+ raise ValueError ("maximum absolute velocity must be greater than zero." )
502502 if max_vel < max_abs_model_vel :
503503 warnings .warn ("max_vel is less than the actual maximum velocity." , stacklevel = 1 )
504504 return max_vel
You can’t perform that action at this time.
0 commit comments