Skip to content

Commit 12507e8

Browse files
authored
Merge pull request #75 from bobleesj/cookie-flake8-E266
Fix flake8 error of multiple # (E266)
2 parents a0e5fa5 + e373508 commit 12507e8

24 files changed

+83
-83
lines changed

doc/examples/crystalpdf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
from diffpy.srfit.pdf import PDFGenerator, PDFParser
3333
from diffpy.structure import Structure
3434

35-
####### Example Code
35+
# Example Code
3636

3737

3838
def makeRecipe(ciffile, datname):
3939
"""Create a fitting recipe for crystalline PDF data."""
4040

41-
## The Profile
41+
# The Profile
4242
# This will be used to store the observed and calculated PDF profile.
4343
profile = Profile()
4444

@@ -53,7 +53,7 @@ def makeRecipe(ciffile, datname):
5353
profile.loadParsedData(parser)
5454
profile.setCalculationRange(xmax=20)
5555

56-
## The ProfileGenerator
56+
# The ProfileGenerator
5757
# The PDFGenerator is for configuring and calculating a PDF profile. Here,
5858
# we want to refine a Structure object from diffpy.structure. We tell the
5959
# PDFGenerator that with the 'setStructure' method. All other configuration
@@ -65,18 +65,18 @@ def makeRecipe(ciffile, datname):
6565
stru.read(ciffile)
6666
generator.setStructure(stru)
6767

68-
## The FitContribution
68+
# The FitContribution
6969
# Here we associate the Profile and ProfileGenerator, as has been done
7070
# before.
7171
contribution = FitContribution("nickel")
7272
contribution.addProfileGenerator(generator)
7373
contribution.setProfile(profile, xname="r")
7474

75-
## Make the FitRecipe and add the FitContribution.
75+
# Make the FitRecipe and add the FitContribution.
7676
recipe = FitRecipe()
7777
recipe.addContribution(contribution)
7878

79-
## Configure the fit variables
79+
# Configure the fit variables
8080

8181
# The PDFGenerator class holds the ParameterSet associated with the
8282
# Structure passed above in a data member named "phase". (We could have

doc/examples/crystalpdfall.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from diffpy.srfit.fitbase import FitContribution, FitRecipe, FitResults, Profile
2727
from diffpy.srfit.pdf import PDFGenerator, PDFParser
2828

29-
####### Example Code
29+
# Example Code
3030

3131

3232
def makeProfile(datafile):
@@ -50,14 +50,14 @@ def makeContribution(name, generator, profile):
5050
def makeRecipe(ciffile_ni, ciffile_si, xdata_ni, ndata_ni, xdata_si, xdata_sini):
5151
"""Create a fitting recipe for crystalline PDF data."""
5252

53-
## The Profiles
53+
# The Profiles
5454
# We need a profile for each data set.
5555
xprofile_ni = makeProfile(xdata_ni)
5656
xprofile_si = makeProfile(xdata_si)
5757
nprofile_ni = makeProfile(ndata_ni)
5858
xprofile_sini = makeProfile(xdata_sini)
5959

60-
## The ProfileGenerators
60+
# The ProfileGenerators
6161
# We create one for each phase and share the phases.
6262
xgenerator_ni = PDFGenerator("xG_ni")
6363
stru = loadCrystal(ciffile_ni)
@@ -78,7 +78,7 @@ def makeRecipe(ciffile_ni, ciffile_si, xdata_ni, ndata_ni, xdata_si, xdata_sini)
7878
xgenerator_sini_si = PDFGenerator("xG_sini_si")
7979
xgenerator_sini_si.setPhase(phase_si)
8080

81-
## The FitContributions
81+
# The FitContributions
8282
# We one of these for each data set.
8383
xcontribution_ni = makeContribution("xnickel", xgenerator_ni, xprofile_ni)
8484
xcontribution_si = makeContribution("xsilicon", xgenerator_si, xprofile_si)

doc/examples/crystalpdfobjcryst.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
from diffpy.srfit.fitbase import FitContribution, FitRecipe, FitResults, Profile
2828
from diffpy.srfit.pdf import PDFGenerator, PDFParser
2929

30-
####### Example Code
30+
# Example Code
3131

3232

3333
def makeRecipe(ciffile, datname):
3434
"""Create a fitting recipe for crystalline PDF data."""
3535

36-
## The Profile
36+
# The Profile
3737
# This will be used to store the observed and calculated PDF profile.
3838
profile = Profile()
3939

@@ -46,7 +46,7 @@ def makeRecipe(ciffile, datname):
4646
profile.loadParsedData(parser)
4747
profile.setCalculationRange(xmax=20)
4848

49-
## The ProfileGenerator
49+
# The ProfileGenerator
5050
# This time we use the CreateCrystalFromCIF method of pyobjcryst.crystal to
5151
# create a Crystal object. That object is passed to the PDFGenerator as in
5252
# the previous example.
@@ -55,7 +55,7 @@ def makeRecipe(ciffile, datname):
5555
generator.setStructure(stru)
5656
generator.setQmax(40.0)
5757

58-
## The FitContribution
58+
# The FitContribution
5959
contribution = FitContribution("nickel")
6060
contribution.addProfileGenerator(generator)
6161
contribution.setProfile(profile, xname="r")
@@ -64,7 +64,7 @@ def makeRecipe(ciffile, datname):
6464
recipe = FitRecipe()
6565
recipe.addContribution(contribution)
6666

67-
## Configure the fit variables
67+
# Configure the fit variables
6868

6969
# As before, we get a handle to the structure parameter set. In this case,
7070
# it is a ObjCrystCrystalParSet instance that was created when we called

doc/examples/crystalpdftwodata.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
from diffpy.srfit.fitbase import FitContribution, FitRecipe, FitResults, Profile
2929
from diffpy.srfit.pdf import PDFGenerator, PDFParser
3030

31-
####### Example Code
31+
# Example Code
3232

3333

3434
def makeRecipe(ciffile, xdatname, ndatname):
3535
"""Create a fitting recipe for crystalline PDF data."""
3636

37-
## The Profiles
37+
# The Profiles
3838
# We need a profile for each data set. This means that we will need two
3939
# FitContributions as well.
4040
xprofile = Profile()
@@ -51,7 +51,7 @@ def makeRecipe(ciffile, xdatname, ndatname):
5151
nprofile.loadParsedData(parser)
5252
nprofile.setCalculationRange(xmax=20)
5353

54-
## The ProfileGenerators
54+
# The ProfileGenerators
5555
# We need one of these for the x-ray data.
5656
xgenerator = PDFGenerator("G")
5757
stru = loadCrystal(ciffile)
@@ -76,7 +76,7 @@ def makeRecipe(ciffile, xdatname, ndatname):
7676
ngenerator = PDFGenerator("G")
7777
ngenerator.setPhase(xgenerator.phase)
7878

79-
## The FitContributions
79+
# The FitContributions
8080
# We associate the x-ray PDFGenerator and Profile in one FitContribution...
8181
xcontribution = FitContribution("xnickel")
8282
xcontribution.addProfileGenerator(xgenerator)

doc/examples/crystalpdftwophase.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
from diffpy.srfit.fitbase import FitContribution, FitRecipe, FitResults, Profile
2929
from diffpy.srfit.pdf import PDFGenerator, PDFParser
3030

31-
####### Example Code
31+
# Example Code
3232

3333

3434
def makeRecipe(niciffile, siciffile, datname):
3535
"""Create a fitting recipe for crystalline PDF data."""
3636

37-
## The Profile
37+
# The Profile
3838
profile = Profile()
3939

4040
# Load data and add it to the profile
@@ -43,7 +43,7 @@ def makeRecipe(niciffile, siciffile, datname):
4343
profile.loadParsedData(parser)
4444
profile.setCalculationRange(xmax=20)
4545

46-
## The ProfileGenerator
46+
# The ProfileGenerator
4747
# In order to fit two phases simultaneously, we must use two PDFGenerators.
4848
# PDFGenerator is designed to take care of as little information as it
4949
# must. (Don't do too much, and do it well.) A PDFGenerator can generate
@@ -63,7 +63,7 @@ def makeRecipe(niciffile, siciffile, datname):
6363
stru = loadCrystal(siciffile)
6464
generator_si.setStructure(stru)
6565

66-
## The FitContribution
66+
# The FitContribution
6767
# Add both generators to the FitContribution. Add the Profile. This will
6868
# send the metadata to the generators.
6969
contribution = FitContribution("nisi")
@@ -81,7 +81,7 @@ def makeRecipe(niciffile, siciffile, datname):
8181
recipe = FitRecipe()
8282
recipe.addContribution(contribution)
8383

84-
## Configure the fit variables
84+
# Configure the fit variables
8585
# Start by configuring the scale factor and resolution factors.
8686
# We want the sum of the phase scale factors to be 1.
8787
recipe.newVar("scale_ni", 0.1)

doc/examples/debyemodel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
500.0 0.03946 0.00250
5454
"""
5555

56-
####### Example Code
56+
# Example Code
5757

5858

5959
def makeRecipe():
@@ -80,7 +80,7 @@ def makeRecipe():
8080
8181
"""
8282

83-
## The Profile
83+
# The Profile
8484
# Create a Profile to hold the experimental and calculated signal.
8585
profile = Profile()
8686

@@ -90,7 +90,7 @@ def makeRecipe():
9090
x, y, dy = numpy.hsplit(xydy, 3)
9191
profile.setObservedProfile(x, y, dy)
9292

93-
## The FitContribution
93+
# The FitContribution
9494
# The FitContribution associates the profile with the Debye function.
9595
contribution = FitContribution("pb")
9696
# Tell the contribution about the Profile. We will need to use the
@@ -123,7 +123,7 @@ def makeRecipe():
123123
# can specify that as well.
124124
contribution.setEquation("debye(T, 207.2, abs(thetaD)) + offset")
125125

126-
## The FitRecipe
126+
# The FitRecipe
127127
# The FitRecipe lets us define what we want to fit. It is where we can
128128
# create variables, constraints and restraints. If we had multiple profiles
129129
# to fit simultaneously, the contribution from each could be added to the

doc/examples/debyemodelII.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
from diffpy.srfit.fitbase import FitRecipe, FitResults
4040

41-
####### Example Code
41+
# Example Code
4242

4343

4444
def makeRecipeII():

doc/examples/ellipsoidsas.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
from diffpy.srfit.fitbase import FitContribution, FitRecipe, FitResults, Profile
2222
from diffpy.srfit.sas import SASGenerator, SASParser
2323

24-
####### Example Code
24+
# Example Code
2525

2626

2727
def makeRecipe(datname):
2828
"""Create a fitting recipe for ellipsoidal SAS data."""
2929

30-
## The Profile
30+
# The Profile
3131
# This will be used to store the observed and calculated I(Q) data.
3232
profile = Profile()
3333

@@ -37,7 +37,7 @@ def makeRecipe(datname):
3737
parser.parseFile(datname)
3838
profile.loadParsedData(parser)
3939

40-
## The ProfileGenerator
40+
# The ProfileGenerator
4141
# The SASGenerator is for configuring and calculating a SAS profile. We use
4242
# a sas model to configure and serve as the calculation engine of the
4343
# generator. This allows us to use the full sas model creation
@@ -49,7 +49,7 @@ def makeRecipe(datname):
4949
model = EllipsoidModel()
5050
generator = SASGenerator("generator", model)
5151

52-
## The FitContribution
52+
# The FitContribution
5353
# Here we associate the Profile and ProfileGenerator, as has been done
5454
# before.
5555
contribution = FitContribution("ellipsoid")
@@ -62,11 +62,11 @@ def makeRecipe(datname):
6262
# will have on the estimated parameter uncertainties.
6363
contribution.setResidualEquation("log(eq) - log(y)")
6464

65-
## Make the FitRecipe and add the FitContribution.
65+
# Make the FitRecipe and add the FitContribution.
6666
recipe = FitRecipe()
6767
recipe.addContribution(contribution)
6868

69-
## Configure the fit variables
69+
# Configure the fit variables
7070
# The SASGenerator uses the parameters from the params and dispersion
7171
# attribues of the model. These vary from model to model, but are adopted
7272
# as SrFit Parameters within the generator. Whereas the dispersion

doc/examples/gaussiangenerator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
from diffpy.srfit.fitbase import FitContribution, FitRecipe, Profile, ProfileGenerator
4545

46-
####### Example Code
46+
# Example Code
4747

4848

4949
class GaussianGenerator(ProfileGenerator):
@@ -124,20 +124,20 @@ def makeRecipe():
124124
125125
"""
126126

127-
## The Profile
127+
# The Profile
128128
# Create a Profile to hold the experimental and calculated signal.
129129
profile = Profile()
130130

131131
# Load data and add it to the profile. This uses the loadtxt function from
132132
# numpy.
133133
profile.loadtxt("data/gaussian.dat")
134134

135-
## The ProfileGenerator
135+
# The ProfileGenerator
136136
# Create a GaussianGenerator named "g". This will be the name we use to
137137
# refer to the generator from within the FitContribution equation.
138138
generator = GaussianGenerator("g")
139139

140-
## The FitContribution
140+
# The FitContribution
141141
# Create a FitContribution that will associate the Profile with the
142142
# GaussianGenerator. The GaussianGenerator will be accessible as an
143143
# attribute of the FitContribution by its name ("g"). Note that this will
@@ -146,7 +146,7 @@ def makeRecipe():
146146
contribution.addProfileGenerator(generator)
147147
contribution.setProfile(profile)
148148

149-
## The FitRecipe
149+
# The FitRecipe
150150
# Now we create the FitRecipe and add the FitContribution.
151151
recipe = FitRecipe()
152152
recipe.addContribution(contribution)

doc/examples/gaussianrecipe.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
from diffpy.srfit.fitbase import FitContribution, FitRecipe, FitResults, Profile
5050

51-
####### Example Code
51+
# Example Code
5252

5353

5454
def main():
@@ -92,15 +92,15 @@ def makeRecipe():
9292
9393
"""
9494

95-
## The Profile
95+
# The Profile
9696
# Create a Profile to hold the experimental and calculated signal.
9797
profile = Profile()
9898

9999
# Load data and add it to the profile. This uses the loadtxt function from
100100
# numpy.
101101
profile.loadtxt("data/gaussian.dat")
102102

103-
## The FitContribution
103+
# The FitContribution
104104
# The FitContribution associates the Profile with a fitting equation. The
105105
# FitContribution also stores the parameters of the fitting equation. We
106106
# give our FitContribution then name "g1". We will be able to access the
@@ -128,7 +128,7 @@ def makeRecipe():
128128
# attribute. Parameters also have a 'name' attribute.
129129
contribution.A.value = 1.0
130130

131-
## The FitRecipe
131+
# The FitRecipe
132132
# The FitRecipe lets us define what we want to fit. It is where we can
133133
# create variables, constraints and restraints.
134134
recipe = FitRecipe()

0 commit comments

Comments
 (0)