Skip to content

Commit 474afb4

Browse files
committed
newVar deprecation
1 parent ca94e89 commit 474afb4

14 files changed

Lines changed: 46 additions & 33 deletions

docs/examples/coreshellnp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def makeRecipe(stru1, stru2, datname):
9696
# Configure the fit variables
9797
# Start by configuring the scale factor and resolution factors.
9898
# We want the sum of the phase scale factors to be 1.
99-
recipe.newVar("scale_CdS", 0.7)
99+
recipe.create_new_variable("scale_CdS", 0.7)
100100
recipe.constrain(generator_cds.scale, "scale_CdS")
101101
recipe.constrain(generator_zns.scale, "1 - scale_CdS")
102102
# We also want the resolution factor to be the same on each.

docs/examples/crystalpdfall.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ def makeRecipe(
112112
# Now we vary and constrain Parameters as before.
113113
for par in phase_ni.sgpars:
114114
recipe.add_variable(par, name=par.name + "_ni")
115-
delta2_ni = recipe.newVar("delta2_ni", 2.5)
115+
delta2_ni = recipe.create_new_variable("delta2_ni", 2.5)
116116
recipe.constrain(xgenerator_ni.delta2, delta2_ni)
117117
recipe.constrain(ngenerator_ni.delta2, delta2_ni)
118118
recipe.constrain(xgenerator_sini_ni.delta2, delta2_ni)
119119

120120
for par in phase_si.sgpars:
121121
recipe.add_variable(par, name=par.name + "_si")
122-
delta2_si = recipe.newVar("delta2_si", 2.5)
122+
delta2_si = recipe.create_new_variable("delta2_si", 2.5)
123123
recipe.constrain(xgenerator_si.delta2, delta2_si)
124124
recipe.constrain(xgenerator_sini_si.delta2, delta2_si)
125125

@@ -128,7 +128,7 @@ def makeRecipe(
128128
recipe.add_variable(xgenerator_si.scale, name="xscale_si")
129129
recipe.add_variable(ngenerator_ni.scale, name="nscale_ni")
130130
recipe.add_variable(xcontribution_sini.scale, 1.0, "xscale_sini")
131-
recipe.newVar("pscale_sini_ni", 0.8)
131+
recipe.create_new_variable("pscale_sini_ni", 0.8)
132132
recipe.constrain(xgenerator_sini_ni.scale, "pscale_sini_ni")
133133
recipe.constrain(xgenerator_sini_si.scale, "1 - pscale_sini_ni")
134134

docs/examples/crystalpdftwodata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def makeRecipe(ciffile, xdatname, ndatname):
120120
recipe.add_variable(ngenerator.qdamp, 0.01, "nqdamp")
121121
# delta2 is a non-structual material property. Thus, we constrain together
122122
# delta2 Parameter from each PDFGenerator.
123-
delta2 = recipe.newVar("delta2", 2)
123+
delta2 = recipe.create_new_variable("delta2", 2)
124124
recipe.constrain(xgenerator.delta2, delta2)
125125
recipe.constrain(ngenerator.delta2, delta2)
126126

docs/examples/crystalpdftwophase.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ def makeRecipe(niciffile, siciffile, datname):
8989
# Configure the fit variables
9090
# Start by configuring the scale factor and resolution factors.
9191
# We want the sum of the phase scale factors to be 1.
92-
recipe.newVar("scale_ni", 0.1)
92+
recipe.create_new_variable("scale_ni", 0.1)
9393
recipe.constrain(generator_ni.scale, "scale_ni")
9494
recipe.constrain(generator_si.scale, "1 - scale_ni")
9595
# We also want the resolution factor to be the same on each.
96-
recipe.newVar("qdamp", 0.03)
96+
recipe.create_new_variable("qdamp", 0.03)
9797
recipe.constrain(generator_ni.qdamp, "qdamp")
9898
recipe.constrain(generator_si.qdamp, "qdamp")
9999

docs/examples/debyemodelII.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def makeRecipeII():
8787
recipe.add_variable(recipe.highT.offset, name="highToffset")
8888
# We create a new Variable and use the recipe's "constrain" method to
8989
# associate the Debye temperature parameters with that variable.
90-
recipe.newVar("thetaD", 100)
90+
recipe.create_new_variable("thetaD", 100)
9191
recipe.constrain(recipe.lowT.thetaD, "thetaD")
9292
recipe.constrain(recipe.highT.thetaD, "thetaD")
9393
return recipe

docs/examples/npintensity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def gaussian(q, q0, width):
296296
# Variable that we call "Uiso" and constrain the atomic Uiso values to
297297
# this. Note that we don't give Uiso an initial value. The initial value
298298
# will be inferred from the following constraints.
299-
Uiso = recipe.newVar("Uiso")
299+
Uiso = recipe.create_new_variable("Uiso")
300300
for atom in phase.getScatterers():
301301
recipe.constrain(atom.Uiso, Uiso)
302302

docs/examples/npintensityII.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def gaussian(q, q0, width):
178178
# variable that we call "Uiso" and constrain the atomic Uiso values to
179179
# this. Note that we don't give Uiso an initial value. The initial value
180180
# will be inferred from the subsequent constraints.
181-
Uiso = recipe.newVar("Uiso")
181+
Uiso = recipe.create_new_variable("Uiso")
182182
for atom in phase.getScatterers():
183183
recipe.constrain(atom.Uiso, Uiso)
184184

docs/examples/nppdfobjcryst.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def makeRecipe(molecule, datname):
6666
c60 = generator.phase
6767

6868
# First, the isotropic thermal displacement factor.
69-
Biso = recipe.newVar("Biso")
69+
Biso = recipe.create_new_variable("Biso")
7070
for atom in c60.getScatterers():
7171

7272
# We have defined a 'center' atom that is a dummy, which means that it
@@ -88,7 +88,7 @@ def makeRecipe(molecule, datname):
8888
# that we don't give it an initial value. Since the variable is being
8989
# directly constrained to further below, its initial value will be inferred
9090
# from the constraint.
91-
radius = recipe.newVar("radius")
91+
radius = recipe.create_new_variable("radius")
9292
for i, atom in enumerate(c60.getScatterers()):
9393

9494
if atom.isDummy():

docs/examples/simplepdftwophase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def makeRecipe(niciffile, siciffile, datname):
4646
# Configure the fit variables
4747
# Start by configuring the scale factor and resolution factors.
4848
# We want the sum of the phase scale factors to be 1.
49-
recipe.newVar("scale_ni", 0.1)
49+
recipe.create_new_variable("scale_ni", 0.1)
5050
recipe.constrain(contribution.ni.scale, "scale_ni")
5151
recipe.constrain(contribution.si.scale, "1 - scale_ni")
5252
# We also want the resolution factor to be the same on each. This is done

docs/examples/threedoublepeaks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def peakloc(mu):
126126

127127
# Vary the width of the peaks. We know the functional form of the peak
128128
# broadening.
129-
recipe.newVar("sig0", 0.001)
130-
recipe.newVar("dsig", 4)
129+
recipe.create_new_variable("sig0", 0.001)
130+
recipe.create_new_variable("dsig", 4)
131131

132132
def sig(sig0, dsig, mu):
133133
"""Calculate the peak broadening with respect to position."""

0 commit comments

Comments
 (0)