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
Replace __eq__ by _richcmp_ for manifolds #30116
Comments
Dependencies: #30112 |
New commits:
|
Commit: |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:14
I am sorry. I am too impatient. Anyway, I get the following error during the doctest:
Here is the complete related doctest:
With respect to the coercion model, the output is perfectly fine: the section Should I simply rewrite this doctest, or what is the best procedure here? For consistency, the same should then hold for chart functions, too. Meaning the following command right above should then return
|
comment:55
There was a merge conflict with the new beta. The cause was #30108. Can I switch back to positive review when the bot turns green? |
comment:56
Morally green patchbot. comment:52 response: I have no objections. |
comment:57
Matthias mentioned a very important point. The equality via restriction doesn't satisfy the transitivity condition. That is because the scalar fields are not necessarily analytic. That's really bad. Is there a compromise, namely keeping |
comment:58
As I mentioned in #30266, I don't think you should feel obligated to use the coercion framework for comparisons just because you use it for arithmetic. I would suggest to compile a set of examples that really illustrate what elements you want to compare equal, to make sure that this is an equivalence relation, and then to figure out if coercion is the right tool to implement this. Perhaps the question should be asked in a broader context of coercion within the category of partial maps. |
comment:59
Replying to @mjungmath:
That sounds like an issue with the coercions. However, if you want them to also compare as equals without the coercion, then you will need to simply implement an |
comment:61
Okay, just to summarize for me: what is the punchline of our discussion and where should this ticket go? |
comment:62
I would say Matthias's comment:58 is what should be done: provide some examples of things you want and do not want to inform you of the policy you want to set. |
comment:63
Setting new milestone based on a cursory review of ticket status, priority, and last modification date. |
comment:64
Possibly related: #31703 |
comment:65
Setting a new milestone for this ticket based on a cursory review. |
comment:66
Stalled in |
Within the coercion frameworks, two objects are usually compared by using
_richcmp_
. Using this, both objects are coerced into an element of a common parent before the comparison is performed. The current implementation uses__eq__
instead and involves no prior coercion.In this ticket, the method
__eq__
is replaced by_richcmp_
as intended by the coercion framework, and__ne__
is removed. This includes the following files:In result, no manual coercions prior to equality checks are necessary and new coercions don't have to be added separately in the future.
To keep some equality checks function, I had to add the coercion from chart functions to scalar fields (see #30112). Furthermore, to unify the behavior for chart functions and to add this behavior into the documentation, I would like to add the dependence of #30267, too.
Depends on #30112
Depends on #30267
CC: @egourgoulhon @tscrim @mkoeppe
Component: manifolds
Author: Michael Jung
Branch/Commit: u/gh-mjungmath/test_comparison_tensorfield @
2c06105
Reviewer: Eric Gourgoulhon, Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/30116
The text was updated successfully, but these errors were encountered: