Change comparison of Quantity (to fix gh-146)#147
Change comparison of Quantity (to fix gh-146)#147bjodah wants to merge 2 commits intopython-quantities:masterfrom
Conversation
|
I just ran the test suite for the Neo so I think we can conclude this will indeed break a lot of things. I do think this is something we should move towards, but we need to move slowly to avoid breaking downstream code unexpectedly. I suggest adding a global flag, e.g. In six months or so we can set the global flag to False by default, so that people can still get the old behaviour if they prefer. What do you think? |
|
Yes, making the new behavior "opt-in" for a long time using an environment variable sounds like to right approach. I might get back to this PR later, but if anyone wants to implement this sooner: feel free to continue off this branch. |
This fixes gh-146 (Quantity with dimension comparing equal to plain numpy arrays).
This is a rather big change since it actually changes some tests to expect errors being raised where equality was assumed before. So we might need a deprecation cycle (we can emit warnings where we will raise exceptions / change equality behaviour). Or maybe people even find the change to be too large to even be considered?
What do people think?