Esempio n. 1
0
    def test_to_numpy(self):
        vals = np.random.rand(8, 8)
        block_arr = BlockArray(vals)
        np.testing.assert_almost_equal(vals, block_arr.to_numpy())

        vals = np.random.rand(8, 8, 8)
        block_arr = BlockArray(vals)
        np.testing.assert_almost_equal(vals, block_arr.to_numpy())
Esempio n. 2
0
 def test_setting_to_3d_pic(self):
     vals = np.random.rand(4, 4, 4)
     block_arr = BlockArray(picture=vals)
     assert block_arr.dim == 3
     assert block_arr.shape == vals.shape
     np.testing.assert_almost_equal(vals, block_arr.to_numpy())