Unit overhaul 4/6: Separate unit into x_unit/y_unit and update tutorials#224
Open
henrikjacobsenfys wants to merge 2 commits into
Open
Unit overhaul 4/6: Separate unit into x_unit/y_unit and update tutorials#224henrikjacobsenfys wants to merge 2 commits into
henrikjacobsenfys wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## split/02b-q-variable #224 +/- ##
========================================================
+ Coverage 97.47% 98.66% +1.18%
========================================================
Files 53 53
Lines 3687 3892 +205
Branches 640 664 +24
========================================================
+ Hits 3594 3840 +246
+ Misses 62 29 -33
+ Partials 31 23 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Jul 6, 2026
3bae91e to
b220e65
Compare
This was referenced Jul 6, 2026
b220e65 to
dec68e6
Compare
Replace the single `unit` on EasyDynamicsModelBase with independent `x_unit` (axis, default meV) and `y_unit` (output, default dimensionless), and migrate every subclass in the hierarchy. `convert_unit` becomes `convert_x_unit`/`convert_y_unit`, and `evaluate` gains an `output='numpy'|'scipp'` selector. Includes tutorial-notebook updates. Core of the unit-system overhaul; the FitBinding/FitTarget redesign and ExpressionComponent physical constants are split into follow-up PRs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dec68e6 to
879cc94
Compare
henrikjacobsenfys
added a commit
that referenced
this pull request
Jul 7, 2026
1c18a26 to
2aa65b8
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.
Replace the single
unitonEasyDynamicsModelBasewith independentx_unit(axis, default meV) andy_unit(output, default dimensionless), and migrate every subclass in the hierarchy: components, diffusion models, convolution, instrument/resolution/sample/background models, experiment and analysis.convert_unitbecomesconvert_x_unit/convert_y_unit, implemented via a shared rollback helper, andevaluategains anoutput='numpy'|'scipp'selector. Also adds the additiveget_fit_targets()model API (consumed by #226).The base-class rename is irreducibly atomic — it forces all subclasses to change together, so this core can't be split further without a temporary compatibility shim.
Tutorial-notebook updates are distributed across the stack so they run green on every PR, not just at the top — each PR's
tutorial-testsjob executes all notebooks against that branch. This PR carries only thex_unit/y_unitnotebook edits (sample_modelandtutorial0_more_advanced); theFitBinding(targets=…)notebook changes land in #226 and theExpressionComponentones in #227.Two independent changes that were previously bundled into this PR have been carved into stacked follow-ups: the FitBinding/FitTarget redesign (#226) and the ExpressionComponent physical-constants/parameter-units feature (#227).
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