Repository navigation
425 multiple contrasts - #432
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #432 +/- ##
===========================================
+ Coverage 95.13% 95.39% +0.26%
===========================================
Files 56 59 +3
Lines 6249 7021 +772
===========================================
+ Hits 5945 6698 +753
- Misses 304 323 +19
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to how contrasts, experiments, and fitting are managed in the
easyreflectometrypackage. The main changes include the addition of a flexible contrasts system, enhanced project persistence with proper object sharing, and a comprehensive record of fitting runs. There are also important behavioral changes to experiment/model management and fitting statistics, as well as new API methods for advanced workflows.Multiple Contrasts and Model Management:
easyreflectometry.contrastssystem, allowing models to share structure by identity or equality, and providing APIs to build, substitute, and manage contrasts (Project.add_contrast,ReplaceMaterial,ReplaceFormula,substitution_candidates,Project.contrast_reference, etc.). User constraints for multiple contrasts are now saved with the project.Project.remove_experiment,set_model_for_experiment,model_index_for_experiment,experiments_for_model, and improved behavior for removing models and handling constraints.Project Persistence Improvements:
Fitting Enhancements:
include_in_fittoDataSet1DandPolarizedDataSetto control which experiments are included in a fit by default.FitRundataclass that records the outcome and statistics of each fit, independent of the current model state, including pooled and per-dataset chi-square values and experiment mapping._free_roots), preventing them from being held fixed unintentionally.API and Internal Structure:
FitScopeError) for better error reporting when experiments cannot be fitted together.added_roots,labels,skipped) inPreparedFit, and improved how fitters are constructed and configured.