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

removing repeated average function implementation and docs rendering #13855

Closed
wants to merge 1 commit into from

Conversation

fnhirwa
Copy link
Contributor

@fnhirwa fnhirwa commented Jan 4, 2023

Closes #13853

The function jax.numpy.average is repeated many times on the documentation page jax.numpy.average

This PR removes duplicated code that caused the issue
Thanks

@jakevdp
Copy link
Collaborator

jakevdp commented Jan 4, 2023

Thanks - I don't think this is the right fix. These typing overloads do serve a purpose: they ensure that when the function is used in typechecked code, the static type checker can infer the correct number of outputs. If your goal is fixing the docs, I'd suggest modifying the docs rather than the source code.

This documentation is generated via sphinx autodoc: perhaps that extension has settings that control how overloaded function definitions are displayed?

@jakevdp jakevdp self-assigned this Jan 4, 2023
@fnhirwa
Copy link
Contributor Author

fnhirwa commented Jan 4, 2023

Yeah sure it is the issue with sphinx
you're right there might be support for this as if it is many overloads it may seem very weird

@jakevdp
Copy link
Collaborator

jakevdp commented Jan 4, 2023

#13860 improves the situation somewhat by preserving the ArrayLike alias rather than printing out the full union it represents.

@fnhirwa
Copy link
Contributor Author

fnhirwa commented Jan 4, 2023

I think as these function overloading are needed we can close this PR

@fnhirwa fnhirwa closed this Jan 5, 2023
@fnhirwa fnhirwa deleted the fix-average branch January 11, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The jax.numpy.average function is rendering repeatedly in Docs
2 participants