-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
sage.groups.generic
: Fix incorrect identity testing
#37257
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b9be7ab
sage.groups.generic: Fix incorrect identity test
grhkm21 d38462f
sage.groups.generic: Allow generic operation in `order_from_multiple`
grhkm21 bbb0649
Docs 🔁
grhkm21 0fae8c5
Update src/sage/groups/generic.py
grhkm21 cb1a79b
use `.zero()` instead of (0)
grhkm21 778cad8
apply review changes 📖
grhkm21 e9ce5c1
fix weird failing doctest...
grhkm21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
.zero()
should be faster, but indeed not all additive groups have a.zero()
method...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the violent approach of replacing it with
.zero()
and fixing the errors. I only found a few use cases ofsage.groups.generic
in the entire Sage, so I fixed those (only required fixinghomset::zero
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks promising! Just double-checking: The change from
.codomain()
to.extended_codomain()
insrc/sage/schemes/generic/homset.py
is an essentially unrelated bugfix, right? And this is what causes the point(a : a)
in that doctest insrc/sage/schemes/projective/projective_morphism.py
to be normalized properly?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes they're two unrelated fixes (sorry!!), the
extended_codomain
is to imitate whatschemes/projective/projective_homset.py
does (and makes more sense). The normalisation is a separate problem.It is caused by the following stripped code:
(This caller difference is introduced by the
extended_codomain
tocodomain
change.) This is because the two lines call different constructorssage/src/sage/schemes/projective/projective_space.py
Lines 823 to 836 in 0c390a0
SchemeMorphism_point_projective_ring
.sage/src/sage/schemes/projective/projective_space.py
Lines 2271 to 2284 in 0c390a0
SchemeMorphism_point_projective_finite_field
which allows division.I think this is a separate problem, where
._point
shouldn't care about the caller's type but rather the argument (homset)'s type, but again it's a separate problem. It's a separate problem.