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

✨ feat(quantity): add a function is_any_quantity checking isinstance(x, AbstractQuantity) #354

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

nstarman
Copy link
Contributor

@nstarman nstarman commented Dec 23, 2024

This is useful for jax.tree is_leaf filtering.

@nstarman nstarman added this to the v1.1.0 milestone Dec 23, 2024
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.76%. Comparing base (ef1e1d6) to head (52456b6).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #354   +/-   ##
=======================================
  Coverage   97.76%   97.76%           
=======================================
  Files          44       44           
  Lines        1609     1611    +2     
  Branches      315      315           
=======================================
+ Hits         1573     1575    +2     
  Misses         29       29           
  Partials        7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nstarman nstarman requested review from adrn and jnibauer December 23, 2024 21:55
@nstarman nstarman marked this pull request as ready for review December 23, 2024 21:55
@nstarman
Copy link
Contributor Author

@nstarman nstarman closed this Dec 29, 2024
@nstarman nstarman reopened this Dec 29, 2024
@nstarman
Copy link
Contributor Author

nstarman commented Jan 7, 2025

Ping @adrn @jnibauer.
See https://docs.kidger.site/equinox/api/manipulation/#equinox.is_array and similar for the inspiration for this PR.

@nstarman nstarman force-pushed the quantity/is_quantity branch from 225df5b to 37602ac Compare January 21, 2025 00:11
…x, AbstractQuantity)

This is useful for type checking, and also for jax.tree is_leaf filtering.

Signed-off-by: Nathaniel Starkman <[email protected]>
@nstarman nstarman force-pushed the quantity/is_quantity branch from 37602ac to 52456b6 Compare January 21, 2025 00:11
@nstarman nstarman merged commit 49de864 into GalacticDynamics:main Jan 22, 2025
23 checks passed
@nstarman nstarman deleted the quantity/is_quantity branch January 22, 2025 17:37
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.

2 participants