#5756 closed enhancement (fixed)
[with patch; positive review] improve coverage of rings/morphism.pyx (and fix 5 bugs in morphism.pyx)
Reported by: | William Stein | Owned by: | Michael Abshoff |
---|---|---|---|
Priority: | major | Milestone: | sage-3.4.1 |
Component: | doctest coverage | Keywords: | |
Cc: | Robert Bradshaw | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Fix the coverage of morphism.pyx, which is bad.
Attachments (1)
Change History (10)
comment:1 Changed 14 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 14 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 14 years ago by
Summary: | improve coverage of rings/morphism.pyx → [with patch; needs review] improve coverage of rings/morphism.pyx (and fix 5 bugs in morphism.pyx) |
---|
BUGS FOUND:
- im_gens() returns a mutable list, which makes it trivial to *break* a morphism after it is created:
sage: R.<x,y> = QQ[] sage: f = R.hom([x,x+y]) sage: f(x) x sage: f.im_gens()[0] = 5 sage: f.im_gens() [5, x + y] sage: f(x) 5
Changed 14 years ago by
Attachment: | trac_5756.patch added |
---|
comment:4 Changed 14 years ago by
Starting to review this, which is in itself non-trivial!
There is some strange terminology here. I'm not sure what a "Set-theoretic ring endomorphism of Integer Ring" is meant to be, let alone a "set-theoretic ring". I think that what is meant is (in the first case) a map between rings which is not a ring homomorphism, such as a section of a surjective map.
Also the term "lift" is used for such a section, i.e. if f:R-->S is the surjective ring hom and h:S-->R is a section (so f(h(s))==s for all s in S) then the map h is being called a lift, where I would say that the element h(s) is a lift of s. And "cover"? Here R is being called a cover of S?
I think it would be helpful if somewhere in this file this terminology is defined since not all of it is so standard...
A more proper review will follow.
comment:5 Changed 14 years ago by
Cc: | Robert Bradshaw added |
---|
Robert: In case you are reviewing this - all doctest in my rc3 merge tree with this patch applied pass.
Cheers,
Michael
comment:6 follow-up: 7 Changed 14 years ago by
Summary: | [with patch; needs review] improve coverage of rings/morphism.pyx (and fix 5 bugs in morphism.pyx) → [with patch; positive review] improve coverage of rings/morphism.pyx (and fix 5 bugs in morphism.pyx) |
---|
I agree that the notation could be made more consistent, but this patch simply documents what is there (which is good) and fixes some bugs.
One thing I noticed, which is not just common to this patch, is that when we return a list that we don't want people to change (e.g. im_gens) we (hopefully) make a copy. This is why tuples were invited, shouldn't we just be using those instead?
comment:7 Changed 14 years ago by
Replying to robertwb:
I agree that the notation could be made more consistent, but this patch simply documents what is there (which is good) and fixes some bugs.
Yeah, getting it in should be the main goal here and now.
One thing I noticed, which is not just common to this patch, is that when we return a list that we don't want people to change (e.g. im_gens) we (hopefully) make a copy. This is why tuples were invited, shouldn't we just be using those instead?
implemented instead of invited I assume?
Either way, can you please open a followup ticket so that this doesn't get lost.
Cheers,
Michael
comment:8 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Merged in Sage 3.4.1.rc3.
Cheers,
Michael
comment:9 Changed 14 years ago by
I meant invented...
Followup at #5802, perhaps there should be a followup to John Cremona's comments as well.
BUGS FOUND: