feat: Initialize a fit recipe with a previous recipe#162
feat: Initialize a fit recipe with a previous recipe#162sbillinge merged 6 commits intodiffpy:v3.3.0from
Conversation
|
@sbillinge ready for review! this should be much easier to review hopefully 😆 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v3.3.0 #162 +/- ##
==========================================
+ Coverage 71.80% 72.16% +0.35%
==========================================
Files 25 25
Lines 3756 3804 +48
==========================================
+ Hits 2697 2745 +48
Misses 1059 1059
🚀 New features to boost your workflow:
|
|
|
||
| for contrib_object in recipe_object._contributions.values(): | ||
| if contrib_object not in self._contributions.values(): | ||
| self.add_contribution(contrib_object) |
There was a problem hiding this comment.
Used .add_contribution() since it actually takes a contribution object.
There was a problem hiding this comment.
that's what I am talkin' about. Much better than parsing a results file string.
| for restraint in recipe_object._restraints: | ||
| if restraint not in self._restraints: | ||
| self._restraints.add(restraint) | ||
|
|
There was a problem hiding this comment.
Had to use .add() and .update() here because the .restrain(), .constrain(), and .create_new_parameter() methods dont accept the respective objects
| recipe.constrain(contribution2.B, "0.5*A") | ||
| recipe.restrain(contribution1.A, 0.5, 1.5) | ||
| recipe.restrain(contribution1.k, 0.8, 1.2) | ||
|
|
There was a problem hiding this comment.
Improved this so we can actually test for constrain and restrain
|
I will merge but is this missing a ci test? Is it the news check? I am not sure. I wonder if we want to do a quick |
|
@sbillinge oh yeah probably. I'll do that |
This initializes a fit with everything, not just variables and values