Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion chaco/scales/tests/test_scales.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ def test_estimate_default_scale(self):
actual = sum(map(len, labels))
err = abs(estimate - actual) / actual
self.assertLess(err, 0.5)
return

def test_width_based_default_scale(self):
scale = ScaleSystem()
Expand Down
1 change: 0 additions & 1 deletion chaco/scales/tests/test_time_scale_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def test_null_ranges(self):
)
for start, end, kw in ranges:
self.assert_empty(trange(DTS(*start), DTS(*end), **kw))
return

def test_microseconds(self):
# Testing the microsecond scale is dicey--`base` is a 10 digit integer,
Expand Down
4 changes: 0 additions & 4 deletions chaco/tests/test_base_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def test_ascending(self):
self.assertEqual(rmap(3.4), 3)
self.assertEqual(rmap(3.5), 3)
self.assertEqual(rmap(3.6), 4)
return

def test_ascending_floor(self):
ary = arange(10.0)
Expand All @@ -74,7 +73,6 @@ def test_ascending_floor(self):
self.assertEqual(rmap(3.4), 3)
self.assertEqual(rmap(3.5), 3)
self.assertEqual(rmap(3.6), 3)
return

def test_descending(self):
ary = arange(10.0, 0.0, -1.0)
Expand All @@ -93,7 +91,6 @@ def test_descending(self):
self.assertEqual(rmap(8.6), 1)
self.assertEqual(rmap(8.5), 1)
self.assertEqual(rmap(8.4), 2)
return

def test_descending_floor(self):
ary = arange(10.0, 0.0, -1.0)
Expand All @@ -103,7 +100,6 @@ def test_descending_floor(self):
self.assertEqual(rmap(8.6), 1)
self.assertEqual(rmap(8.5), 1)
self.assertEqual(rmap(8.4), 1)
return


class FindRunsTestCase(unittest.TestCase):
Expand Down
7 changes: 0 additions & 7 deletions chaco/tests/test_colormapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ def test_simple_map(self):
self.assertTrue(close,
"Simple map failed. Expected %s. Got %s" % (expected, b[:,:1]))

return

def test_change_min_max(self):
""" Test that changing min_value and max_value does not break map. """

Expand Down Expand Up @@ -70,9 +68,6 @@ def test_change_min_max(self):
self.assertTrue(close,
"Changing min value broke map. Expected %s. Got %s" % (expected, b[:,:1]))


return

def test_array_factory(self):
""" Test that the array factory creates valid colormap. """

Expand All @@ -90,8 +85,6 @@ def test_array_factory(self):
self.assertTrue(allclose(ravel(b[:,:1]), expected, atol=0.02),
"Array factory failed. Expected %s. Got %s" % (expected, b[:,:1]))

return

def test_alpha_palette(self):
""" Create a colormap with a varying alpha channel from a palette array.
"""
Expand Down
8 changes: 0 additions & 8 deletions chaco/tests/test_datarange_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def test_empty_range(self):
self.assertEqual(r.high_setting, 10.0)
self.assertEqual(r.low, 5.0)
self.assertEqual(r.high, 10.0)
return

def test_set_bounds1(self):
"""Change both low and high with set_bounds()."""
Expand Down Expand Up @@ -175,7 +174,6 @@ def test_single_source(self):
r.low = "auto"
self.assertEqual(r.low_setting, "auto")
self.assertEqual(r.low, 0.0)
return

def test_constant_value(self):
r = DataRange1D()
Expand Down Expand Up @@ -204,16 +202,13 @@ def test_constant_value(self):
r.add(ds)
self.assertEqual(r.low, -0.25)
self.assertEqual(r.high, 0.0)
return


def test_multi_source(self):
ds1 = ArrayDataSource(array([3, 4, 5, 6, 7]))
ds2 = ArrayDataSource(array([5, 10, 15, 20]))
r = DataRange1D(ds1, ds2)
self.assertEqual(r.low, 3.0)
self.assertEqual(r.high, 20.0)
return

def test_clip_data(self):
r = DataRange1D(low=2.0, high=10.0)
Expand All @@ -227,7 +222,6 @@ def test_clip_data(self):

r = DataRange1D(low=2.0, high=2.5)
assert_equal(len(r.clip_data(ary)) , 0)
return

def test_mask_data(self):
r = DataRange1D(low=2.0, high=10.0)
Expand All @@ -242,7 +236,6 @@ def test_mask_data(self):

r = DataRange1D(low=2.0, high=2.5)
assert_equal(r.mask_data(ary) , zeros(len(ary)))
return

def test_bound_data(self):
r = DataRange1D(low=2.9, high=6.1)
Expand All @@ -253,7 +246,6 @@ def test_bound_data(self):
ary = array([-5,-4,-7,-8,-2,1,2,3,4,5,4,3,8,9,10,9,8])
bounds = r.bound_data(ary)
assert_equal(bounds , (7,11))
return

