Skip to content

release: v0.6.0 — unit display redesign, JAX 0.12 support, core correctness pass - #147

Merged
chaoming0625 merged 2 commits into
mainfrom
release/v0.6.0
Oct 21, 2026
Merged

chaoming0625 merged 2 commits into
mainfrom
release/v0.6.0

Conversation

@chaoming0625

@chaoming0625 chaoming0625 commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Bump the version to 0.6.0 and add release notes covering everything since v0.5.2:

Test plan

  • pytest saiunit/: 4178 passed, 193 skipped
  • mypy saiunit/ clean
  • saiunit.__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:

  • Redesign unit composition and display with exact exponents, round-trip parsing, Unicode/LaTeX rendering, and explicit simplification APIs.
  • Add compatibility with JAX 0.12 and measured CuPy backend support.

Bug Fixes:

  • Correct core Quantity, Unit, and Dimension behavior across ufunc dispatch, reflected operators, zero handling, unit factors, conversions, overflow, and array operations.
  • Correct the distinction between mmHg and torr and align math operations with NumPy and JAX semantics.

Enhancements:

  • Raise the minimum supported versions to Python 3.12 and JAX 0.9, and update the public API and behavior for the 0.6.0 release.

CI:

  • Strengthen tests by treating deprecation warnings from saiunit code as failures.

Documentation:

  • Expand release notes and update API taxonomy, backend support information, tutorials, and constants documentation.

Tests:

  • Update backend notebooks and the feature support matrix with measured outputs.

Chores:

  • Improve unit generation tooling and add unit-display benchmarking support.

…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.
@sourcery-ai

sourcery-ai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This 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 operations

sequenceDiagram
    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
Loading

File-Level Changes

Change Details Files
Documents the 0.6.0 release contract and all user-visible behavior changes.
  • Replaces the unreleased notes with categorized release notes for unit display, parsing, simplification, formatting, math semantics, core correctness, JAX, CuPy, documentation, and tooling.
  • Calls out breaking requirements and compatibility changes, including Python/JAX minimums, ASCII display defaults, changed math behavior, pickle compatibility, and the mmHg/torr split.
  • Describes new public APIs and removed private helpers.
changelog.md
Updates the package version to 0.6.0.
  • Sets version to 0.6.0.
  • Keeps version_info derived from the version string.
saiunit/_version.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread changelog.md Outdated
@chaoming0625
chaoming0625 merged commit 3fe5b49 into main Oct 21, 2026
8 checks passed
@chaoming0625
chaoming0625 deleted the release/v0.6.0 branch October 21, 2026 10:49
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.

1 participant