Skip to content

Commit 545ab13

Browse files
authored
Merge pull request #155 from cadenmyers13/profile-dep
deprecate: Deprecate `Profile` class and `SimpleRecipe` class
2 parents dea5482 + 7443c6a commit 545ab13

24 files changed

Lines changed: 403 additions & 99 deletions

docs/examples/coreshellnp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def makeRecipe(stru1, stru2, datname):
4444
# Load data and add it to the profile
4545
parser = PDFParser()
4646
parser.parseFile(datname)
47-
profile.loadParsedData(parser)
48-
profile.setCalculationRange(xmin=1.5, xmax=45, dx=0.1)
47+
profile.load_parsed_data(parser)
48+
profile.set_calculation_range(xmin=1.5, xmax=45, dx=0.1)
4949

5050
# The ProfileGenerator
5151
# In order to fit the core and shell phases simultaneously, we must use two

docs/examples/crystalpdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def makeRecipe(ciffile, datname):
5555
# configuration steps.
5656
parser = PDFParser()
5757
parser.parseFile(datname)
58-
profile.loadParsedData(parser)
59-
profile.setCalculationRange(xmax=20)
58+
profile.load_parsed_data(parser)
59+
profile.set_calculation_range(xmax=20)
6060

6161
# The ProfileGenerator
6262
# The PDFGenerator is for configuring and calculating a PDF profile. Here,

docs/examples/crystalpdfall.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def makeProfile(datafile):
3939
profile = Profile()
4040
parser = PDFParser()
4141
parser.parseFile(datafile)
42-
profile.loadParsedData(parser)
43-
profile.setCalculationRange(xmax=20)
42+
profile.load_parsed_data(parser)
43+
profile.set_calculation_range(xmax=20)
4444
return profile
4545

4646

docs/examples/crystalpdfobjcryst.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def makeRecipe(ciffile, datname):
4848
# structure being refined.
4949
parser = PDFParser()
5050
parser.parseFile(datname)
51-
profile.loadParsedData(parser)
52-
profile.setCalculationRange(xmax=20)
51+
profile.load_parsed_data(parser)
52+
profile.set_calculation_range(xmax=20)
5353

5454
# The ProfileGenerator
5555
# This time we use the CreateCrystalFromCIF method of pyobjcryst.crystal to

docs/examples/crystalpdftwodata.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ def makeRecipe(ciffile, xdatname, ndatname):
4848
# Load data and add it to the proper Profile.
4949
parser = PDFParser()
5050
parser.parseFile(xdatname)
51-
xprofile.loadParsedData(parser)
52-
xprofile.setCalculationRange(xmax=20)
51+
xprofile.load_parsed_data(parser)
52+
xprofile.set_calculation_range(xmax=20)
5353

5454
parser = PDFParser()
5555
parser.parseFile(ndatname)
56-
nprofile.loadParsedData(parser)
57-
nprofile.setCalculationRange(xmax=20)
56+
nprofile.load_parsed_data(parser)
57+
nprofile.set_calculation_range(xmax=20)
5858

5959
# The ProfileGenerators
6060
# We need one of these for the x-ray data.

docs/examples/crystalpdftwophase.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def makeRecipe(niciffile, siciffile, datname):
4545
# Load data and add it to the profile
4646
parser = PDFParser()
4747
parser.parseFile(datname)
48-
profile.loadParsedData(parser)
49-
profile.setCalculationRange(xmax=20)
48+
profile.load_parsed_data(parser)
49+
profile.set_calculation_range(xmax=20)
5050

5151
# The ProfileGenerator
5252
# In order to fit two phases simultaneously, we must use two PDFGenerators.

docs/examples/debyemodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def makeRecipe():
9393
# data into the profile.
9494
xydy = numpy.array(data.split(), dtype=float).reshape(-1, 3)
9595
x, y, dy = xydy.T
96-
profile.setObservedProfile(x, y, dy)
96+
profile.set_observed_profile(x, y, dy)
9797

9898
# The FitContribution
9999
# The FitContribution associates the profile with the Debye function.

docs/examples/debyemodelII.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def makeRecipeII():
7777
# Change the fit ranges of the Profiles embedded within the
7878
# FitContributions. We want to fit one of the contributions at low
7979
# temperature, and one at high.
80-
lowT.profile.setCalculationRange(0, 150)
81-
highT.profile.setCalculationRange(400, 500)
80+
lowT.profile.set_calculation_range(0, 150)
81+
highT.profile.set_calculation_range(400, 500)
8282

8383
# Vary the offset from each FitContribution separately, while keeping the
8484
# Debye temperatures the same. We give each offset variable a different
@@ -102,8 +102,8 @@ def plotResults(recipe):
102102

103103
# We want to extend the fitting range to its full extent so we can get a
104104
# nice full plot.
105-
recipe.lowT.profile.setCalculationRange(xmin="obs", xmax="obs")
106-
recipe.highT.profile.setCalculationRange(xmin="obs", xmax="obs")
105+
recipe.lowT.profile.set_calculation_range(xmin="obs", xmax="obs")
106+
recipe.highT.profile.set_calculation_range(xmin="obs", xmax="obs")
107107
T = recipe.lowT.profile.x
108108
U = recipe.lowT.profile.y
109109
# We can use a FitContribution's 'evaluateEquation' method to evaluate

docs/examples/ellipsoidsas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def makeRecipe(datname):
3939
# properly and pass the metadata along.
4040
parser = SASParser()
4141
parser.parseFile(datname)
42-
profile.loadParsedData(parser)
42+
profile.load_parsed_data(parser)
4343

4444
# The ProfileGenerator
4545
# The SASGenerator is for configuring and calculating a SAS profile. We use

docs/examples/nppdfcrystal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def makeRecipe(ciffile, grdata):
4444

4545
pdfparser = PDFParser()
4646
pdfparser.parseFile(grdata)
47-
pdfprofile.loadParsedData(pdfparser)
48-
pdfprofile.setCalculationRange(xmin=0.1, xmax=20)
47+
pdfprofile.load_parsed_data(pdfparser)
48+
pdfprofile.set_calculation_range(xmin=0.1, xmax=20)
4949

5050
pdfcontribution = FitContribution("pdf")
5151
pdfcontribution.set_profile(pdfprofile, xname="r")

0 commit comments

Comments
 (0)