--
To post to this group, send an email to sage-...@googlegroups.com
To unsubscribe from this group, send an email to sage-devel+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
I think that requiring them for every single function is excessive,
for example many functions don't take any parameters but self, or
don't return output. Also, what about arithmetic functions like
__neg__ and _mul_. (Specifically, I yesterday I was adding a bunch of
doctests to monsky-washnitzer, and the thought of adding (in my mind
superfluous) INPUT and OUTPUT blocks to these was not encouraging.
(I'm not just thinking about file size, developer time and vertical
screen real estate are valuable as well.)
- Robert
OK, good point. How about requiring INPUT if there are any inputs
beyond self, and requiring OUTPUT if there are any outputs?
> Also, what about arithmetic functions like
> __neg__ and _mul_. (Specifically, I yesterday I was adding a bunch of
> doctests to monsky-washnitzer, and the thought of adding (in my mind
> superfluous) INPUT and OUTPUT blocks to these was not encouraging.
> (I'm not just thinking about file size, developer time and vertical
> screen real estate are valuable as well.)
I'm not so concerned about that personally. This all arose out of
specifically complaints from users reading the reference manual and
having trouble figuring out what the inputs and outputs are of
functions they are supposed to use.
William
OK, good point. How about requiring INPUT if there are any inputs> I think that requiring them for every single function is excessive,
> for example many functions don't take any parameters but self, or
> don't return output.
beyond self, and requiring OUTPUT if there are any outputs?
> Also, what about arithmetic functions like
> __neg__ and _mul_. (Specifically, I yesterday I was adding a bunch of
> doctests to monsky-washnitzer, and the thought of adding (in my mind
> superfluous) INPUT and OUTPUT blocks to these was not encouraging.
> (I'm not just thinking about file size, developer time and vertical
> screen real estate are valuable as well.)
> Currently we don't require documentation for __cinit__, __dealloc__
> and __new__. Are there any other functions we want to add to that
> list? I could see an argument for _add_ and other arithmetic
> functions too.
A TESTS block is certainly a good thing to have for the arithmetic
operators.
> David
>
> On Sat, Dec 19, 2009 at 1:41 PM, David Roe <ro...@math.harvard.edu>
> wrote:
>
> > I think that requiring them for every single function is excessive,
> > for example many functions don't take any parameters but self, or
> > don't return output.
>
> OK, good point. How about requiring INPUT if there are any inputs
> beyond self, and requiring OUTPUT if there are any outputs?
>
> This is what the patch at 7716 currently does (which I've updated to
> reflect some comments; it still needs a reviewer). Based on
> Robert's comments, I would also suggest changing the coverage
> scripts to not require input or output descriptions for functions
> that begin and end with underscores. I'll post a patch on 7716 to
> that effect shortly.
>
> > Also, what about arithmetic functions like
> > __neg__ and _mul_. (Specifically, I yesterday I was adding a bunch
> of
> > doctests to monsky-washnitzer, and the thought of adding (in my mind
> > superfluous) INPUT and OUTPUT blocks to these was not encouraging.
> > (I'm not just thinking about file size, developer time and vertical
> > screen real estate are valuable as well.)
>
> Robert, are there any other kinds of functions that you can think of
> where we don't need descriptions of the input/output?
Not that I can think of at the moment.
- Robert
On 19 Dez., 21:23, Robert Bradshaw <rober...@math.washington.edu>
wrote:
> A TESTS block is certainly a good thing to have for the arithmetic
> operators.
+1
For _add_ etc, the type of both in- and output is clear (IIRC,
coercion etc happens before). But it should certainly be tested.
2 cents
Simon
As one example, imagine that a Sage user finds a documentation error.
The user wants to file a bug report. They are then encouraged to get
a trac account and post a patch. Imagine that they do so. Then a
reviewer flags the patch as "needs work" because the function in
question doesn't have INPUT/OUTPUT blocks. I think this would be very
discouraging.
Perhaps you meant your policy to only apply to new code, or to
functions (rather than modules) that have been revised. I think it is
worthwhile for you to clarify exactly what you mean.
In general I would like to point out that such policies can make it
unlikely that new people will become Sage developers. It is a
delicate balance between encouraging new effort and maintaining
quality. At the moment I think the current policies are quite good,
but if they became more rigid it would turn new people off.
-Marshall
We aren't writing enough INPUT/OUTPUT blocks to describe the input and
output of functions. I want to encourage this very, very strongly
since I think it will make Sage much more usable, and many other
people have requested it. I don't care about "policies" with respect
to this particular discussion at this point. However, if you are
refereeing some code and you see that the INPUT/OUTPUT blocks are
generally lacking, I hope you will feel confident in complaining about
this. I certainly will.
-- William
On Dec 29, 2:32 am, William Stein <wst...@gmail.com> wrote:
> We aren't writing enough INPUT/OUTPUT blocks to describe the input and
> output of functions. I want to encourage this very, very strongly
> since I think it will make Sage much more usable, and many other
> people have requested it. I don't care about "policies" with respect
> to this particular discussion at this point. However, if you are
> refereeing some code and you see that the INPUT/OUTPUT blocks are
> generally lacking, I hope you will feel confident in complaining about
> this. I certainly will.
>
> -- William
Well, OK, if you don't want to formulate a clear policy that's your
prerogative - you're really the only person that can do that. I do
think it might be worthwhile for you to do though. There is a very
clear policy on doctests, that they are required for every function,
and I think that's made a huge difference compared to just encouraging
people to do it. I thought your earlier post was in fact a
formulation of such a policy for INPUT/OUTPUT blocks, and I wanted it
clarified.
Anyway, my apologies if it didn't come across well.