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

Type hint at property in basearray.pyi #14909

Closed
soraros opened this issue Mar 10, 2023 · 4 comments · Fixed by #14927
Closed

Type hint at property in basearray.pyi #14909

soraros opened this issue Mar 10, 2023 · 4 comments · Fixed by #14927
Assignees
Labels
enhancement New feature or request

Comments

@soraros
Copy link

soraros commented Mar 10, 2023

Type hint jax.Array.at to aid IDEs.

Didn't submit a PR directly because

  1. Not sure if there is any circular import issue
  2. _IndexUpdateHelper is in internal, do we change the name or __name__ to make it look better?

General question for JAX developers: is there a 'canonical' name for the at-properties? jax.Array.at is not convenient for verbal communication. Maybe, functional array index accessor? I really want a name that is searchable, and I could refer to, say when answering questions in Github discussions.

@soraros soraros added the enhancement New feature or request label Mar 10, 2023
@jakevdp
Copy link
Collaborator

jakevdp commented Mar 10, 2023

Thanks for raising this! I think I left this out because circular imports make it tricky, but we should be able to figure it out.

The name we use now is "index update helper", but that's a bit of a mouthful. If you search for "jnp.ndarray.at" you find this page: https://jax.readthedocs.io/en/latest/_autosummary/jax.numpy.ndarray.at.html

We'd be open to suggestions for making that more discoverable.

@jakevdp jakevdp self-assigned this Mar 10, 2023
@soraros
Copy link
Author

soraros commented Mar 10, 2023

The name we use now is "index update helper"

I don't think it's a bad name. As for discoverability, I'd suggest inserting the exact phrase in ndarray.at document, Array class, jax.ops document, and maybe also in the shape bits. Something like

Index update helper
 or the `.at`-property

in CS paper title fashion.

I was trying to sell the array-api people this api, now I can tell them the name of the product.

@jakevdp
Copy link
Collaborator

jakevdp commented Mar 10, 2023

Unfortunately, the header on the ndarray.at doc page is generated by sphinx autodoc, so it's not easy to change it. We can certainly add more words in the dosctring though.

@soraros
Copy link
Author

soraros commented Mar 10, 2023

We can certainly add more words in the dosctring though.

Yes, this is what I meant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants