Skip to content

Use exact eV and u constants, add the stone plural, document da - #34

Merged
m-messer merged 2 commits into
mainfrom
fix/unit-table-constants
Dec 1, 2026
Merged

m-messer merged 2 commits into
mainfrom
fix/unit-table-constants

Conversation

@m-messer

@m-messer m-messer commented Dec 1, 2026

Copy link
Copy Markdown
Member

Fixes #23.

Changes

In physical_quantities/data.py:

Unit Before After
electronvolt 1.60218e-19 J 1.602176634e-19 J (exact since the 2019 SI redefinition)
atomic_mass_unit 1.66054e-27 kg 1.66053906892e-27 kg (CODATA 2022)
stone no plurals ("stones",)

da: a bare da is still read as d (deci) + a (are), a deci-are of 10 m², not as the deca prefix on its own. Grades don't change. The reading is now documented in a comment next to are, pinned by a test and noted in the CHANGELOG. Feedback warning about it can come in a later PR.

Tests

  • New TestUnitTableValues in tests/test_api.py: 1 eV, 1 u, 2 stones and 1 da against their SI values (relative tolerance 1e-12), and 2 stones parses with unit stone.
  • The eV, u and stone-plural tests fail on main and pass with this change.
  • The physical_quantities suite passes (547 tests), and ruff check, ruff format --check and mypy pass.

Related

🤖 Generated with Claude Code

m-messer and others added 2 commits December 1, 2026 11:44
- electronvolt: 1.602176634e-19 J (exact since the 2019 SI redefinition)
- atomic_mass_unit: 1.66053906892e-27 kg (CODATA 2022)
- stone: recognise the plural "stones"
- A bare "da" stays a deci-are; documented and pinned by a test

Fixes #23

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The v0.1 parity check flagged the 12 eV/u probes (10 eV, 10 electronvolt,
10 u, 10 atomic_mass_unit in strict_all, natural and legacy modes), which
change on purpose with the exact constants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@m-messer
m-messer merged commit 55f7100 into main Dec 1, 2026
8 checks passed
@m-messer
m-messer deleted the fix/unit-table-constants branch December 1, 2026 13:09
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.

Unit table: inexact eV and u constants, the da reading, and a missing stone plural

1 participant