@@ -90,12 +90,12 @@ def makeRecipe(niciffile, siciffile, datname):
9090 # Start by configuring the scale factor and resolution factors.
9191 # We want the sum of the phase scale factors to be 1.
9292 recipe .create_new_variable ("scale_ni" , 0.1 )
93- recipe .constrain (generator_ni .scale , "scale_ni" )
94- recipe .constrain (generator_si .scale , "1 - scale_ni" )
93+ recipe .add_constraint (generator_ni .scale , "scale_ni" )
94+ recipe .add_constraint (generator_si .scale , "1 - scale_ni" )
9595 # We also want the resolution factor to be the same on each.
9696 recipe .create_new_variable ("qdamp" , 0.03 )
97- recipe .constrain (generator_ni .qdamp , "qdamp" )
98- recipe .constrain (generator_si .qdamp , "qdamp" )
97+ recipe .add_constraint (generator_ni .qdamp , "qdamp" )
98+ recipe .add_constraint (generator_si .qdamp , "qdamp" )
9999
100100 # Vary the global scale as well.
101101 recipe .add_variable (contribution .scale , 1 )
@@ -123,18 +123,30 @@ def makeRecipe(niciffile, siciffile, datname):
123123 # derived has no uncertainty. Thus, we will tell the recipe to scale the
124124 # residual, which means that it will be weighted as much as the average
125125 # data point during the fit.
126- recipe .restrain ("a_ni" , lb = 3.527 , ub = 3.527 , scaled = True )
126+ recipe .add_soft_bounds (
127+ "a_ni" , lower_bound = 3.527 , upper_bound = 3.527 , scaled = True
128+ )
127129 # Now we do the same with the delta2 and Biso parameters (remember that
128130 # Biso = 8*pi**2*Uiso)
129- recipe .restrain ("delta2_ni" , lb = 2.22 , ub = 2.22 , scaled = True )
130- recipe .restrain ("Biso_0_ni" , lb = 0.454 , ub = 0.454 , scaled = True )
131+ recipe .add_soft_bounds (
132+ "delta2_ni" , lower_bound = 2.22 , upper_bound = 2.22 , scaled = True
133+ )
134+ recipe .add_soft_bounds (
135+ "Biso_0_ni" , lower_bound = 0.454 , upper_bound = 0.454 , scaled = True
136+ )
131137 #
132138 # We can do the same with the silicon values. We haven't done a thorough
133139 # job of measuring the uncertainties in the results, so we'll scale these
134140 # as well.
135- recipe .restrain ("a_si" , lb = 5.430 , ub = 5.430 , scaled = True )
136- recipe .restrain ("delta2_si" , lb = 3.54 , ub = 3.54 , scaled = True )
137- recipe .restrain ("Biso_0_si" , lb = 0.645 , ub = 0.645 , scaled = True )
141+ recipe .add_soft_bounds (
142+ "a_si" , lower_bound = 5.430 , upper_bound = 5.430 , scaled = True
143+ )
144+ recipe .add_soft_bounds (
145+ "delta2_si" , lower_bound = 3.54 , upper_bound = 3.54 , scaled = True
146+ )
147+ recipe .add_soft_bounds (
148+ "Biso_0_si" , lower_bound = 0.645 , upper_bound = 0.645 , scaled = True
149+ )
138150
139151 # Give the recipe away so it can be used!
140152 return recipe
0 commit comments