Skip to content

Redundant integrate() & integral() in functional.py and integral.py #21667

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

Open
sagetrac-mafra mannequin opened this issue Oct 8, 2016 · 2 comments
Open

Redundant integrate() & integral() in functional.py and integral.py #21667

sagetrac-mafra mannequin opened this issue Oct 8, 2016 · 2 comments

Comments

@sagetrac-mafra
Copy link
Mannequin

sagetrac-mafra mannequin commented Oct 8, 2016

The motivation for this ticket is that the documentation for

integral?

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.

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 integral? or integrate?

Looking more closely, having the integrate() functions in both files seems redundant. One does integrate = integral and the other does integral = integrate at the end of their definitions.

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).

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?

But again, the underlying motivation was about the poorer documentation from functional.py

Component: symbolics

Issue created by migration from https://trac.sagemath.org/ticket/21667

@sagetrac-mafra sagetrac-mafra mannequin added this to the sage-7.4 milestone Oct 8, 2016
@sagetrac-mafra
Copy link
Mannequin Author

sagetrac-mafra mannequin commented Oct 8, 2016

comment:1

I have prepared a preliminary patch (not to be applied) just to give an idea about what I meant above.

With the patch applied I get the (more helpful) documentation from integral.py upon integral?. 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.

So this patch also implies that integrate is no longer valid, and one should use integral only. That of course will break many tests (which could be fixed by sed 's/integrate/integral/'), 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 Integrate). IMHO, I think that Sage should allow only one name (my preferred choice would be integrate).

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.

In any case, I realize that deprecating integral 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.

@sagetrac-mafra
Copy link
Mannequin Author

sagetrac-mafra mannequin commented Oct 8, 2016

Attachment: 0001-remove-def-integral-from-functional.py.patch.gz

Remove redundant definition of integral from functional.py

@mkoeppe mkoeppe removed this from the sage-7.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant