From d8fd9ec01254bc1549e1139d01d84428fc9334b0 Mon Sep 17 00:00:00 2001 From: hasham Date: Sun, 23 Mar 2025 00:25:11 +0500 Subject: [PATCH] Update passive_env_checker.py np.bool8 deprecated in numpy version 1.24.0. simply checking for np.bool type.. which is a simply python 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..810a9a74870 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.bool8 was deprecated in numpy version 1.24.0 + 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)}" )