def test_custom_bounds_func(self):
def custom_func(low, high, margin, tight_bounds):
Expand Down
9 changes: 1 addition & 8 deletions chaco/tests/test_datarange_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def test_empty_range(self):
assert_ary_(r.high_setting, array([10.0,10.0]))
assert_ary_(r.low,array([5.0,5.0]))
assert_ary_(r.high, array([10.0,10.0]))
return

def test_single_source(self):
r = DataRange2D()
Expand All @@ -48,7 +47,6 @@ def test_single_source(self):
r.low = ('auto', 'auto')
self.assertTrue(r.low_setting == ('auto', 'auto'))
assert_ary_(r.low, array([0.0,0.0]))
return

def test_constant_values(self):
r = DataRange2D()
Expand Down Expand Up @@ -77,8 +75,6 @@ def test_constant_values(self):
r.add(ds)
assert_ary_(r.low, array([-0.25, -0.25]))
assert_ary_(r.high, array([0.0, 0.0]))
return


def test_multi_source(self):
x = arange(10.)
Expand All @@ -90,7 +86,6 @@ def test_multi_source(self):
r = DataRange2D(ds1, ds2)
assert_ary_(r.low, [0.0,0.0])
assert_ary_(r.high, [90.,90.])
return

def test_grid_source(self):
test_xd1 = array([1,2,3])
Expand Down Expand Up @@ -181,8 +176,6 @@ def test_clip_data(self):
assert_equal(r.clip_data(ary) , array([[16.,12.],[18.,16.],[20.,20.]]))
assert_equal(r.clip_data(ary[::-1]) , array([[20,20], [18,16], [16,12]]))

return

def test_mask_data(self):
r = DataRange2D(low=[2.0,5.0], high=[10.0,18.0])
x = array([1, 3, 4, 9.8, 10.2, 12])
Expand All @@ -200,7 +193,7 @@ def test_mask_data(self):

r = DataRange2D(low=[2.0,5.0], high=[2.5,9.0])
assert_equal(r.mask_data(ary) , zeros(len(ary)))
return


def assert_close_(desired,actual):
diff_allowed = 1e-5
Expand Down
4 changes: 0 additions & 4 deletions chaco/tests/test_linearmapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def test_basic(self):
self.assertTrue(mapper._high_bound_initialized)
result = mapper.map_screen(ary)
assert_equal(result , array([50, 60, 70, 80, 90, 100]))
return

def test_reversed(self):
ary = array([5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
Expand All @@ -36,7 +35,6 @@ def test_reversed(self):
self.assertTrue(mapper._high_bound_initialized)
result = mapper.map_screen(ary)
assert_equal(result , array([100, 80, 60, 40, 20, 0]))
return

def test_set_screen_bounds(self):
ary = array([5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
Expand All @@ -50,7 +48,6 @@ def test_set_screen_bounds(self):
self.assertTrue(mapper._high_bound_initialized)
result = mapper.map_screen(ary)
assert_equal(result , array([50, 60, 70, 80, 90, 100]))
return

def test_reversed_set_screen_bounds(self):
ary = array([5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
Expand All @@ -64,7 +61,6 @@ def test_reversed_set_screen_bounds(self):
self.assertTrue(mapper._high_bound_initialized)
result = mapper.map_screen(ary)
assert_equal(result , array([100, 80, 60, 40, 20, 0]))
return

def test_update_screen_bounds_stretch_data(self):
ary = array([5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
Expand Down
22 changes: 1 addition & 21 deletions chaco/tests/test_plotcontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def __init__(self, bounds, *args, **kw):
if "resizable" not in kw:
kw["resizable"] = ""
PlotComponent.__init__(self, *args, **kw)
return

class ResizablePlotComponent(PlotComponent):
""" A resizable PlotComponent with a fixed preferred size. """
Expand Down Expand Up @@ -55,7 +54,6 @@ def test_basics(self):
self.assertEqual(container._layout_needed, True)
container.do_layout()
self.assertEqual(container._layout_needed, False)
return

def test_fixed_size_component(self):
container = OverlayPlotContainer(resizable='', bounds=[200.0,300.0])
Expand All @@ -72,7 +70,6 @@ def test_fixed_size_component(self):
self.assert_tuple(container.get_preferred_size(), (200.0,300.0))
self.assert_tuple(component.position, (50.0,60.0))
self.assert_tuple(component.bounds, (100.0,110.0))
return

def test_resizable_component(self):
container = OverlayPlotContainer(resizable='', bounds=[200.0,300.0])
Expand All @@ -93,7 +90,6 @@ def test_resizable_component(self):
container.do_layout()
self.assert_tuple(comp3.position, (30.0, 0.0))
self.assert_tuple(comp3.bounds, (100,300))
return

def test_min_size(self):
container = OverlayPlotContainer(resizable='', bounds=[50.0,50.0])
Expand All @@ -103,7 +99,6 @@ def test_min_size(self):
container.do_layout()
self.assert_tuple(component.position, (50.0,60.0))
self.assert_tuple(component.bounds, (100.0,110.0))
return

def test_multiple_min_size(self):
comp1 = StaticPlotComponent([200, 50])
Expand All @@ -115,7 +110,7 @@ def test_multiple_min_size(self):
self.assert_tuple(container.get_preferred_size(), (200,300))
self.assert_tuple(comp1.bounds, (200,50))
self.assert_tuple(comp2.bounds, (60,300))
return


class HPlotContainerTestCase(ContainerTestCase):

Expand All @@ -132,7 +127,6 @@ def test_stack_nonresize(self):
self.assert_tuple(comp1.position, (0,0))
self.assert_tuple(comp2.position, (100,0))
self.assert_tuple(comp3.position, (190,0))
return

def test_stack_one_resize(self):
"Checks stacking with 1 resizable component thrown in"
Expand All @@ -149,7 +143,6 @@ def test_stack_one_resize(self):
self.assert_tuple(comp2.position, (100,0))
self.assert_tuple(comp3.position, (190,0))
self.assert_tuple(comp4.position, (260,0))
return

def test_valign(self):
container = HPlotContainer(bounds=[300,200], valign="center")
Expand All @@ -160,7 +153,6 @@ def test_valign(self):
container.valign="top"
container.do_layout(force=True)
self.assertEqual(comp1.position, [0,100])
return


class VPlotContainerTestCase(ContainerTestCase):
Expand All @@ -178,7 +170,6 @@ def test_stack_nonresize(self):
self.assert_tuple(comp1.position, (0,0))
self.assert_tuple(comp2.position, (0,100))
self.assert_tuple(comp3.position, (0,190))
return

def test_stack_one_resize(self):
"Checks stacking with 1 resizable component thrown in"
Expand All @@ -195,7 +186,6 @@ def test_stack_one_resize(self):
self.assert_tuple(comp2.position, (0,100))
self.assert_tuple(comp3.position, (0,190))
self.assert_tuple(comp4.position, (0,260))
return

def test_halign(self):
container = VPlotContainer(bounds=[200,300], halign="center")
Expand All @@ -206,7 +196,6 @@ def test_halign(self):
container.halign="right"
container.do_layout(force=True)
self.assertEqual(comp1.position, [100,0])
return

def test_fit_components(self):
container = VPlotContainer(bounds=[200,300], resizable="v", fit_components="v")
Expand Down Expand Up @@ -400,7 +389,6 @@ def test_empty_container(self):
cont = GridContainer(shape=(1,1))
cont.bounds = [100,100]
cont.do_layout()
return

def test_all_empty_cells(self):
cont = GridContainer(shape=(2,2), spacing=(0,0))
Expand All @@ -409,7 +397,6 @@ def test_all_empty_cells(self):
self.assert_tuple(size, (0,0))
cont.bounds = (100,100)
cont.do_layout()
return

def test_some_empty_cells(self):
cont = GridContainer(shape=(2,2), spacing=(0,0))
Expand All @@ -434,7 +421,6 @@ def test_single_cell(self):
# assert failures, maybe using Pypy?
self.assert_tuple(comp1.position, (0,0))
self.assert_tuple(comp1.bounds, (200,300))
return

def test_nonresizable_container(self):
cont = GridContainer(shape=(1,1), resizable="")
Expand All @@ -443,7 +429,6 @@ def test_nonresizable_container(self):
cont.do_layout()
self.assert_tuple(comp1.position, (0,0))
self.assert_tuple(comp1.bounds, (200,300))
return

def test_row(self):
cont = GridContainer(shape=(1,3), halign="center", valign="center")
Expand All @@ -468,7 +453,6 @@ def test_row(self):
self.assert_tuple(c2.bounds, (30,30))
self.assert_tuple(c3.position, (80,0))
self.assert_tuple(c3.bounds, (20,50))
return

def test_two_by_two(self):
""" Tests a 2x2 grid of components """
Expand All @@ -488,7 +472,6 @@ def test_two_by_two(self):
self.assert_tuple(left.bounds, (50,100))
self.assert_tuple(lr.position, (50,0))
self.assert_tuple(lr.bounds, (100,100))
return

def test_spacing(self):
cont = GridContainer(shape=(2,2), spacing=(10,10),
Expand All @@ -508,7 +491,6 @@ def test_spacing(self):
self.assert_tuple(left.bounds, (50,100))
self.assert_tuple(lr.position, (80,10))
self.assert_tuple(lr.bounds, (100,100))
return

def test_resizable(self):
cont = GridContainer(shape=(2,2), spacing=(0,0),
Expand All @@ -528,7 +510,6 @@ def test_resizable(self):
self.assert_tuple(left.bounds, (100,100))
self.assert_tuple(lr.position, (100,0))
self.assert_tuple(lr.bounds, (100,100))
return

def test_resizable2(self):
# Tests a resizable component that also has a preferred size
Expand Down Expand Up @@ -569,7 +550,6 @@ def test_resizable_mixed(self):
self.assert_tuple(left.bounds, (100,100))
self.assert_tuple(lr.position, (130,10))
self.assert_tuple(lr.bounds, (100,100))
return

def test_resizable_mixed2(self):
# Tests laying out resizable components with preferred
Expand Down