Ejemplo n.º 1
0
    def calc_points(self):
        lower_point, upper_point = (self.fast_params.lower_bound, self.fast_params.upper_bound) if \
            self.fast_params.start_point_side == FastMeasureParams.StartPoint.LOWER else \
            (self.fast_params.upper_bound, self.fast_params.lower_bound)

        return utils.auto_calc_points(lower_point, upper_point,
                                      self.fast_params.points_step)
Ejemplo n.º 2
0
 def test_common_negative(self):
     self.assertEqual(utils.auto_calc_points(-2, 2, 2), [2, 0, -2])
Ejemplo n.º 3
0
 def test_common(self):
     self.assertEqual(utils.auto_calc_points(0, 6, 2), [6, 4, 2, 0])
Ejemplo n.º 4
0
 def test_bad_input_2(self):
     self.assertEqual(utils.auto_calc_points(0, 0, 0), [])
Ejemplo n.º 5
0
 def test_up_aliquant_start_up(self):
     self.assertEqual(utils.auto_calc_points(5, 0, 2), [5, 3, 1, 0])
Ejemplo n.º 6
0
 def test_up_aliquant_start_low(self):
     self.assertEqual(utils.auto_calc_points(0, 5, 2), [5, 4, 2, 0])
Ejemplo n.º 7
0
 def test_low_aliquant_start_up(self):
     self.assertEqual(utils.auto_calc_points(6, 1, 2), [6, 4, 2, 1])
Ejemplo n.º 8
0
 def test_low_aliquant_start_low(self):
     self.assertEqual(utils.auto_calc_points(1, 6, 2), [6, 5, 3, 1])
Ejemplo n.º 9
0
 def test_reverse_negative(self):
     self.assertEqual(utils.auto_calc_points(6, 0, 2), [6, 4, 2, 0])
Ejemplo n.º 10
0
 def test_reverse(self):
     self.assertEqual(utils.auto_calc_points(2, -2, 2), [2, 0, -2])