#8197: Documenting check=True/False parameters
----------------------------------+-----------------------------------------
Reporter: cremona | Owner: AlexGhitza
Type: defect | Status: new
Priority: major | Milestone: sage-4.3.3
Component: algebraic geometry | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
----------------------------------+-----------------------------------------
Many functions have a check=True (or check=False) parameter where the
caller can avoid come costly checking of the input if they know exactly
what they are doing. That is a Good Thing, but unfortunately it is not
always documented well.
For example,
{{{
age: P2 = ProjectiveSpace(GF(2),2)
sage: P = P2.point((0,0,1))
sage: Q = P2.point([0,0,1])
sage: P
(0 : 0 : 1)
sage: Q
(0 : 0 : 1)
sage: P==Q
True
sage: P._coords
[0, 0, 1]
sage: Q._coords
[0, 0, 1]
}}}
Now the same but with "check=False":
{{{
sage: P = P2.point((0,0,1),check=False)
sage: Q = P2.point([0,0,1],check=False)
sage: P
(0 : 0 : 1)
sage: Q
(0 : 0 : 1)
sage: P==Q
False
sage: P._coords
(0, 0, 1)
sage: Q._coords
[0, 0, 1]
}}}
The point is that on creation of the point, valid tuple input is
converted to a list, unless check=False in which case tuples are left as
tuples. This can result in wrong results.
In this example, the point-creation function should document the check=
parameter by stating that the coordinates should be given as a list, not a
tuple, with entries in the right parent, of the roght length, and (for
curves or other schemes where there are polynomial equations to be
satisfied) satisfying the defining equations.
There are surely many places in the source code where these remarks apply,
but I have tagged this ticket "algebraic geometry" since that's where I
ran into it.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8197>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.