From 8b5fd99dbbf11a6ae170fd9e46b5c9c39fcea9cf Mon Sep 17 00:00:00 2001 From: Poruri Sai Rahul Date: Mon, 19 Dec 2022 16:05:32 +0530 Subject: [PATCH] MAINT: Use bool instead of deprecated np.bool --- chaco/multi_array_data_source.py | 2 +- chaco/tools/lasso_selection.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/chaco/multi_array_data_source.py b/chaco/multi_array_data_source.py index 1c2aa8347..9663bb90e 100644 --- a/chaco/multi_array_data_source.py +++ b/chaco/multi_array_data_source.py @@ -13,7 +13,7 @@ import warnings # Major package imports -from numpy import nanmax, nanmin, array, shape, ones, bool, newaxis, nan_to_num +from numpy import nanmax, nanmin, array, shape, ones, newaxis, nan_to_num # Enthought library imports from traits.api import Any, Int, Tuple diff --git a/chaco/tools/lasso_selection.py b/chaco/tools/lasso_selection.py index cc17851f8..fa446189d 100644 --- a/chaco/tools/lasso_selection.py +++ b/chaco/tools/lasso_selection.py @@ -158,11 +158,11 @@ def normal_mouse_down(self, event): """ # We may want to generalize this for the n-dimensional case... - self._active_selection = empty((0, 2), dtype=numpy.bool) + self._active_selection = empty((0, 2), dtype=bool) if self.selection_datasource is not None: self.selection_datasource.metadata[self.metadata_name] = zeros( - len(self.selection_datasource.get_data()), dtype=numpy.bool + len(self.selection_datasource.get_data()), dtype=bool ) self.selection_mode = "include" self.event_state = "selecting" @@ -197,7 +197,7 @@ def selecting_mouse_up(self, event): self._update_selection() self._previous_selections.append(self._active_selection) - self._active_selection = empty((0, 2), dtype=numpy.bool) + self._active_selection = empty((0, 2), dtype=bool) def selecting_mouse_move(self, event): """Handles the mouse moving when the tool is in the 'selecting' state. @@ -246,12 +246,12 @@ def normal_key_pressed(self, event): # ---------------------------------------------------------------------- def _dataspace_points_default(self): - return empty((0, 2), dtype=numpy.bool) + return empty((0, 2), dtype=bool) def _reset(self): """Resets the selection""" self.event_state = "normal" - self._active_selection = empty((0, 2), dtype=numpy.bool) + self._active_selection = empty((0, 2), dtype=bool) self._previous_selections = [] self._update_selection() @@ -279,7 +279,7 @@ def _update_selection(self): return selected_mask = zeros( - self.selection_datasource._data.shape, dtype=numpy.bool + self.selection_datasource._data.shape, dtype=bool ) data = self._get_data()