spatialdata.testing.assert_elements_are_identical

spatialdata.testing.assert_elements_are_identical#

spatialdata.testing.assert_elements_are_identical(element0, element1, check_transformations=True)#

Compare two elements (two SpatialElements or two tables) and assert that they are identical.

Parameters:
  • element0 (Union[SpatialImage, MultiscaleSpatialImage, GeoDataFrame, DataFrame, AnnData]) – The first element.

  • element1 (Union[SpatialImage, MultiscaleSpatialImage, GeoDataFrame, DataFrame, AnnData]) – The second element.

  • check_transformations (bool (default: True)) – Whether to check if the transformations are identical, for each element.

Return type:

None

Returns:

: None

Raises:

AssertionError – If the two elements are not identical.

Notes

With the current implementation, the transformations Translate([1.0, 2.0], axes=(‘x’, ‘y’)) and Translate([2.0, 1.0], axes=(‘y’, ‘x’)) are considered different. A quick way to avoid an error in this case is to use the check_transformations=False parameter.