Skip to content

Clear error for invalid joint-fit weights#205

Merged
AndrewSazonov merged 8 commits into
developfrom
validate-joint-fit-weights
Jun 16, 2026
Merged

Clear error for invalid joint-fit weights#205
AndrewSazonov merged 8 commits into
developfrom
validate-joint-fit-weights

Conversation

@AndrewSazonov

Copy link
Copy Markdown
Member

When fitting several experiments together, each experiment is given a weight that controls how strongly it influences the result. Previously, entering an invalid set of weights — a negative value, weights that are not valid numbers, or all weights set to zero — could silently spoil the fit and return meaningless results, with no indication that anything was wrong.

EasyDiffraction now checks the joint-fit weights before fitting begins and stops with a clear, explanatory message when they are negative, not-a-number, or all zero (and when the number of weights does not match the number of experiments). You get an immediate, understandable error and can fix the weights straight away, instead of chasing a confusing failed refinement.

@AndrewSazonov AndrewSazonov added the [scope] bug Bug report or fix (major.minor.PATCH) label Jun 16, 2026
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.30%. Comparing base (681b195) to head (3ea355c).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #205   +/-   ##
========================================
  Coverage    90.29%   90.30%           
========================================
  Files          283      283           
  Lines        24152    24175   +23     
  Branches      2828     2834    +6     
========================================
+ Hits         21809    21832   +23     
  Misses        1747     1747           
  Partials       596      596           
Flag Coverage Δ
unittests 90.30% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
src/easydiffraction/analysis/fitting.py 97.89% <100.00%> (+0.28%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AndrewSazonov AndrewSazonov merged commit 97ef51b into develop Jun 16, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[scope] bug Bug report or fix (major.minor.PATCH)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant