Skip to content
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

jax.scipy.special: manually document functions to avoid scipy import #20822

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

jakevdp
Copy link
Collaborator

@jakevdp jakevdp commented Apr 18, 2024

This lets us give more implementation-specific information, and lets us avoid a dependency on scipy. Related to #20799.

Preview rendered docstrings here: https://jax--20822.org.readthedocs.build/en/20822/jax.scipy.html#module-jax.scipy.special

Part of #21461.

Copy link
Collaborator

@hawkinsp hawkinsp left a comment

Choose a reason for hiding this comment

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

Same general comments on these:

  • use type links where possible for Array and ArrayLike
  • at least link to definition of the math in each case (Wikipedia being good), although having formulae is better where we can.
  • an example would be peachy.

Doable?

@jakevdp
Copy link
Collaborator Author

jakevdp commented Apr 22, 2024

It's all doable, it's just about how much time we want to invest

use type links where possible for Array and ArrayLike

This is done automatically by sphinx; e.g. https://jax--20822.org.readthedocs.build/en/20822/_autosummary/jax.scipy.special.bernoulli.html#jax.scipy.special.bernoulli

at least link to definition of the math in each case

I linked to the numpy documentation in each case, which generally includes the math. Is that sufficient?

@jakevdp
Copy link
Collaborator Author

jakevdp commented Apr 22, 2024

Mathematical definitions added

@jakevdp jakevdp requested a review from hawkinsp April 22, 2024 20:00
@jakevdp jakevdp force-pushed the scipy-special-doc branch 3 times, most recently from 34d2369 to 4c28a01 Compare April 29, 2024 16:23
jax/_src/scipy/special.py Outdated Show resolved Hide resolved
jax/_src/scipy/special.py Outdated Show resolved Hide resolved
jax/_src/scipy/special.py Outdated Show resolved Hide resolved
@google-ml-butler google-ml-butler bot added kokoro:force-run pull ready Ready for copybara import and testing labels Apr 29, 2024
This lets us give more implementation-specific information, and
lets us avoid a needless dependency on scipy.
@copybara-service copybara-service bot merged commit 1b5c49e into jax-ml:main Apr 29, 2024
13 checks passed
@jakevdp jakevdp deleted the scipy-special-doc branch April 29, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation pull ready Ready for copybara import and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants