Repository navigation
release: v0.6.0 — unit display redesign, JAX 0.12 support, core correctness pass - #147
Merged
Merged
Conversation
…ctness pass - Redesign unit composition, display and parsing around structured terms: composites display as written, curated auto-simplification plus Unit.simplify()/Quantity.simplify(), exact rational exponents, round-trip parsing, Unicode/LaTeX rendering (#146). - JAX 0.12 compatibility: NumPy 2 __array__(copy=), guarded private imports, public custom_jvp and sparse APIs (#145). - Core Quantity/Unit/Dimension correctness fixes (#140, #145) and measured CuPy backend support (#141); docs taxonomy and backend outputs (#142). - Require Python >= 3.12 and jax >= 0.9.0; mmHg is no longer an alias of torr.
Contributor
Reviewer's GuideThis release bumps saiunit to 0.6.0 and replaces the unreleased notes with a comprehensive implementation and migration summary covering the unit display redesign, JAX 0.12 compatibility, core correctness fixes, backend/documentation updates, new APIs, and breaking changes. Sequence diagram for JAX-compatible quantity operationssequenceDiagram
participant JAX
participant Quantity
participant CustomJVP
participant SparseAPI
JAX->>Quantity: __array__(copy=copy)
Quantity-->>JAX: NumPy array
JAX->>CustomJVP: custom_jvp
CustomJVP-->>JAX: differentiated exprel
JAX->>SparseAPI: COO/CSR operation
SparseAPI-->>JAX: sparse result
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="changelog.md" line_range="11" />
<code_context>
+compatibility with JAX 0.12, and lands a broad correctness pass over
+``Quantity``, ``Unit`` and ``Dimension``. Composite units now display the way
+they were written (``mV * ms`` stays ``ms * mV`` instead of collapsing to
+``uWb``), every display string parses back to an equal unit, and units can be
+rendered as Unicode or LaTeX. CuPy is now a measured, supported backend.
+
</code_context>
<issue_to_address>
**LaTeX unit strings do not parse**
When a caller passes `Unit.to_string('latex')` output to `parse_unit`, `parse_unit` rejects LaTeX output with `ValueError`, despite the release highlight promising that every display string round-trips, so callers relying on that promise fail.
Limit the round-trip claim to the formats accepted by `parse_unit`, or add LaTeX parsing support.
</issue_to_address>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bump the version to 0.6.0 and add release notes covering everything since v0.5.2:
Unit.simplify()/Quantity.simplify(). Exponents stay exact (mV^(1/3)), every display string parses back to an equal unit, and units render as Unicode or LaTeX.__array__(copy=), guarded private imports, and the publiccustom_jvpand sparse APIs.**,factorless(), overflow handling, and more.jax >= 0.9.0; some display strings andu.mathsemantics changed;mmHgis no longer an alias oftorr. Details are inchangelog.md.Test plan
pytest saiunit/: 4178 passed, 193 skippedmypy saiunit/cleansaiunit.__version__ == "0.6.0"Summary by Sourcery
Release version 0.6.0 with redesigned unit displays, broader backend compatibility, and comprehensive core correctness improvements.
New Features:
Bug Fixes:
Enhancements:
CI:
Documentation:
Tests:
Chores: