Skip to content

Add microstructural size/strain broadening and peak-range cutoff#212

Merged
AndrewSazonov merged 57 commits into
developfrom
microstructural-size-strain
Jun 23, 2026
Merged

Add microstructural size/strain broadening and peak-range cutoff#212
AndrewSazonov merged 57 commits into
developfrom
microstructural-size-strain

Conversation

@AndrewSazonov

Copy link
Copy Markdown
Member

Adds isotropic microstructural size and strain broadening to the time-of-flight Jorgensen and Jorgensen–Von Dreele peak profiles, so sample size and strain effects can be refined directly against the data.

It also introduces a per-experiment peak-range cutoff (peak.cutoff_fwhm, mirroring FullProf's WDT) that makes peak calculation markedly faster when enabled, updates the cryspy backend to 0.12.1 — faster, and with a fix for rhombohedral structures whose refinements previously dropped valid reflections — and makes CrysFML raise a clear error for time-of-flight data instead of silently returning an empty pattern.

The tutorials, verification pages, feature list, and parameter reference are refreshed throughout to match.

Expose the automatic peak-range cutoff floor as a public per-experiment
peak parameter (cutoff_fwhm_auto_floor, default 1e-6, valid in (0, 1)) on
the TOF and CWL peak categories, plumbed to the cryspy calculator dict
(profile_wdt_auto_floor). Used only in automatic mode (cutoff_fwhm = 0):
raising it speeds up broad/Lorentzian fits, smaller keeps more tail.
Document the investigation into an S/N-aware automatic peak-range cutoff:
the current eta-only window does not work equally well across examples
and a single global floor cannot satisfy both high-S/N x-ray and low-S/N
neutron data. Records the sweep evidence and candidate mechanisms.
@AndrewSazonov AndrewSazonov added the [scope] enhancement Adds/improves features (major.MINOR.patch) label Jun 23, 2026
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.96992% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.34%. Comparing base (a29d620) to head (844ea1f).

Files with missing lines Patch % Lines
src/easydiffraction/analysis/calculators/cryspy.py 50.00% 2 Missing and 4 partials ⚠️
...rc/easydiffraction/analysis/calculators/crysfml.py 80.76% 3 Missing and 2 partials ⚠️
...ablocks/structure/categories/atom_sites/default.py 76.47% 3 Missing and 1 partial ⚠️
.../datablocks/experiment/categories/data/bragg_pd.py 95.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #212      +/-   ##
===========================================
+ Coverage    90.30%   90.34%   +0.04%     
===========================================
  Files          284      284              
  Lines        24540    24664     +124     
  Branches      2882     2897      +15     
===========================================
+ Hits         22160    22282     +122     
+ Misses        1763     1756       -7     
- Partials       617      626       +9     
Flag Coverage Δ
unittests 90.34% <87.96%> (+0.04%) ⬆️

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

Files with missing lines Coverage Δ
src/easydiffraction/core/collection.py 96.66% <100.00%> (+0.19%) ⬆️
src/easydiffraction/core/variable.py 92.90% <100.00%> (+0.06%) ⬆️
.../experiment/categories/excluded_regions/default.py 91.54% <100.00%> (+0.64%) ⬆️
...atablocks/experiment/categories/peak/cwl_mixins.py 91.91% <100.00%> (+0.71%) ⬆️
...atablocks/experiment/categories/peak/tof_mixins.py 93.85% <100.00%> (+2.24%) ⬆️
.../datablocks/experiment/categories/data/bragg_pd.py 86.05% <95.00%> (+0.54%) ⬆️
...ablocks/structure/categories/atom_sites/default.py 88.27% <76.47%> (-0.12%) ⬇️
...rc/easydiffraction/analysis/calculators/crysfml.py 69.16% <80.76%> (+2.49%) ⬆️
src/easydiffraction/analysis/calculators/cryspy.py 55.04% <50.00%> (+1.08%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

[scope] enhancement Adds/improves features (major.MINOR.patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant