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

Update jaxsim.typing module #71

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Update jaxsim.typing module #71

merged 1 commit into from
Jan 31, 2024

Conversation

diegoferigo
Copy link
Member

@diegoferigo diegoferigo commented Jan 31, 2024

The current jaxsim.typing module is rather old, it was developed when jax.Array and jax.typing.ArrayLike did not exist.

Now that we have them, we can transition towards something more readable. I propose the following target:

  • Use jaxsim.typing.*Like for type hinting input arguments that might be python scalars, numpy arrays, or jax arrays (note that static arguments must be hashable and therefore cannot be arrays).
  • Use jaxsim.typing.* (without Like) for type hinting output arguments, that are all jax numpy arrays.

We currently have jaxsim.typing.*Jax for jax-only types, that should be ported to their corresponding types without the Jax suffix.


📚 Documentation preview 📚: https://jaxsim--71.org.readthedocs.build/en/71/

Copy link
Collaborator

@flferretti flferretti left a comment

Choose a reason for hiding this comment

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

LGTM

@diegoferigo diegoferigo merged commit c2c7f6a into main Jan 31, 2024
21 checks passed
@diegoferigo diegoferigo deleted the feature/typing_updates branch January 31, 2024 16:51
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.

None yet

2 participants