You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using DeepDiff, specifying both ignore_order=True and math_epsilon=0.01 parameters results in an inconsistency. The method issues a warning that math_epsilon will be ignored due to ignore_order being True, but the output suggests that math_epsilon is, in fact, considered.
To Reproduce
Steps to reproduce the behavior:
a= {'x': 0.001}
b= {'x': 0.0011}
print (deepdiff.DeepDiff(a, b, ignore_order=True)) # {'values_changed': {"root['x']": {'new_value': 0.0011, 'old_value': 0.001}}}# Shows warning "math_epsilon will be ignored. It cannot be used when ignore_order is True." but still worksprint (deepdiff.DeepDiff(a, b, ignore_order=True, math_epsilon=0.01)) # {}
Expected behavior
The expected behavior is ambiguous due to the warning message. If math_epsilon is meant to be ignored with ignore_order=True, the output should not consider math_epsilon. Conversely, if it is being considered despite the warning, the warning message might be misleading or erroneous.
OS, DeepDiff version and Python version:
OS: Ubuntu
Version: 20LTS
Python Version: 3.10
DeepDiff Version: 6.7.0
Additional context
The inconsistency between the warning message and the actual behavior of the method can lead to confusion about the effective application of the math_epsilon parameter in combination with ignore_order. Clarification or correction in either the documentation or the method's behavior would be beneficial.
The text was updated successfully, but these errors were encountered:
Hi @movchan74
Thank you for reporting the inconsistency.
I have updated the docs to reflect that:
math_epsilon in conjunction with ignore_order=True is only used for flat object comparisons. Custom math_epsilon will not have an effect when comparing nested objects.
Describe the bug
When using DeepDiff, specifying both
ignore_order=True
andmath_epsilon=0.01
parameters results in an inconsistency. The method issues a warning thatmath_epsilon
will be ignored due toignore_order
beingTrue
, but the output suggests thatmath_epsilon
is, in fact, considered.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The expected behavior is ambiguous due to the warning message. If
math_epsilon
is meant to be ignored withignore_order=True
, the output should not considermath_epsilon
. Conversely, if it is being considered despite the warning, the warning message might be misleading or erroneous.OS, DeepDiff version and Python version:
Additional context
The inconsistency between the warning message and the actual behavior of the method can lead to confusion about the effective application of the
math_epsilon
parameter in combination withignore_order
. Clarification or correction in either the documentation or the method's behavior would be beneficial.The text was updated successfully, but these errors were encountered: