perturbopy.test_utils.compare_data.h5.equal_ndarray

perturbopy.test_utils.compare_data.h5.equal_ndarray(ndarray1, ndarray2, key, ig_n_tol)

Determines if two ndarrays contain the same values

Parameters:
  • ndarray1 (numpy.ndarray) – first numpy ndarray

  • ndarray2 (numpy.ndarray) – second numpy ndarray

  • key (str) – A key for the tolerance. If this key is not specified in the tolerance dict, a default tolerance will be applied

  • ig_n_tol (dict) – dictionary of ignore keywords and tolerances needed to make comparison on values

Returns:

  • equal_vlaues (bool) – boolean specifying if both ndarrays are equivalent

  • diff (str) – string which contains the information about biggest difference between produced file and reference

  • output_arr (ndarray) – numpy array with the original data from the produced files. Where the error was found, value is changed by the line: value here: {val1}, reference:({val2}), abs_diff={abs(val2-val1)}, rel_diff={abs(val2-val1)/val2}