Skip to content

Commit

Permalink
mypy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lihuoran committed Jul 27, 2022
1 parent e453290 commit 8eb1b01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qlib/rl/utils/finite_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def is_invalid(arr: int | float | bool | np.ndarray | dict | list | tuple) -> bo
if isinstance(arr, np.ndarray):
if np.issubdtype(arr.dtype, np.floating):
return np.isnan(arr).all()
return cast(np.ndarray, np.iinfo(arr.dtype).max == arr).all()
return True if cast(np.ndarray, np.iinfo(arr.dtype).max == arr).all() else False
if isinstance(arr, dict):
return all(is_invalid(o) for o in arr.values())
if isinstance(arr, (list, tuple)):
Expand Down

0 comments on commit 8eb1b01

Please sign in to comment.