Skip to content

Conversation

@nstarman
Copy link
Contributor

No description provided.

@nstarman nstarman added this to the v1.10.0 milestone Jan 13, 2026
Copilot AI review requested due to automatic review settings January 13, 2026 19:12
@nstarman nstarman changed the title ✨ feat(all): uconvert_value for value conversion, not requiring Quantity ✨ feat(all): uconvert_value for value conversion, not requiring Quantity Jan 13, 2026
@github-actions github-actions bot added 📝 Add / update documentation Add or update documentation. ✅ Add / update / pass tests Add, update, or pass tests. ✨ Introduce new features Introduce new features. labels Jan 13, 2026
@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 98.43750% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.84%. Comparing base (1977618) to head (424e71e).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/unxt/_interop/unxt_interop_astropy/quantity.py 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #550      +/-   ##
==========================================
- Coverage   96.90%   96.84%   -0.06%     
==========================================
  Files          54       44      -10     
  Lines        2260     2158     -102     
  Branches       82       77       -5     
==========================================
- Hits         2190     2090     -100     
+ Misses         53       52       -1     
+ Partials       17       16       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new uconvert_value function that performs unit conversions on raw numerical values without requiring Quantity objects. This is a lower-level function compared to uconvert, enabling high-performance batch conversions and seamless integration with JAX transformations.

Changes:

  • Added uconvert_value as an abstract dispatch function to the unxt-api package
  • Implemented multiple dispatches for different unit type combinations (strings, AbstractUnit, AbstractUnitSystem)
  • Added Astropy interop support with hot-path optimization for identical units
  • Provided comprehensive test coverage including JAX transformations, edge cases, and error handling
  • Updated documentation with detailed API reference and usage examples

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/unxt-api/src/unxt_api/_src/quantity.py Adds abstract uconvert_value dispatch function definition
packages/unxt-api/src/unxt_api/__init__.py Exports uconvert_value from the API package
packages/unxt-api/tests/test_quantity.py Tests for abstract dispatch functionality of uconvert_value
packages/unxt-api/tests/test_package.py Verifies uconvert_value is properly exported
packages/unxt-api/docs/api.md Comprehensive documentation for the new function
src/unxt/_src/quantity/register_api.py Implements dispatches for unit systems, strings, AbstractUnit, and convenience Quantity dispatch
src/unxt/_interop/unxt_interop_astropy/quantity.py Adds Astropy unit support with hot-path optimization
src/unxt/quantity.py Exports uconvert_value from main package
src/unxt/__init__.py Adds uconvert_value to top-level exports
src/unxt/_src/quantity/base.py Refactors to use uapi prefix for consistency
tests/unit/test_quantity.py Extensive tests for all uconvert_value dispatches
tests/unit/test_astropy_interop_quantity.py Tests for Astropy interop including JAX transformations
docs/interop/astropy.md Documentation for Astropy integration
docs/guides/quantity.md User guide with examples and best practices

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

@nstarman nstarman merged commit 7f06a37 into GalacticDynamics:main Jan 13, 2026
34 of 35 checks passed
@nstarman nstarman deleted the uconvert_value branch January 13, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📝 Add / update documentation Add or update documentation. ✅ Add / update / pass tests Add, update, or pass tests. ✨ Introduce new features Introduce new features. ⏱️ Run benchmarks Run benchmarks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant