-
Notifications
You must be signed in to change notification settings - Fork 0
Add scaling factor calculation for norm and stitching #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## next #99 +/- ##
==========================================
- Coverage 98.99% 98.52% -0.47%
==========================================
Files 11 13 +2
Lines 694 812 +118
==========================================
+ Hits 687 800 +113
- Misses 7 12 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates scaling factor calculations for stitching from RefRed, introducing new utility dataclasses and methods to handle normalization and stitching of reduced neutron reflectometry data. The implementation calculates scaling factors both for critical edge normalization and for overlapping regions between datasets.
- Introduces
ReducedDataandOverlapInfodataclasses to structure reduced datasets and overlap region metadata - Implements
scaling_factor_critical_edgefunction for critical edge normalization - Adds
OverlapScalingFactorclass with methods to calculate scaling factors for overlapping data regions using linear fitting
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 23 comments.
| File | Description |
|---|---|
| src/lr_reduction/normalization_and_stitching.py | New module containing dataclasses and scaling factor calculation logic for normalization and stitching operations |
| tests/test_normalization_and_stitching.py | New test file with fixtures and test cases for scaling factor calculations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
e904799 to
2d812e6
Compare
backmari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds logic for calculating critical edge scaling factor and scaling factor for stitching two runs. The logic is copied as close as possible from existing logic in RefRed in order to move calculation logic from the frontend to the backend. This also adds new unit testing for the scaling factor calculations. Looks good 👌
Description of work:
Migrates scaling factor calculations for stitching from RefRed.
Adds utility dataclasses to hold datasets and region overlap info
Check all that apply:
updated documentationAdded integration testsReferences:
(Instructions for testing here)
Check list for the reviewer