Skip to content

correct units for scattering lengths #377 - #419

Merged
rozyczko merged 3 commits into
developfrom
377-unit-metadata
Sep 23, 2026
Merged

rozyczko merged 3 commits into
developfrom
377-unit-metadata

Conversation

@rozyczko

Copy link
Copy Markdown
Member

Unit and Dependency Handling Improvements:

  • The unit metadata for MaterialDensity has been corrected: scattering lengths (scattering_length_real, scattering_length_imag) now use angstrom, and SLDs (sld, isld) use 1/angstrom^2, matching physical expectations and fixing inconsistencies in both code and material string representations.
  • The dependency expression for SLD calculation has been refactored to use a physically meaningful formula with units, and Avogadro's constant is now an explicit parameter. The SLD dependency wiring is now centralized in a helper method, ensuring derived parameters always have the correct unit.

@rozyczko rozyczko added [scope] bug Bug report or fix (major.minor.PATCH) bugfix Fix to known bug [priority] high Should be prioritized soon labels Sep 21, 2026
@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.57%. Comparing base (e7e3693) to head (7cd440b).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #419   +/-   ##
========================================
  Coverage    94.57%   94.57%           
========================================
  Files           54       54           
  Lines         5515     5516    +1     
========================================
+ Hits          5216     5217    +1     
  Misses         299      299           
Flag Coverage Δ
integration 38.37% <30.00%> (+0.04%) ⬆️
unittests 94.57% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
...etry/sample/elements/materials/material_density.py 99.13% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rozyczko
rozyczko merged commit c8bc2a2 into develop Sep 23, 2026
50 checks passed
@rozyczko
rozyczko deleted the 377-unit-metadata branch September 23, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix to known bug [priority] high Should be prioritized soon [scope] bug Bug report or fix (major.minor.PATCH)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant