def test_2d_data_compute(self): dask_array = da.random.random((100, 150), chunks=(50, 50)) s = LazyPolarDiffraction2D(dask_array) scale0, scale1, metadata_string = 0.5, 1.5, "test" s.axes_manager[0].scale = scale0 s.axes_manager[1].scale = scale1 s.metadata.Test = metadata_string s.compute() assert s.__class__ == PolarDiffraction2D assert not hasattr(s.data, "compute") assert s.axes_manager[0].scale == scale0 assert s.axes_manager[1].scale == scale1 assert s.metadata.Test == metadata_string assert dask_array.shape == s.data.shape
def test_4d_data_compute(self): dask_array = da.random.random((4, 4, 10, 15), chunks=(1, 1, 10, 15)) s = LazyPolarDiffraction2D(dask_array) s.compute() assert s.__class__ == PolarDiffraction2D assert dask_array.shape == s.data.shape