Skip to content

Add X-ray polarization and monochromator optics for constant-wavelength powder#210

Merged
AndrewSazonov merged 16 commits into
developfrom
xray-cw-polarization-optics
Jun 18, 2026
Merged

Add X-ray polarization and monochromator optics for constant-wavelength powder#210
AndrewSazonov merged 16 commits into
developfrom
xray-cw-polarization-optics

Conversation

@AndrewSazonov

Copy link
Copy Markdown
Member

Constant-wavelength X-ray powder experiments now expose two incident-beam optics parameters — a polarization coefficient and a pre-specimen monochromator angle — that control the Lorentz-polarization correction applied to calculated intensities. The settings appear only on X-ray powder instruments and are honored by both the CrysPy and CrysFML engines. Neutron experiments are unaffected, and existing X-ray results stay exactly the same until you set a polarization value, so nothing changes unless you opt in.

@AndrewSazonov AndrewSazonov added the [scope] enhancement Adds/improves features (major.MINOR.patch) label Jun 18, 2026
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.79592% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.38%. Comparing base (106c84c) to head (c95c584).

Files with missing lines Patch % Lines
src/easydiffraction/analysis/calculators/cryspy.py 83.78% 2 Missing and 4 partials ⚠️
...sydiffraction/analysis/calculators/polarization.py 80.95% 2 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #210      +/-   ##
===========================================
- Coverage    90.38%   90.38%   -0.01%     
===========================================
  Files          283      284       +1     
  Lines        24276    24367      +91     
  Branches      2850     2860      +10     
===========================================
+ Hits         21943    22024      +81     
- Misses        1738     1742       +4     
- Partials       595      601       +6     
Flag Coverage Δ
unittests 90.38% <89.79%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
...rc/easydiffraction/analysis/calculators/crysfml.py 50.48% <100.00%> (+1.48%) ⬆️
...rc/easydiffraction/analysis/calculators/support.py 100.00% <ø> (ø)
...locks/experiment/categories/instrument/__init__.py 100.00% <100.00%> (ø)
...datablocks/experiment/categories/instrument/cwl.py 100.00% <100.00%> (ø)
...blocks/experiment/categories/instrument/factory.py 100.00% <100.00%> (ø)
...diffraction/datablocks/experiment/item/bragg_pd.py 94.56% <ø> (ø)
...sydiffraction/analysis/calculators/polarization.py 80.95% <80.95%> (ø)
src/easydiffraction/analysis/calculators/cryspy.py 52.15% <83.78%> (+1.98%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AndrewSazonov AndrewSazonov merged commit eec8ec8 into develop Jun 18, 2026
27 of 28 checks passed
@AndrewSazonov AndrewSazonov deleted the xray-cw-polarization-optics branch June 19, 2026 12:13
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