deprecate: deprecate the rest of the methods in recipeorganizer.py#169
deprecate: deprecate the rest of the methods in recipeorganizer.py#169sbillinge merged 21 commits intodiffpy:v3.3.0from
recipeorganizer.py#169Conversation
recipeorganizer.py
|
@sbillinge ready for review |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v3.3.0 #169 +/- ##
==========================================
+ Coverage 78.25% 78.40% +0.15%
==========================================
Files 24 24
Lines 3674 3700 +26
==========================================
+ Hits 2875 2901 +26
Misses 799 799
🚀 New features to boost your workflow:
|
docs/examples/crystalpdftwophase.py
Outdated
| # Biso = 8*pi**2*Uiso) | ||
| recipe.restrain("delta2_ni", lb=2.22, ub=2.22, scaled=True) | ||
| recipe.restrain("Biso_0_ni", lb=0.454, ub=0.454, scaled=True) | ||
| recipe.add_restraint("delta2_ni", lb=2.22, ub=2.22, scaled=True) |
There was a problem hiding this comment.
I think I like add_restraint better than constrain_parameter. It is not completely clear to me whether we are constraining parameters or variables or what is happening. Actually, I think that the constraint maps parameters to variables somehow. In that case, to avoid awkwardness, does it make sense to call it add_constraint. I am open to discussion on this, but I since we are deprecating everything, it is really our opportunity to think about this and get it right this time....
There was a problem hiding this comment.
@sbillinge Yeah lets go with add_. I think the words constrain and restrain can also get mixed up in the heads of users (and mine lol). What if we did change,
constrain-->add_constraintrestrain-->add_penaltyoradd_boundsoradd_soft_bounds
what do you think?
There was a problem hiding this comment.
We actually have a Restraint class that manages all the restraints as well as _restraints attributes, so this could get confusing if we change... I still am not much of a fan of how similar those two words are
There was a problem hiding this comment.
There is a Restraint.penalty method though that calculates the penalty, so add_penalty might be okay
There was a problem hiding this comment.
Let's go with add_penalty, I like that.
There was a problem hiding this comment.
@sbillinge okay i made the change, see the commit messages and the news items for whats changed
sbillinge
left a comment
There was a problem hiding this comment.
I am again not sure about this. Looking at the code, the only penalty we are allowed to add seems to be bounds on a variable, that are presumably soft bounds. I actually think that "restraint" is the right word to use here. We maybe just need to educate people what restraints are, as "soft" constraints, that restrain parameter values within a window by applying a penalty when they move out of the window.
|
@sbillinge yeah makes sense. I do think it would be nice to have some difference between the two though. Something like |
|
@sbillinge or even |
|
OK, let's go with add soft bounds. I think this is good because the signature is something like |
|
incidentally, let's make sure it is documented well how the bounds are applied in detail and whether the behavior can be controlled in any way by the user, if they want to use their own function for some reason or change how it is weighted. |
|
@sbillinge ready for review. There is a defined penalty equation that is used so the user cannot add their own. We could add this feature though. probably better on a different PR |
No description provided.