Example #1
0
 def test_square(self):
     """Square basics must work."""
     dat = square(self.dat)
     # works elementwise (does not alter the shape)
     self.assertEqual(self.dat.data.shape, dat.data.shape)
     # actual square was computed
     np.testing.assert_array_almost_equal(dat.data, np.square(self.dat.data))
Example #2
0
 def test_square(self):
     """Square basics must work."""
     dat = square(self.dat)
     # works elementwise (does not alter the shape)
     self.assertEqual(self.dat.data.shape, dat.data.shape)
     # actual square was computed
     np.testing.assert_array_almost_equal(dat.data,
                                          np.square(self.dat.data))
Example #3
0
 def test_square_copy(self):
     """Square must not change the original parameter."""
     cpy = self.dat.copy()
     square(self.dat)
     self.assertEqual(cpy, self.dat)
Example #4
0
 def test_square_copy(self):
     """Square must not change the original parameter."""
     cpy = self.dat.copy()
     square(self.dat)
     self.assertEqual(cpy, self.dat)