예제 #1
0
 def test_cen_diff2_zero_slope(self):
     np.testing.assert_array_equal(calcs.cen_diff2(self.ones, self.arange),
                                   self.zeros_trunc2)
     np.testing.assert_array_equal(calcs.cen_diff2(self.zeros, self.arange),
                                   self.zeros_trunc2)
     np.testing.assert_array_equal(calcs.cen_diff2(self.zeros, 1.),
                                   self.zeros_trunc2)
예제 #2
0
 def test_cen_diff2_constant_slope(self):
     np.testing.assert_array_equal(calcs.cen_diff2(self.arange, 1.),
                                   self.ones_trunc2)
     np.testing.assert_array_equal(calcs.cen_diff2(self.arange * -2.5, 1.),
                                   self.ones_trunc2 * -2.5)