Skip to content

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

Merged
henrikjacobsenfys merged 1 commit into
developfrom
split/02d-fit-binding
Aug 9, 2026
Merged

Unit overhaul 5/6: Redesign FitBinding around FitTargets#226
henrikjacobsenfys merged 1 commit into
developfrom
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.99%. Comparing base (d635379) to head (9cadb44).
⚠️ Report is 2 commits behind head on develop.

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             @@
##           develop     #226      +/-   ##
===========================================
+ Coverage    98.81%   98.99%   +0.18%     
===========================================
  Files           53       53              
  Lines         3892     3897       +5     
  Branches       664      660       -4     
===========================================
+ Hits          3846     3858      +12     
+ Misses          23       18       -5     
+ Partials        23       21       -2     
Flag Coverage Δ
unittests 98.99% <97.67%> (+0.18%) ⬆️

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 1 file 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
@henrikjacobsenfys
henrikjacobsenfys force-pushed the split/02d-fit-binding branch 2 times, most recently from 8a25ff8 to a6269d5 Compare July 8, 2026 09:40
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>
@henrikjacobsenfys
henrikjacobsenfys changed the base branch from split/02c-unit-rename to develop August 9, 2026 19:02
@henrikjacobsenfys
henrikjacobsenfys merged commit dcd92de into develop Aug 9, 2026
3 checks passed
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