From 4a8d953ec924b2190ab79c1669452d9fd5fcf3c5 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Wed, 7 Jul 2021 13:38:44 -0500 Subject: [PATCH 1/2] BandedMapper should enfore data_array is an ndarray just like its base class LinearMapper does --- chaco/plots/horizon_plot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chaco/plots/horizon_plot.py b/chaco/plots/horizon_plot.py index ba3e37679..dd6ff0850 100644 --- a/chaco/plots/horizon_plot.py +++ b/chaco/plots/horizon_plot.py @@ -29,6 +29,8 @@ def map_screen(self, data_array): else: return array([self.low_pos]) else: + if not isinstance(data_array, ndarray): + data_array = array(data_array, ndmin=1) # Scale the data by the number of bands return ( data_array * self.bands - self.range.low From 753f37cf14e5ea23e7e9b777df8aa4a78beb7386 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Wed, 7 Jul 2021 13:39:29 -0500 Subject: [PATCH 2/2] PolarMapper should enfore data_array is an ndarray just like its base class LinearMapper does --- chaco/polar_mapper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chaco/polar_mapper.py b/chaco/polar_mapper.py index cefb76393..5142eac2a 100644 --- a/chaco/polar_mapper.py +++ b/chaco/polar_mapper.py @@ -62,6 +62,8 @@ def map_screen(self, data_array): else: return array([self.low_pos]) else: + if not isinstance(data_array, ndarray): + data_array = array(data_array, ndmin=1) return (data_array - self.range.low) * self._scale + self.low_pos def map_data(self, screen_val):