-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
lambdify loggamma now works for mpmath #19913
Conversation
✅ Hi, I am the SymPy bot (v160). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. 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.7. 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. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
Codecov Report
@@ Coverage Diff @@
## master #19913 +/- ##
=============================================
- Coverage 75.811% 71.344% -4.468%
=============================================
Files 668 668
Lines 173237 173186 -51
Branches 40841 40842 +1
=============================================
- Hits 131334 123558 -7776
- Misses 36172 43777 +7605
- Partials 5731 5851 +120 |
As |
You need to change the mpmath specific lines I linked to above. |
What exactly do I have to change in that line of code. |
Updating the dictionary to correct the lgamma key on the next line would probably do the trick. |
well, I actually did that. |
You should add to |
|
This sounds ideal to me - this effectively does delete the previous entry. |
Is it good to go now? |
No. You need to add |
oh! Sorry, I am on it. |
This fix now looks correct - can you add a test next to the other python code printer tests? |
Testcase for this |
Also, do I have to add a test in |
Yes, please add a test to that file. Simply checking the result of something like |
Ok Thanks, can I make a separate function for that? |
Or I have to add that in |
|
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.
Release notes need updating to describe what was fixed (and not how), but the code is good.
But it got AssertionError. I don't know why that's happen |
I have updated the release notes please review it. Thanks!! |
Still not quite right - will defer to @oscarbenjamin, since they reported the original bug. |
It looks like this fixes the original issue. What is not quite right? Is it the release note? Maybe it should say:
|
Yeah, just the release note which decribed the diff not the result. That looks like a good note to me. |
Although I think it was ImportError |
Maybe there could also be a test for lambdify |
So do I have to include a test for lambdify also? |
@oscarbenjamin or @eric-wieser Do I have to add Test in |
Is this |
Yes, that seems good. You could test that it gives a couple of expected values for the loggamma function. |
Yes, tried different values for x and it gives the expected output. So Is one test case is sufficient or I have to add more than one test for lambdify. |
@oscarbenjamin I have added the test case please review it. |
Looks good |
Thanks! |
@oscarbenjamin any other change, you wanted in this PR. |
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 , @oscarbenjamin please review this PR
@oscarbenjamin Is this good to go? |
Looks good. Thanks! |
References to other Issues or PRs
Fixed #17411
Brief description of what is fixed or changed
Lambdifying an expression with loggamma doesn't work for mpmath previously but I made some fixes so that it works. File changed are pycode and test_pycode.
Other comments
Nan
Release Notes
loggamma
function.loggamma
using mpmath no longer raisesImportError
.