-
-
Notifications
You must be signed in to change notification settings - Fork 704
Update to maxima 5.48 #40679
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
base: develop
Are you sure you want to change the base?
Update to maxima 5.48 #40679
Conversation
|
@tobiasdiez looks like this is still not available in conda, any idea who to ping to make it happen? |
|
Documentation preview for this PR (built with commit a56965b; changes) is ready! 🎉 |
|
Only conda-forge/maxima-feedstock#40 needs to be merged by either @isuruf or @saraedum. |
| -((45/x^2 - 105/x^4 - 1)*sin(x) + 5*(21/x^2 - 2)*cos(x)/x)/x | ||
| sage: integrate(spherical_bessel_J(1,x)^2,(x,0,oo)) | ||
| 1/6*pi | ||
| 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reported this regression upstream at https://sourceforge.net/p/maxima/bugs/4601/
|
You may want to base this on #40574 in case some of the new output changes. I got started with the 5.48.x upgrade but gave up when I realized that not all of the output changes are improvements. (Thinking: we may want to support 5.47.x simultaneously rather than force people to upgrade to a version with regressions, but this is a lot of work). |
|
IMO anything in a |
Since that is already positively reviewed and this will take some time, I will rebase it after the next beta. Besides the non-trivial work of rewriting the doctests, supporting both versions also requires dealing with the |
A bit of dreaming: After #39030, we could have meson write the version of maxima (or actually all dependencies) into |
|
Actually, it looks like we may just drop that CORRECTION: That redefinition is there since the introduction of the maxima lib interface in 970a833, not clear why. Running CI now without it to see if anything breaks. |
|
Seems to be needed: |
It seems to be no longer needed, and requires divergent code for different maxima versions
This reverts commit 66f2485.
7b712e4 to
a58c077
Compare
|
After #40574 it looks like #20467 is back: Reproducible in maxima itself (but only in 5.48): |
|
|
That's because the original: https://sourceforge.net/p/maxima/code/ci/master/tree/src/defint.lisp#l1162 has a conditional to either throw a divergent error or to print a message about using a principal value definition for an integral once. In maxima_lib, that printed message is lost for sure. That's why the printing of the message is changed to the raising of an error. Maxima was not designed to be used as a library. So sometimes it tries to make progress by asking questions interactively. We need to kill that and raise an error instead, since the library use doesn't allow for asking the user for clarification. Similarly (like here), maxima will sometimes compute a specific interpretation of a value that is otherwise undefined and print a message to clarify it did that. We don't have room to support that, so the safest way is to then just raise an error instead. That's why maxima_lib patches the In particular, Removing the patch to |
Yes, see the comment following the one you replied to. |
|
So how do we proceed? Judging from maxima release history i'm afraid we probably won't see a release with the regression fixes for months/years (until 5.49 is released). My suggestion is to add the patches for https://sourceforge.net/p/maxima/bugs/4601/ and https://sourceforge.net/p/maxima/bugs/4603/ to sage-the-distro (and conda if possible). The respective tests will fail in distributions using unpatched 5.48 system packages, but that could serve as a reminder that they are shipping a buggy maxima package. Note that 5.48 also fixes some regressions, cf. https://groups.google.com/g/sage-support/c/pCYoD6x2Y8M |
Oh I do speak it a bit. We can just retrieve the maxima version at runtime and act upon that: I just saw the question about why the override was necessary; I didn't see why it was considered. This should at least be an easy fix. We're monkey-patching maxima at runtime, so it's not so crazy to do the version check at runtime as well, and do something version-dependent. |
How about just rewriting the test to do that assert? You can even do that in the examples. If you want to display the output even when it varies, you can do so and mark it There is |
This is certainly doable, but I worry that the quality of the documentation suffers as the workarounds get more elaborate. If a new user sees, then the purpose is clear, and the user can re-run the example himself to learn how things work. This is obviously contrived, but if instead we have an example like, then he's going to be completely confused as to what most of that has to do with trigonometric integrals. You can leave a comment explaining the boilerplate, but I don't think that necessarily improves the situation. And if the user tries to experiment with this, the results he gets may not be what he's expecting based on the example output. So ultimately, I think "ugly" tests like that are better off being done in pytest, but it's more of a "would be nice" than a "has to be done this way." |
|
In such a situation, perhaps replace the educational example with one that isn't so dependent on the version and move the other test (which is now interesting because different versions of maxima treat it differently) move it to the TESTS section? |
|
Another big problem with in doctests is that in case of a failure, you only get "expected true, got false". No information what was actual the result. The same code in pytest will, in case of failure, actually print out a helpful error message, including the value of actual. |
That would be fine too. At that point I think there are a lot of small benefits to moving the test to pytest:
But we are splitting hairs. I care more about getting rid of the string comparisons that fail every time there's a new version of maxima than I do about the moral purity of the replacement. |
I think you can improve that by writing The argument for doctests was that the tests live in the same spot as the code, increasing the chance the tests get updated when the code changes. For documentation (because of docstrings ...) this will remain the case. If we also use pytest then there is an extra thing for people to keep track of: we'll still have our docstring examples (and test blocks), but no in addition there are the pytest files/functions/classes. So we'd need to have some significant advantages for pytest in the face of the higher cognitive load (note that the people advocating for pytest, by necessity, are already familiar with and used to pytest, so they'll underestimate the load it inflicts on community members that are not). A minor example I can already see is that the test code will not live in a string, so it'll be a little easier to edit/lint tests, so it's quite possible an argument can be made for it and perhaps even a convincing one. |
|
This tests files in parallel, but if there are thousands of tests in one file, it runs them sequentially. It doesn't matter too much if you're testing the entire sage library, but if you're working on a single file and testing it frequently, you can waste a lot of time. For an extreme example, I have 64 very slow cores -- being able to test a single file in parallel can reduce the edit-test-edit cycle from ten minutes to ten seconds. With a lot of work, we could probably make the doctest runner more parallel; but with pytest, someone else has already done it, and (as a bonus) we don't have to maintain the code. Pytest also does not have the limitation that tests for the same method must share an environment. It's not wrong to compute a ton of integrals in the docstring for |
Mostly output format changes, but it is not trivial to make test pass with both old and new versions