Skip to content

Commit

Permalink
Replace deprecated check_less_precise
Browse files Browse the repository at this point in the history
  • Loading branch information
jacg committed Feb 10, 2021
1 parent 8cd45f1 commit b8bc830
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions invisible_cities/core/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,9 @@ def assert_dataframes_equal(df1, df2, check_types=True, **kwargs):
pd.testing.assert_frame_equal(df1.sort_index(axis=1), df2.sort_index(axis=1), check_names=True, check_dtype=check_types, check_exact=True, **kwargs)

def assert_dataframes_close(df1, df2, check_types=True, rtol=None, atol=None, **kwargs):
if rtol:
check_less_precise = int(np.log10(1./rtol))
elif atol:
check_less_precise = int(np.log10(atol))
else:
check_less_precise = True

pd.testing.assert_frame_equal(df1.sort_index(axis=1), df2.sort_index(axis=1),
check_names=True, check_dtype=check_types, check_less_precise = check_less_precise)
pd.testing.assert_frame_equal(df1.sort_index(axis=1), df2.sort_index(axis=1),
check_names=True, check_dtype=check_types,
check_exact=False, rtol=rtol, atol=atol)


def assert_SensorResponses_equality(sr0, sr1):
Expand Down

0 comments on commit b8bc830

Please sign in to comment.