Skip to content

Commit d3c210e

Browse files
authored
Merge pull request #146 from cadenmyers13/addprofilegenerator-dep
deprecate: `addProfileGenerator` deprecation
2 parents a717205 + 92e8158 commit d3c210e

17 files changed

Lines changed: 78 additions & 24 deletions

docs/examples/coreshellnp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def makeRecipe(stru1, stru2, datname):
6666
# The FitContribution
6767
# Add both generators and the profile to the FitContribution.
6868
contribution = FitContribution("cdszns")
69-
contribution.addProfileGenerator(generator_cds)
70-
contribution.addProfileGenerator(generator_zns)
69+
contribution.add_profile_generator(generator_cds)
70+
contribution.add_profile_generator(generator_zns)
7171
contribution.set_profile(profile, xname="r")
7272

7373
# Set up the characteristic functions. We use a spherical CF for the core

docs/examples/crystalpdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def makeRecipe(ciffile, datname):
7474
# Here we associate the Profile and ProfileGenerator, as has been done
7575
# before.
7676
contribution = FitContribution("nickel")
77-
contribution.addProfileGenerator(generator)
77+
contribution.add_profile_generator(generator)
7878
contribution.set_profile(profile, xname="r")
7979

8080
# Make the FitRecipe and add the FitContribution.

docs/examples/crystalpdfall.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def makeProfile(datafile):
4747
def makeContribution(name, generator, profile):
4848
"""Make a FitContribution and add a generator and profile."""
4949
contribution = FitContribution(name)
50-
contribution.addProfileGenerator(generator)
50+
contribution.add_profile_generator(generator)
5151
contribution.set_profile(profile, xname="r")
5252
return contribution
5353

@@ -93,7 +93,7 @@ def makeRecipe(
9393
xcontribution_sini = makeContribution(
9494
"xsini", xgenerator_sini_ni, xprofile_sini
9595
)
96-
xcontribution_sini.addProfileGenerator(xgenerator_sini_si)
96+
xcontribution_sini.add_profile_generator(xgenerator_sini_si)
9797
xcontribution_sini.setEquation("scale * (xG_sini_ni + xG_sini_si)")
9898

9999
# As explained in another example, we want to minimize using Rw^2.

docs/examples/crystalpdfobjcryst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def makeRecipe(ciffile, datname):
6262

6363
# The FitContribution
6464
contribution = FitContribution("nickel")
65-
contribution.addProfileGenerator(generator)
65+
contribution.add_profile_generator(generator)
6666
contribution.set_profile(profile, xname="r")
6767

6868
# Make the FitRecipe and add the FitContribution.

docs/examples/crystalpdftwodata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ def makeRecipe(ciffile, xdatname, ndatname):
8484
# The FitContributions
8585
# We associate the x-ray PDFGenerator and Profile in one FitContribution...
8686
xcontribution = FitContribution("xnickel")
87-
xcontribution.addProfileGenerator(xgenerator)
87+
xcontribution.add_profile_generator(xgenerator)
8888
xcontribution.set_profile(xprofile, xname="r")
8989
# and the neutron objects in another.
9090
ncontribution = FitContribution("nnickel")
91-
ncontribution.addProfileGenerator(ngenerator)
91+
ncontribution.add_profile_generator(ngenerator)
9292
ncontribution.set_profile(nprofile, xname="r")
9393

9494
# This example is different than the previous ones in that we are composing

docs/examples/crystalpdftwophase.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def makeRecipe(niciffile, siciffile, datname):
7272
# Add both generators to the FitContribution. Add the Profile. This will
7373
# send the metadata to the generators.
7474
contribution = FitContribution("nisi")
75-
contribution.addProfileGenerator(generator_ni)
76-
contribution.addProfileGenerator(generator_si)
75+
contribution.add_profile_generator(generator_ni)
76+
contribution.add_profile_generator(generator_si)
7777
contribution.set_profile(profile, xname="r")
7878

7979
# Write the fitting equation. We want to sum the PDFs from each phase and

docs/examples/ellipsoidsas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def makeRecipe(datname):
5757
# Here we associate the Profile and ProfileGenerator, as has been done
5858
# before.
5959
contribution = FitContribution("ellipsoid")
60-
contribution.addProfileGenerator(generator)
60+
contribution.add_profile_generator(generator)
6161
contribution.set_profile(profile, xname="q")
6262

6363
# We want to fit the log of the signal to the log of the data so that the

docs/examples/gaussiangenerator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def makeRecipe():
144144
# attribute of the FitContribution by its name ("g"). Note that this will
145145
# set the fitting equation to "g", which calls the GaussianGenerator.
146146
contribution = FitContribution("g1")
147-
contribution.addProfileGenerator(generator)
147+
contribution.add_profile_generator(generator)
148148
contribution.set_profile(profile)
149149

150150
# The FitRecipe

docs/examples/npintensity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def makeRecipe(strufile, datname):
203203
# the FitContribution to name the x-variable of the profile "q", so we can
204204
# use it in equations with this name.
205205
contribution = FitContribution("bucky")
206-
contribution.addProfileGenerator(generator)
206+
contribution.add_profile_generator(generator)
207207
contribution.set_profile(profile, xname="q")
208208

209209
# Now we're ready to define the fitting equation for the FitContribution.

docs/examples/npintensityII.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ def makeRecipe(strufile, datname1, datname2):
8888
# The FitContributions
8989
# Create the FitContributions.
9090
contribution1 = FitContribution("bucky1")
91-
contribution1.addProfileGenerator(generator1)
91+
contribution1.add_profile_generator(generator1)
9292
contribution1.set_profile(profile1, xname="q")
9393
contribution2 = FitContribution("bucky2")
94-
contribution2.addProfileGenerator(generator2)
94+
contribution2.add_profile_generator(generator2)
9595
contribution2.set_profile(profile2, xname="q")
9696

9797
# Now we're ready to define the fitting equation for each FitContribution.

0 commit comments

Comments
 (0)