Unit overhaul 6/6: ExpressionComponent physical constants and parameter units#227
Open
henrikjacobsenfys wants to merge 1 commit into
Open
Unit overhaul 6/6: ExpressionComponent physical constants and parameter units#227henrikjacobsenfys wants to merge 1 commit into
henrikjacobsenfys wants to merge 1 commit into
Conversation
This was referenced Jul 6, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## split/02d-fit-binding #227 +/- ##
=========================================================
+ Coverage 98.28% 98.48% +0.20%
=========================================================
Files 53 53
Lines 3897 4037 +140
Branches 660 697 +37
=========================================================
+ Hits 3830 3976 +146
+ Misses 39 33 -6
Partials 28 28
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
928927a to
115f419
Compare
54d558e to
49f8659
Compare
Provide `hbar`/`kb` as read-only physical constants when they appear in an expression, allow per-parameter units via `parameter_units`, derive the expression's output unit and warn when it disagrees with y_unit, and make parameters dimensionless by default. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
115f419 to
508ba38
Compare
49f8659 to
4919c02
Compare
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.
Add physical constants and per-parameter units to
ExpressionComponent:hbar(meV·s) andkb(meV/K) are provided automatically as read-only constants when their symbol appears in an expression;parameter_unitssets a unit per parameter without rescaling; the expression's output unit is derived from the parameter units andx_unitand a warning is issued when it disagrees withy_unit; parameters are dimensionless by default.Split out of the unit-system overhaul as an independent feature stacked on the core rename (#224) and the FitBinding redesign (#226).
Also advances
components.ipynbto demonstrate theExpressionComponentparameter_unitsAPI; the tutorial notebooks run green undertutorial-testson this branch.All unit tests pass.
Stack — splitting the monolithic "Unit system overhaul" (#217) into a reviewable series. Merge bottom-up:
develop(Unit overhaul 1/6: Add unit-conversion utilities and FitTarget #221)verify_Q_index→split/01-unit-utils(Unit overhaul 2/6: Centralize Q-index validation via verify_Q_index #222)Variablein 1/angstrom →split/02a-verify-q-index(Unit overhaul 3/6: Store Q as a scipp Variable in 1/angstrom #223)unitintox_unit/y_unit+ tutorials →split/02b-q-variable(Unit overhaul 4/6: Separate unit into x_unit/y_unit and update tutorials #224)split/02c-unit-rename(Unit overhaul 5/6: Redesign FitBinding around FitTargets #226)split/02d-fit-binding(Unit overhaul 6/6: ExpressionComponent physical constants and parameter units #227)🤖 Generated with Claude Code