-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Tracking issue: inline docstrings #21461
Comments
Looking forward to it!
IANAL, but isn't Numpy under a 3-clause BSD license, which is Apache-compatible? The Apache Software Foundation itself seems to allow 3-clause BSD code within Apache Software Foundation projects licensed under the Apache license: https://www.apache.org/legal/resolved.html |
IANAL either, which is why I do not specualate on such things 😁. But for reasons I won't get into, rewriting from scratch is the way we need to do it here. |
…ng, jnp.kaiser Part of #21461 PiperOrigin-RevId: 676866721
…ng, jnp.kaiser Part of jax-ml#21461 PiperOrigin-RevId: 676866721
For many public APIs, JAX currently uses the
jax._src.numpy.util.implements
helper to define docstrings dynamically at runtime. This has several drawbacks:jax.scipy
importsscipy
), and this adds to the import-time startup cost.implements
decorator, despite being correctly annotated, can cause some type checkers to not recognize the input/output annotations of the wrapped function (this has been observed withpytype
)The
implements
decorator was originally added as a way to quickly bootstrap development of thejax.numpy
API, but that is no longer necessary. For all these reasons, we'd like to migrate to static, JAX-specific inline docstrings.A challenge here is that we cannot simply copy and modify the existing dynamic docstrings: they come from
numpy
, and for licensing reasons, we cannot replicate NumPy docstring verbiage within the JAX repository. For this reason, each docstring must be rewritten from scratch, without referencing the text of the NumPy version of the documentation.The text was updated successfully, but these errors were encountered: