deepdiff icon indicating copy to clipboard operation
deepdiff copied to clipboard

Feature: Add threshold for numerics

Open seperman opened this issue 8 years ago • 1 comments

We already have ignore significant digits but what we need to add is a threshold for numerics so that it ignores the diff if it is within the threshold.

For example if threshold is 1% then the diff between 1000 and 1001 should be ignored.

seperman avatar May 29 '17 05:05 seperman

This feature has turned out to be tricky to implement when ignore_order=True.

Option1: Have some sort of threshold that rounds up numbers the way we are already doing it with significant digits, except do it on the other side of the decimal point too.

Option 2: We can also add 2 other parameters when ignore_order=False to basically use Python3's math.isclose(). If we do that then we will have 2 parameters that work only when ignore_order=False.

We can add both of these options. What do you guys think? @Bernhard10 @victorhahncastell

seperman avatar Aug 04 '17 21:08 seperman