def test_mask_image_no_copy(): """ Test that mask_image can work in-place """ mask = np.random.randint(0, 1, size=(64, 64), dtype=bool) image = np.random.random((64, 64)) masked = mask_image(image, mask, copy=False) assert image is masked
def test_no_copy(self): """ Test that mask_image can work in-place """ mask = np.random.randint(0, 1, size=(64, 64), dtype=np.bool) image = np.random.random((64, 64)) masked = mask_image(image, mask, copy=False) self.assertIs(image, masked)
def test_mask_image_trivial(): mask = np.ones((64, 64), dtype=bool) image = np.random.random((64, 64)) masked = mask_image(image, mask) assert np.allclose(image, masked)
def test_trivial(self): mask = np.ones((64, 64), dtype=np.bool) image = np.random.random((64, 64)) masked = mask_image(image, mask) self.assertTrue(np.allclose(image, masked))