Example #1
0
 def test_ignored_and_terminated_returns_stat_value(self):
     expected = 2.
     result = utils.stats_with_ignored_values(self.x1, numpy.mean,
                                              ignored_value=4.,
                                              terminator_value=5.,)
     nt.assert_equal(result, expected)
Example #2
0
 def test_everything_ignored_or_terminated_returns_terminator(self):
     expected = 5.
     result = utils.stats_with_ignored_values(self.x2, numpy.mean,
                                              ignored_value=1.,
                                              terminator_value=5.,)
     nt.assert_equal(result, expected)
Example #3
0
 def test_only_terminate_everthing(self):
     expected = 5.
     result = utils.stats_with_ignored_values(self.x2, numpy.mean, terminator_value=5)
     nt.assert_equal(result, expected)
Example #4
0
 def test_nothing_to_terminate(self):
     expected = 3.
     result = utils.stats_with_ignored_values(self.x1, numpy.mean, terminator_value=6)
     nt.assert_equal(result, expected)
Example #5
0
 def test_with_terminator(self):
     expected = 3.5
     result = utils.stats_with_ignored_values(self.x1, numpy.mean, terminator_value=1)
     nt.assert_equal(result, expected)
Example #6
0
 def test_with_ignore(self):
     expected = 2.5
     result = utils.stats_with_ignored_values(self.x1, numpy.mean, ignored_value=5)
     nt.assert_equal(result, expected)
Example #7
0
 def test_defaults(self):
     expected = 3.
     result = utils.stats_with_ignored_values(self.x1, numpy.mean, ignored_value=None)
     nt.assert_equal(result, expected)