spatialdata.testing.assert_elements_dict_are_identical

spatialdata.testing.assert_elements_dict_are_identical#

spatialdata.testing.assert_elements_dict_are_identical(elements0, elements1, check_transformations=True)#

Compare two dictionaries of elements and assert that they are identical (except for the order of the keys).

The dictionaries of elements can be obtained from a SpatialData object using the .shapes, .labels, .points, .images and .tables properties.

Parameters:
  • elements0 (Elements) – The first dictionary of elements.

  • elements1 (Elements) – The second dictionary of elements.

Return type:

None

Returns:

: None

Raises:

AssertionError – If the two dictionaries of 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.