Sage: Ticket #21667: Redundant integrate() & integral() in functional.py and integral.py
https://trac.sagemath.org/ticket/21667
<p>
The motivation for this ticket is that the documentation for
</p>
<pre class="wiki">integral?
</pre><p>
didn't mention very explicitly the different algorithms (it omits 'fricas', for example). The documentation that appears above is from the file
misc/functional.py.
</p>
<p>
However, grep'ing around I found out that there is a much better documentation in the integral() definition in sage/symbolic/integration/integral.py
but it simply never appears upon eitheir <code>integral?</code> or <code>integrate?</code>
</p>
<p>
Looking more closely, having the integrate() functions in both files seems redundant. One does <code>integrate = integral</code> and the other does <code>integral = integrate</code> at the end of their definitions.
</p>
<p>
My first reaction was to kill the definition from misc/functional.py
but I get a compilation error related to the docbuild(!) which I could not understand where it is coming from (yet).
</p>
<p>
So before going on with killing integral() from misc/functional.py (and obtaining the much better documentation from integral.py as a result) I would like to ask more experienced Sage developers what they think about this. Is this unification recommended or is it a stupid thing to try?
</p>
<p>
But again, the underlying motivation was about the poorer documentation from functional.py
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/21667
Trac 1.1.6mafraSat, 08 Oct 2016 17:47:09 GMT
https://trac.sagemath.org/ticket/21667#comment:1
https://trac.sagemath.org/ticket/21667#comment:1
<p>
I have prepared a preliminary patch (not to be applied) just to give an idea about what I meant above.
</p>
<p>
With the patch applied I get the (more helpful) documentation from integral.py upon <code>integral?</code>. Of course I could have just moved the text from integral.py to functional.py, but I thought that a bit of cleanup could be interesting.
</p>
<p>
So this patch also implies that <code>integrate</code> is no longer valid, and one should use <code>integral</code> only. That of course will break many tests (which could be fixed by <code>sed 's/integrate/integral/'</code>), but the point I want to raise is whether it is desirable to have two names for the same thing (for what it's worth, Mathematica admits only <code>Integrate</code>). IMHO, I think that Sage should allow only one name (my preferred choice would be <code>integrate</code>).
</p>
<p>
Of course, this patch is very preliminary. For example, I used the lazy_import() in all.py because I didn't know how to do it properly. This should be fixed I guess.
</p>
<p>
In any case, I realize that deprecating <code>integral</code> is a major decision. But the current situation with duplicated functions is not optimal (again imho). After my patch here I tested many integrals from examples in the sage source and they all worked the same way (provided integrate -> integral). So I guess that proves that there is some redundancy in the current code, and the documentation suffers from it.
</p>
TicketmafraSat, 08 Oct 2016 17:48:22 GMTattachment set
https://trac.sagemath.org/ticket/21667
https://trac.sagemath.org/ticket/21667
<ul>
<li><strong>attachment</strong>
set to <em>0001-remove-def-integral-from-functional.py.patch</em>
</li>
</ul>
<p>
Remove redundant definition of integral from functional.py
</p>
Ticket