datatree.testing.assert_equal#

datatree.testing.assert_equal(a: datatree.datatree.DataTree, b: datatree.datatree.DataTree, from_root: bool = True)[source][source]#

Two DataTrees are equal if they have isomorphic node structures, with matching node names, and if they have matching variables and coordinates, all of which are equal.

By default this method will check the whole tree above the given node.

Parameters
  • a (DataTree) – The first object to compare.

  • b (DataTree) – The second object to compare.

  • from_root (bool, optional, default is True) – Whether or not to first traverse to the root of the trees before checking for isomorphism. If a & b have no parents then this has no effect.

See also

DataTree.equals, assert_isomorphic, assert_identical