Skip to content

Commit 1272edc

Browse files
authored
Merge pull request #150 from cadenmyers13/setequation-dep
deprecate: `setEquation` deprecation
2 parents e3db88e + a6a7316 commit 1272edc

21 files changed

Lines changed: 100 additions & 43 deletions

docs/examples/coreshellnp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def makeRecipe(stru1, stru2, datname):
8181

8282
# Write the fitting equation. We want to sum the PDFs from each phase and
8383
# multiply it by a scaling factor.
84-
contribution.setEquation("scale * (f_CdS * G_CdS + f_ZnS * G_ZnS)")
84+
contribution.set_equation("scale * (f_CdS * G_CdS + f_ZnS * G_ZnS)")
8585

8686
# Make the FitRecipe and add the FitContribution.
8787
recipe = FitRecipe()

docs/examples/crystalpdfall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def makeRecipe(
9494
"xsini", xgenerator_sini_ni, xprofile_sini
9595
)
9696
xcontribution_sini.add_profile_generator(xgenerator_sini_si)
97-
xcontribution_sini.setEquation("scale * (xG_sini_ni + xG_sini_si)")
97+
xcontribution_sini.set_equation("scale * (xG_sini_ni + xG_sini_si)")
9898

9999
# As explained in another example, we want to minimize using Rw^2.
100100
xcontribution_ni.setResidualEquation("resv")

docs/examples/crystalpdftwophase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def makeRecipe(niciffile, siciffile, datname):
8080
# multiply it by a scaling factor. We also want a certain phase scaling
8181
# relationship between the PDFs which we will enforce with constraints in
8282
# the FitRecipe.
83-
contribution.setEquation("scale * (G_ni + G_si)")
83+
contribution.set_equation("scale * (G_ni + G_si)")
8484

8585
# Make the FitRecipe and add the FitContribution.
8686
recipe = FitRecipe()

docs/examples/debyemodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def makeRecipe():
126126
# the debye equation to be positive, so we specify the input as abs(thetaD)
127127
# in the equation below. Furthermore, we know 'm', the mass of lead, so we
128128
# can specify that as well.
129-
contribution.setEquation("debye(T, 207.2, abs(thetaD)) + offset")
129+
contribution.set_equation("debye(T, 207.2, abs(thetaD)) + offset")
130130

131131
# The FitRecipe
132132
# The FitRecipe lets us define what we want to fit. It is where we can

docs/examples/gaussiangenerator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
3434
Extensions
3535
36-
- Remove the amplitude from GaussianGenerator and instead use the 'setEquation'
37-
method of the FitContribution to account for it. Note that the
36+
- Remove the amplitude from GaussianGenerator and instead use the
37+
'set_equation' method of the
38+
FitContribution to account for it. Note that the
3839
GaussianGenerator will be accessible by its name, "g".
3940
"""
4041

docs/examples/gaussianrecipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def makeRecipe():
124124
# contribution by name. Since we told the contribution that our
125125
# independent variable is named "x", this value will be substituted into
126126
# the fitting equation whenever it is called.
127-
contribution.setEquation("A * exp(-0.5*(x-x0)**2/sigma**2)")
127+
contribution.set_equation("A * exp(-0.5*(x-x0)**2/sigma**2)")
128128

129129
# To demonstrate how these parameters are used, we will give "A" an initial
130130
# value. Note that Parameters are not numbers, but are containers for

docs/examples/interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def main():
3838
# "<<" - Inject a parameter value
3939
c = FitContribution("g1")
4040
c.set_profile(p)
41-
c.setEquation("A * exp(-0.5*(x-x0)**2/sigma**2)")
41+
c.set_equation("A * exp(-0.5*(x-x0)**2/sigma**2)")
4242
c.A << 0.5
4343
c.x0 << 5
4444
c.sigma << 1

docs/examples/npintensity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def gaussian(q, q0, width):
256256
# convolve the signal with the Gaussian to broaden it. Recall that we don't
257257
# need to supply arguments to the registered functions unless we want to
258258
# make changes to their input values.
259-
contribution.setEquation("scale * convolve(I, gaussian) + bkgd")
259+
contribution.set_equation("scale * convolve(I, gaussian) + bkgd")
260260

261261
# Make the FitRecipe and add the FitContribution.
262262
recipe = FitRecipe()

docs/examples/npintensityII.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ def gaussian(q, q0, width):
125125

126126
# Now we can incorporate the scale and bkgd into our calculation. We also
127127
# convolve the signal with the gaussian to broaden it.
128-
contribution1.setEquation("scale * convolve(I, gaussian) + bkgd")
129-
contribution2.setEquation("scale * convolve(I, gaussian) + bkgd")
128+
contribution1.set_equation("scale * convolve(I, gaussian) + bkgd")
129+
contribution2.set_equation("scale * convolve(I, gaussian) + bkgd")
130130

131131
# Make a FitRecipe and associate the FitContributions.
132132
recipe = FitRecipe()

docs/examples/nppdfcrystal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def makeRecipe(ciffile, grdata):
6262
pdfcontribution.registerFunction(sphericalCF, name="f")
6363

6464
# Now we set up the fitting equation.
65-
pdfcontribution.setEquation("f * G")
65+
pdfcontribution.set_equation("f * G")
6666

6767
# Now make the recipe. Make sure we fit the characteristic function shape
6868
# parameters, in this case 'psize', which is the diameter of the particle.

0 commit comments

Comments
 (0)