From 512cd89a61ca3478b26e9cff55e0719accc3e33d Mon Sep 17 00:00:00 2001 From: Poruri Sai Rahul Date: Mon, 12 Apr 2021 16:55:40 +0530 Subject: [PATCH 1/2] CLN : Remove unnecessary print statements and commented out/dead tests modified: chaco/plotscrollbar.py modified: chaco/tests/test_colormapper.py modified: examples/demo/nonlinear_color_mapping.py --- chaco/plotscrollbar.py | 2 +- chaco/tests/test_colormapper.py | 33 ------------------------ examples/demo/nonlinear_color_mapping.py | 1 - 3 files changed, 1 insertion(+), 35 deletions(-) diff --git a/chaco/plotscrollbar.py b/chaco/plotscrollbar.py index 5e2c054a8..6c266a337 100644 --- a/chaco/plotscrollbar.py +++ b/chaco/plotscrollbar.py @@ -101,7 +101,7 @@ def _handle_dataspace_update(self): else: ticksize = 1 foo = (totalmin, totalmax, view, ticksize) - print("scrollrange:", foo) + self.trait_setq( range=foo, scroll_position=max( diff --git a/chaco/tests/test_colormapper.py b/chaco/tests/test_colormapper.py index f1cb7eebf..78ca522a5 100644 --- a/chaco/tests/test_colormapper.py +++ b/chaco/tests/test_colormapper.py @@ -130,36 +130,3 @@ def test_no_alpha(self): "red": [(0.0, 0.0, 0.0), (1.0, 1.0, 1.0)], } assert self.colormap._segmentdata == sd - - -## def test_no_interpolation(self): -## grayscale_colors = array([[0.0,0.0,0.0,1.0], [1.0, 1.0, 1.0, 1.0]]) -## grayscale_bins = array([0.0, 1.0]) -## grayscale_steps = array([1]) - -## colormap = LinearSegmentedColormap( -## grayscale_colors, grayscale_bins, grayscale_steps -## ) - -## a = array([0.0, 0.25, 0.75, 1.0]) -## b = colormap.map_array(a) -## result = ravel(b[:,:1]) -## expected = array([0.0, 0.0, 1.0, 1.0]) - -## close = allclose(result, expected, atol=0.02) -## self.assert_(close, -## "Map with no interpolation broken. Expected %s. Got %s" % (expected, result)) - -## def test_value_bands(self): - -## grayscale_colors = array([[0.0,0.0,0.0,1.0], [1.0, 1.0, 1.0, 1.0]]) -## grayscale_bins = array([0.0, 1.0]) -## grayscale_steps = array([1]) - -## colormap = LinearSegmentedColormap( -## grayscale_colors, grayscale_bins, grayscale_steps -## ) - -## colormap._recalculate() - -## print '**************', colormap._color_bands, colormap._value_bands diff --git a/examples/demo/nonlinear_color_mapping.py b/examples/demo/nonlinear_color_mapping.py index 483fcf3aa..b0849e0e3 100644 --- a/examples/demo/nonlinear_color_mapping.py +++ b/examples/demo/nonlinear_color_mapping.py @@ -278,6 +278,5 @@ def _colorbar_scale_changed(self): domain_bounds=(0.0, 0.0, 2.0, 2.0), grid_size=(200, 200), ) - # print "data bounds: ", grid.data_min, grid.data_max demo = DataGridView(model=grid) demo.configure_traits() From 1c58ade6e577906d4b416feb234251e26e4a6ada Mon Sep 17 00:00:00 2001 From: Poruri Sai Rahul Date: Mon, 12 Apr 2021 12:29:03 +0000 Subject: [PATCH 2/2] CLN : Rename testcase to ColorMapperTestCase --- chaco/tests/test_colormapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chaco/tests/test_colormapper.py b/chaco/tests/test_colormapper.py index 78ca522a5..2bbaec17e 100644 --- a/chaco/tests/test_colormapper.py +++ b/chaco/tests/test_colormapper.py @@ -5,7 +5,7 @@ from chaco.api import ArrayDataSource, ColorMapper, DataRange1D -class LinearSegmentedColormapTestCase(unittest.TestCase): +class ColormapperTestCase(unittest.TestCase): def setUp(self): """ Set up called before each test case. """