triqs.utility.h5diff.compare
- triqs.utility.h5diff.compare(key, a, b, level, precision)[source]
Recursively compare two objects identified by
key.Dispatches on the runtime type of
a(and asserts thatbhas the same type):dictorHDFArchiveGroup– compare the set of keys and recurse on each value.Gf/BlockGf/Block2Gf– defer toassert_gfs_are_close()/assert_block_gfs_are_close()/assert_block2_gfs_are_close().Operator– check that(a - b).is_zero().numpy.ndarray– defer toassert_arrays_are_close().bool/numpy.bool_– checka == b.str– checka == b.
Any mismatch is appended to the module-level
failureslist rather than raised immediately, so that the full diff is reported at the end ofh5diff().- Parameters:
- keystr
Slash-separated path of the current node inside the archive, used in error messages.
- a, bobject
Values to compare.
- levelint
Current depth in the recursive walk, controls the indentation of the optional progress output emitted when the module-level
verboseflag is set.- precisionfloat
Maximum allowed element-wise absolute difference passed to the underlying array / Green’s-function comparisons.
- Raises:
- NotImplementedError
If the type of
ais not one of the supported categories listed above.