CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
lambdify: Included scipy backend automatically and added relevant functions #14992
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
Conversation
Added relevant scipy.special functions to sympy/sympy/printing/pycode.py Added use of SciPy printer to lambdify Added fix so that lambdify automatically uses scipy if available (issue 7229) Added tests to sympy/utilities/tests/test_lambdify.py Fixed error in sympy/sympy/printing/pycode.py, replacing lgamma with loggamma in the _not_in_numpy list
âś… Hi, I am the SymPy bot (v124). I'm here to make sure this pull request has a release notes entry. Please read the guide on how to write release notes. Click here to see the pull request description that was parsed.
Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.2.1. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Update The release notes on the wiki have been updated. |
Modified earlier commit so that mpmath would not be affected
Hi, I've added the relevant scipy.special functions, added SciPyPrinter in lambdify and made lambdify default to scipy if available based on the discussion in #7229. Please let me know if this is accurate and what else needs to be done. Also, in the testing file, one of the functions I added was test_scipy_transl(), similar to test_numpy_transl() which was already there - however, neither of these functions seem to be doing anything because both the numpy and scipy translation dictionaries are empty. Should they still be there? Thanks! |
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.
Looks good to me. Perhaps we should set numpy.random.seed
sympy/utilities/lambdify.py
Outdated
else: | ||
modules = ["numpy"] | ||
modules = ["scipy"] |
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.
Shouldn't it be ["scipy", "numpy"]
?
You need to write out "fixes" separately for each issue in the PR description so they will all be automatically closed. |
Added numpy to namespace with scipy Changed printer order Added random seed in lambdify test
I've updated the pull request according to the reviews:
However, exactly one Travis test is failing right now and it seems to be a random failure unrelated to the fix - could this test be re-run? Thanks |
Yes, I restarted the test, thank you for telling. |
@ramvenkat98 thank you very much for your contribution (and sorry for the wait) |
@ramvenkat98
|
@GProtoZeroW @asmeurer @bjodah When using the version of sympy pulled from Github, I don't get this error; however, when using sympy installed as the Anaconda package, I do. Perhaps, this is because this issue has already been fixed on Github but did not make it to the currently released version? |
SymPy 1.1.1 is available from the default channel for Anaconda. If you want SymPy >=1.2 you need to install from the conda-forge channel (at least until the default get updated). |
@ramvenkat98 I did the Anaconda install I will have to do the github one to test out. And thanks for adding scipy to lambdfiy it's been needed. Just two questions: one does |
@GProtoZeroW I'm not sure of the answers to those questions - you could ask them on the sympy google group, or make feature requests for them - to my knowledge, Heaviside hasn't been mapped from sympy to numpy but it certainly seems useful. |
References to other Issues or PRs
Fixes #7229
Fixes #14973
Fixes #14975
Referred to PR 10319
Brief description of what is fixed or changed
Added relevant scipy.special functions to sympy/sympy/printing/pycode.py
Added use of SciPy printer to lambdify
Added fix so that lambdify automatically uses scipy if available
Added tests to sympy/utilities/tests/test_lambdify.py
Fixed error in sympy/sympy/printing/pycode.py, replacing lgamma with
loggamma in the _not_in_numpy list
Other comments
Release Notes