Skip to content

Commit

Permalink
fixed deprecation warning about conversion of an array to a scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
niksirbi committed Oct 24, 2024
1 parent 99f84a1 commit a69e156
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions neuralplayground/arenas/discritized_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions neuralplayground/arenas/simple2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]),
Expand Down

0 comments on commit a69e156

Please sign in to comment.