Skip to content

Adds conversion between material depth and attenuation#2049

Open
Matt-Carre wants to merge 47 commits into
mainfrom
2041_interconversion_depth_attenuation
Open

Adds conversion between material depth and attenuation#2049
Matt-Carre wants to merge 47 commits into
mainfrom
2041_interconversion_depth_attenuation

Conversation

@Matt-Carre
Copy link
Copy Markdown
Contributor

Fixes #2041
Adds tests and functions to convert between depth (measured in cm) and attenuation

@Matt-Carre Matt-Carre requested a review from a team as a code owner May 5, 2026 13:17
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.13%. Comparing base (0f2534c) to head (68566cd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2049   +/-   ##
=======================================
  Coverage   99.13%   99.13%           
=======================================
  Files         337      337           
  Lines       13079    13096   +17     
=======================================
+ Hits        12966    12983   +17     
  Misses        113      113           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/dodal/common/general_maths/material_absorption_maths.py Outdated
Comment thread src/dodal/common/general_maths/material_absorption_maths.py Outdated
Comment thread src/dodal/common/general_maths/material_absorption_maths.py
Comment thread src/dodal/common/general_maths/material_absorption_maths.py Outdated
Comment thread tests/common/general_maths/test_material_absorption_maths.py
Comment thread tests/common/general_maths/test_material_absorption_maths.py
Comment thread tests/common/general_maths/test_material_absorption_maths.py Outdated
Comment thread tests/common/general_maths/test_material_absorption_maths.py Outdated
Comment thread tests/common/general_maths/test_material_absorption_maths.py
Copy link
Copy Markdown
Contributor

@oliwenmandiamond oliwenmandiamond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The standard for dodal for tests is "mirror the file structure of the src folder with the corresponding code files. Use the test_*.py naming convention for test files."

You have created many test files that don't mirror the src structure e.g test_photon_mass_attenutation.py, test_thickness_required_to_attenuate.py etc.

Can you please update your tests accordingly?

https://diamondlightsource.github.io/dodal/main/how-to/write-tests.html

Comment thread tests/common/general_maths/test_transmission_inerconversion.py Outdated
Comment thread tests/common/general_maths/test_transmission_inerconversion.py Outdated
Comment thread tests/common/general_maths/test_transmission_inerconversion.py Outdated
Comment thread tests/common/general_maths/test_transmission_inerconversion.py Outdated
Comment thread tests/common/general_maths/test_transmission_inerconversion.py Outdated
Comment thread tests/common/general_maths/test_transmission_inerconversion.py Outdated
Comment thread tests/common/general_maths/test_transmission_inerconversion.py Outdated
Comment thread tests/common/general_maths/test_transmission_inerconversion.py Outdated
Comment thread tests/common/general_maths/test_transmission_inerconversion.py Outdated
@Matt-Carre
Copy link
Copy Markdown
Contributor Author

Currently, what I have works, but I could create a second model to check if the absorption coefficient is greater than 1.0e-14 with pydantic as well. Worth doing? Or do we want it to raise that specific value error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend beamline-relevant arithmetic to provide interconversion between attenuation and material depth

3 participants