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
Random failure in AffineCrystalFromClassicalElement.__cmp__ #19488
Comments
comment:1
This looks like something that is going to be introduced by the |
Commit: |
Branch: u/chapoton/19488 |
comment:3
I am pretty sure this is not correct: if parent(self) is not parent(other):
return NotImplemented You need to check if the comparison is Could you also elaborate more on what you mean by this?
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:5
I have replace
But
Maybe for coherence we will need to apply the same treatment to all crystals ? |
comment:7
You forget that if cmp does not error out, then it forces some total ordering (probably memory location), so that behavior is consistent with this. I don't think at this point we need to doing anything elsewhere. |
comment:8
This is really puzzling to me (on this branch):
what is the first line doing, if not calling either cmp or |
comment:9
This branch triggers failing doctests in other crystals, as I was expecting:
|
Author: Frédéric Chapoton, Travis Scrimshaw |
Changed branch from u/chapoton/19488 to public/crystals/remove_cmp_crystals-19488 |
comment:11
I traced the problem down to New commits:
|
Reviewer: Travis Scrimshaw, Frédéric Chapoton |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:13
I modified 3 failing doctests, there just remains one in pickling. |
comment:14
So the problem with the pickling and We can either implement the following the test parent to fix the doctest: def _element_constructor_(self, x):
if isinstance(x, ElementWrapper):
if x.parent() == self:
return self.element_class(self, x.value)
return Parent._element_constructor_(self, x)
def _an_element_(self):
return self.element_class(self, "_an_element_") The other way is to override I'm thinking the latter option is the way to go forward as it is backwards compatible. |
comment:15
I am sorry, but I am not quite able to follow your reasoning. If you feel you have a reasonable solution, please proceed. |
comment:16
The problem is sage: TestParent4() == TestParent4()
True
sage: TestParent4() is TestParent4() So picking creates a new equal-but-not-identical parent. Thus there is a canonical coercion map that calls the TL;DR, yes, I have a very reasonable solution. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:18
patchbot is green. |
comment:19
Just to be sure, And why do these two richcmp methods do not use self as first parameter ? |
comment:20
Replying to @fchapoton:
Yes.
So |
comment:21
oh, well. I am happy enough with the current state, let us move to something else. Do you think we should give the same treatment to other crystals ? |
comment:22
We can if you want, but it will be a low priority for me for the next week. |
Changed branch from public/crystals/remove_cmp_crystals-19488 to |
Random failure, here on OSX:
CC: @tscrim
Component: combinatorics
Keywords: random_fail
Author: Frédéric Chapoton, Travis Scrimshaw
Branch/Commit:
ebcd19f
Reviewer: Travis Scrimshaw, Frédéric Chapoton
Issue created by migration from https://trac.sagemath.org/ticket/19488
The text was updated successfully, but these errors were encountered: