Skip to content

Unit overhaul 5/6: Redesign FitBinding around FitTargets#226

Open
henrikjacobsenfys wants to merge 1 commit into
split/02c-unit-renamefrom
split/02d-fit-binding
Open

Unit overhaul 5/6: Redesign FitBinding around FitTargets#226
henrikjacobsenfys wants to merge 1 commit into
split/02c-unit-renamefrom
split/02d-fit-binding

Conversation

@henrikjacobsenfys

@henrikjacobsenfys henrikjacobsenfys commented Jul 6, 2026

Copy link
Copy Markdown
Member

Replace FitBinding's parameter_name/modes API with a single targets spec that maps a model's declared predictions (its get_fit_targets()) onto keys of the parameters Dataset, and update ParameterAnalysis to consume the resolved FitTargets. Component models fit their single evaluate prediction; diffusion models select named predictions (area/width, plus delta_area for DeltaLorentz) with optional dataset-key overrides.

Split out of the unit-system overhaul as an independent, self-contained change. Builds on FitTarget (#221) and the get_fit_targets() model API added in the core rename (#224).

Also advances the tutorial notebooks to the new FitBinding(targets=…) API (tutorial0_basics, tutorial0_more_advanced, tutorial1_brownian); they run green under tutorial-tests on this branch.

All unit tests pass.


Stack — splitting the monolithic "Unit system overhaul" (#217) into a reviewable series. Merge bottom-up:

  1. Add unit-conversion utilities and FitTarget → develop (Unit overhaul 1/6: Add unit-conversion utilities and FitTarget #221)
  2. Centralize Q-index validation via verify_Q_indexsplit/01-unit-utils (Unit overhaul 2/6: Centralize Q-index validation via verify_Q_index #222)
  3. Store Q as a scipp Variable in 1/angstrom → split/02a-verify-q-index (Unit overhaul 3/6: Store Q as a scipp Variable in 1/angstrom #223)
  4. Separate model unit into x_unit/y_unit + tutorialssplit/02b-q-variable (Unit overhaul 4/6: Separate unit into x_unit/y_unit and update tutorials #224)
  5. Redesign FitBinding around FitTargetssplit/02c-unit-rename (Unit overhaul 5/6: Redesign FitBinding around FitTargets #226)
  6. ExpressionComponent physical constants + parameter unitssplit/02d-fit-binding (Unit overhaul 6/6: ExpressionComponent physical constants and parameter units #227)

🤖 Generated with Claude Code

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.67442% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.28%. Comparing base (879cc94) to head (508ba38).

Files with missing lines Patch % Lines
src/easydynamics/analysis/fit_binding.py 95.45% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@                    Coverage Diff                    @@
##           split/02c-unit-rename     #226      +/-   ##
=========================================================
+ Coverage                  97.99%   98.28%   +0.28%     
=========================================================
  Files                         53       53              
  Lines                       3892     3897       +5     
  Branches                     664      660       -4     
=========================================================
+ Hits                        3814     3830      +16     
+ Misses                        48       39       -9     
+ Partials                      30       28       -2     
Flag Coverage Δ
unittests 98.28% <97.67%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/easydynamics/analysis/parameter_analysis.py 99.51% <100.00%> (+1.13%) ⬆️
src/easydynamics/analysis/fit_binding.py 95.23% <95.45%> (+0.36%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@henrikjacobsenfys henrikjacobsenfys added [scope] enhancement Adds/improves features (major.MINOR.patch) [priority] medium Normal/default priority labels Jul 6, 2026
Replace FitBinding's parameter_name/modes API with a single `targets`
spec that maps a model's declared predictions (its get_fit_targets) onto
dataset keys, and update ParameterAnalysis to consume the resolved
FitTargets. Component models fit their single evaluate prediction;
diffusion models select named predictions with optional key overrides.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[priority] medium Normal/default priority [scope] enhancement Adds/improves features (major.MINOR.patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant