roseau.load_flow.testing

Roseau load flow testing utilities.

Functions

assert_json_close(→ None)

Assert that two JSON data structures are close, i.e same structure and all close values.

Module Contents

assert_json_close(obj1: object, obj2: object, *, rtol=1e-07, atol=0, prefix: str = '') None

Assert that two JSON data structures are close, i.e same structure and all close values.

This function is used to compare two JSON data structures, which can be dictionaries, lists, strings, booleans, or numbers.

The comparison is done recursively, and the function raises an AssertionError if the two structures are different. The comparison is done with a tolerance for floating point numbers.