From 5edc460931881f0d4a91eedc132a93003f214329 Mon Sep 17 00:00:00 2001 From: sebastianbrzustowicz Date: Fri, 23 Feb 2024 04:58:52 +0100 Subject: [PATCH] Updating deprecated alias 'np.bool8' -> 'np.bool_' --- gym/utils/passive_env_checker.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gym/utils/passive_env_checker.py b/gym/utils/passive_env_checker.py index bd826510f48..7a89cba9034 100644 --- a/gym/utils/passive_env_checker.py +++ b/gym/utils/passive_env_checker.py @@ -222,19 +222,19 @@ def env_step_passive_checker(env, action): ) obs, reward, done, info = result - if not isinstance(done, (bool, np.bool8)): + if not isinstance(done, (bool, np.bool_)): logger.warn( f"Expects `done` signal to be a boolean, actual type: {type(done)}" ) elif len(result) == 5: obs, reward, terminated, truncated, info = result - # np.bool is actual python bool not np boolean type, therefore bool_ or bool8 - if not isinstance(terminated, (bool, np.bool8)): + # np.bool is actual python bool not np boolean type, therefore bool_ or bool8 (deprecated alias) + if not isinstance(terminated, (bool, np.bool_)): logger.warn( f"Expects `terminated` signal to be a boolean, actual type: {type(terminated)}" ) - if not isinstance(truncated, (bool, np.bool8)): + if not isinstance(truncated, (bool, np.bool_)): logger.warn( f"Expects `truncated` signal to be a boolean, actual type: {type(truncated)}" )