-
-
Notifications
You must be signed in to change notification settings - Fork 246
Bugfix for significant_digits (signed zero); Numpy-friendlyness; Issue #49; Failing tests for #50; #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @Bernhard10, thanks for your PR! I'm gonna go ahead and assign this to myself as it concerns stuff I originally introduced. I'm not sure when exactly I'll get the chance to look into this, but I certainly will :) Best, |
Hey @Bernhard10 |
Now signed zeros compare equal. i.e.: 0.00 compared equal to -0.00 and 1*10**-12 compares equal to -1*10**-12, if significant_digits is less than 12
…calling `if self.down.t1:` This is necessary thanks to numpy breaking convention and rising an error during conversion of an array to a bool.
…sets. Sets use hasing for the diff, thus `__diff_numbers` is currently not invoked, which is why the tests currently fail.
…Mappings. (Adresses issue seperman#49)
Hey @seperman |
Hey @Bernhard10 Thanks for rebasing your PR. It seems like 2 of your tests are failing. Can you please check them out? |
Hi @seperman I guess actually fixing this issue is not so trivial. I guess I could try to work on it, but it would probably take me a few weeks. So for now, we can either remove the two tests or mark them as |
@Bernhard10 Cool. Yes please mark them with |
2 similar comments
PyPy uses its own fork of numpy, but its numpy support is not yet complete.
2 similar comments
This reverts commit 4c85626.
Some tests fail on pypy, but this seems to be a bug in travis-ci, which tries to install the wrong version of numpy (pypy has it's own fork). Skipping these Tests on pypy does not seem to work either. These tests are necessary, because a user might want to compare objects containing numpy arrays with deepdiff. Unfortunately, the universal |
@Bernhard10 Thanks for digging into the issue with Travis-ci. We have some tests that detect if they are run under Pypy and then they behave differently. So I think maybe we can go around the Travis-ci bug for now that way till they fix it. |
This pullrequests makes several small changes. Fell free to merge only selected commits if desired.
Most commit contain changes to the main source code and tests.
self.down.t1
to None instead of usingif self.down.ta
inauto_generate_child_rel
, because numpy arrays rise an error when used as booleans. I hope this changed behaviour does not introduce any bugs with other edge-cases.__diff_numbers
for the significant_digits option. Now -0 and +0 compare equal.__diff_dict
instead of__diff_iterable
for the comparison ofcollections.abc.Mapping
instances (before__diff_dict
required the container to be aMutableMapping
) - see issue Mappings should be compared with __diff_dict instead of __diff_iterable #49