From a69e156329685784bd13d86a10ae1ec92066cfca Mon Sep 17 00:00:00 2001 From: niksirbi Date: Thu, 24 Oct 2024 10:27:48 +0100 Subject: [PATCH] fixed deprecation warning about conversion of an array to a scalar --- neuralplayground/arenas/discritized_objects.py | 4 ++-- neuralplayground/arenas/simple2d.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/neuralplayground/arenas/discritized_objects.py b/neuralplayground/arenas/discritized_objects.py index a33f068..dc696fb 100644 --- a/neuralplayground/arenas/discritized_objects.py +++ b/neuralplayground/arenas/discritized_objects.py @@ -97,8 +97,8 @@ def __init__( self.arena_limits = np.array( [[self.arena_x_limits[0], self.arena_x_limits[1]], [self.arena_y_limits[0], self.arena_y_limits[1]]] ) - self.room_width = np.diff(self.arena_x_limits)[0] - self.room_depth = np.diff(self.arena_y_limits)[0] + self.room_width = np.diff(self.arena_x_limits)[0].item() + self.room_depth = np.diff(self.arena_y_limits)[0].item() self.agent_step_size = env_kwargs["agent_step_size"] self._create_default_walls() self._create_custom_walls() diff --git a/neuralplayground/arenas/simple2d.py b/neuralplayground/arenas/simple2d.py index 90142f5..e023203 100644 --- a/neuralplayground/arenas/simple2d.py +++ b/neuralplayground/arenas/simple2d.py @@ -107,8 +107,8 @@ def __init__( [self.arena_y_limits[0], self.arena_y_limits[1]], ] ) - self.room_width = np.diff(self.arena_x_limits)[0] - self.room_depth = np.diff(self.arena_y_limits)[0] + self.room_width = np.diff(self.arena_x_limits)[0].item() + self.room_depth = np.diff(self.arena_y_limits)[0].item() self.observation_space = Box( low=np.array([self.arena_x_limits[0], self.arena_y_limits[0]]), high=np.array([self.arena_x_limits[1], self.arena_y_limits[1]]),