Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: special: Add inverse of digamma function#25188

Open
fbourgey wants to merge 13 commits into
scipy:mainfrom
fbourgey:xsf/add_digamma_inv
Open

ENH: special: Add inverse of digamma function#25188
fbourgey wants to merge 13 commits into
scipy:mainfrom
fbourgey:xsf/add_digamma_inv

Conversation

@fbourgey
Copy link
Copy Markdown
Member

@fbourgey fbourgey commented May 20, 2026

Reference issue

Closes #17507

What does this implement/fix?

Additional information

AI Generation Disclosure

Codex helped me with the move and the doc as a draft. I've then updated the code, and added the examples.

@fbourgey fbourgey requested a review from steppi as a code owner May 20, 2026 21:35
@github-actions github-actions Bot added scipy.stats scipy.special C/C++ Items related to the internal C/C++ code base Cython Issues with the internal Cython code base enhancement A new feature or improvement labels May 20, 2026
Copy link
Copy Markdown
Contributor

@dschmitz89 dschmitz89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @fbourgey !

I get similar refguide check issues in #25161 . Could you weigh in there @j-bowhay as they come from numpydoc?

Tests and python wrappers here look fine to me. What is missing cython_special testing. There are two places that need to be updated accordingly:

  • scipy/special/tests/test_cython_abi.py
  • scipy/special/tests/test_cython_special.py

@j-bowhay
Copy link
Copy Markdown
Member

You will need to add a skip here:

compiled_code_skips = { # compiled code ignores "numpydoc ignore=" comments"

@fbourgey
Copy link
Copy Markdown
Member Author

Thanks again @fbourgey !

I get similar refguide check issues in #25161 . Could you weigh in there @j-bowhay as they come from numpydoc?

Tests and python wrappers here look fine to me. What is missing cython_special testing. There are two places that need to be updated accordingly:

  • scipy/special/tests/test_cython_abi.py
  • scipy/special/tests/test_cython_special.py

Thanks for the review @dschmitz89!

Is there a policy that new scalar special ufuncs should also be exposed through cython_special, or should this one remain Python-only? I think psi is already in cython_specialm so this might be natural. If so, I will add it to SciPy's Cython API.

I have decided to change the name to digammainv for consistency with other inverse functions.

@steppi
Copy link
Copy Markdown
Member

steppi commented May 21, 2026

Is there a policy that new scalar special ufuncs should also be exposed through cython_special, or should this one remain Python-only? I think psi is already in cython_specialm so this might be natural. If so, I will add it to SciPy's Cython API.

Indeed. New private functions don't have to go into cython_special but new public functions should.

@fbourgey
Copy link
Copy Markdown
Member Author

Is there a policy that new scalar special ufuncs should also be exposed through cython_special, or should this one remain Python-only? I think psi is already in cython_specialm so this might be natural. If so, I will add it to SciPy's Cython API.

Indeed. New private functions don't have to go into cython_special but new public functions should.

OK, thanks. Let me know if this the correct approach. I ran python tools/generate_cython_abi_tests.py special to regenerate special.tests.test_cython_abi.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C/C++ Items related to the internal C/C++ code base Cython Issues with the internal Cython code base enhancement A new feature or improvement scipy.special scipy.stats

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: Add an inverse digamma function

4 participants