Пример #1
0
 def test_power3_step(self):
     vals = np.linspace(5.0, 12.0, num=8)
     self.assertEqual(
         power3_step(vals, edges=[0.0, 1.0]).tolist(), [1.0] * 8)
     self.assertEqual(
         power3_step(vals, edges=[7.0, 11.0]).tolist(),
         [0.0, 0.0, 0.0, 0.15625, 0.5, 0.84375, 1.0, 1.0])
Пример #2
0
 def test_power3_step(self):
     vals = np.linspace(5.0, 12.0, num=8)
     self.assertEqual(power3_step(vals, edges=[0.0, 1.0]).tolist(), [1.0]*8)
     self.assertEqual(power3_step(vals, edges=[7.0, 11.0]).tolist(),
                      [0.0, 0.0, 0.0, 0.15625, 0.5, 0.84375, 1.0, 1.0])