Skip to content

Commit bb4f92d

Browse files
authored
Merge pull request #114 from sbillinge/codespell
chore: codespell
2 parents ae9d65f + 9232638 commit bb4f92d

35 files changed

+59
-171
lines changed

.codespell/ignore_words.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ mater
66

77
;; Frobenius norm used in np.linalg.norm
88
fro
9+
10+
;; nin is a legit variable in builder
11+
nin
12+
13+
;; highT is used for high Temperature in examples/debymodelII
14+
highT

.travis.yml

Lines changed: 0 additions & 118 deletions
This file was deleted.

doc/examples/coreshellnp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def makeRecipe(stru1, stru2, datname):
101101
recipe.constrain(generator_zns.scale, "1 - scale_CdS")
102102
# We also want the resolution factor to be the same on each.
103103

104-
# Vary the gloabal scale as well.
104+
# Vary the global scale as well.
105105
recipe.addVar(contribution.scale, 0.3)
106106

107107
# Now we can configure the structural parameters. We tag the different

doc/examples/crystalpdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
This is example of fitting the fcc nickel structure to measured PDF
1818
data. The purpose of this example is to demonstrate and describe the
19-
classes in configuraiton options involved with setting up a fit in this
19+
classes in configuration options involved with setting up a fit in this
2020
way. The main benefit of using SrFit for PDF refinement is the
2121
flexibility of modifying the PDF profile function for specific needs,
2222
adding restraints to a fit and the ability to simultaneously refine a

doc/examples/crystalpdfall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def makeRecipe(
132132
recipe.constrain(xgenerator_sini_si.scale, "1 - pscale_sini_ni")
133133

134134
# The qdamp parameters are too correlated to vary so we fix them based on
135-
# previous measurments.
135+
# previous measurements.
136136
xgenerator_ni.qdamp.value = 0.055
137137
xgenerator_si.qdamp.value = 0.051
138138
ngenerator_ni.qdamp.value = 0.030

doc/examples/crystalpdftwodata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def makeRecipe(ciffile, xdatname, ndatname):
117117
recipe.addVar(ngenerator.scale, 1, "nscale")
118118
recipe.addVar(xgenerator.qdamp, 0.01, "xqdamp")
119119
recipe.addVar(ngenerator.qdamp, 0.01, "nqdamp")
120-
# delta2 is a non-structual material propery. Thus, we constrain together
120+
# delta2 is a non-structual material property. Thus, we constrain together
121121
# delta2 Parameter from each PDFGenerator.
122122
delta2 = recipe.newVar("delta2", 2)
123123
recipe.constrain(xgenerator.delta2, delta2)

doc/examples/crystalpdftwophase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def makeRecipe(niciffile, siciffile, datname):
9696
recipe.constrain(generator_ni.qdamp, "qdamp")
9797
recipe.constrain(generator_si.qdamp, "qdamp")
9898

99-
# Vary the gloabal scale as well.
99+
# Vary the global scale as well.
100100
recipe.addVar(contribution.scale, 1)
101101

102102
# Now we can configure the structural parameters. Since we're using

doc/examples/debyemodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def makeRecipe():
145145
# We would like to 'suggest' that the offset should remain positive. This
146146
# is somethine that we know about the system that might help the refinement
147147
# converge to a physically reasonable result. We will do this with a soft
148-
# contraint, or restraint. Here we restrain the offset variable to between
148+
# constraint, or restraint. Here we restrain the offset variable to between
149149
# 0 and infinity. We tell the recipe that we want to scale the penalty for
150150
# breaking the restraint by the point-average chi^2 value so that the
151151
# restraint is roughly as significant as any other data point throughout

doc/examples/ellipsoidsas.py

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

7272
## Configure the fit variables
7373
# The SASGenerator uses the parameters from the params and dispersion
74-
# attribues of the model. These vary from model to model, but are adopted
74+
# attributes of the model. These vary from model to model, but are adopted
7575
# as SrFit Parameters within the generator. Whereas the dispersion
7676
# parameters are accessible as, e.g. "radius.width", within the
7777
# SASGenerator these are named like "radius_width".

doc/examples/gaussianrecipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
3232
Extensions
3333
34-
After reading through the code, try to perform the folowing tasks. The process
34+
After reading through the code, try to perform the following tasks. The process
3535
will leave you with a much better understanding of how SrFit works.
3636
3737
- Play around with setting the values of the Variables and Parameters. What

doc/examples/npintensity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def makeData(strufile, q, datname, scale, a, Uiso, sig, bkgc, nl=1):
508508

509509
y += bkgd
510510

511-
# Multipy by a scale factor
511+
# Multiply by a scale factor
512512
y *= scale
513513

514514
# Calculate the uncertainty

doc/examples/simplepdftwophase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def makeRecipe(niciffile, siciffile, datname):
5252
# for free by the PDFContribution. We simply need to add it to the recipe.
5353
recipe.addVar(contribution.qdamp, 0.03)
5454

55-
# Vary the gloabal scale as well.
55+
# Vary the global scale as well.
5656
recipe.addVar(contribution.scale, 1)
5757

5858
# Now we can configure the structural parameters. Since we're using

src/diffpy/srfit/equation/builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def _getUndefinedArgs(self, eqstr):
368368
# builders. These will be treated as arguments that need to be
369369
# generated.
370370
for tok in set(args):
371-
# Move genuine varibles to the eqargs dictionary
371+
# Move genuine variables to the eqargs dictionary
372372
if (
373373
# Check registered builders
374374
tok in self.builders
@@ -427,13 +427,13 @@ def __evalBinary(self, other, OperatorClass, onleft=True):
427427
Other can be an BaseBuilder or a constant.
428428
429429
onleft -- Indicates that the operator was passed on the left side
430-
(defualt True).
430+
(default True).
431431
"""
432432
# Create the Operator
433433
op = OperatorClass()
434434

435435
# onleft takes care of non-commutative operators, and assures that the
436-
# ordering is perserved.
436+
# ordering is preserved.
437437
if onleft:
438438
# Add the literals to the operator
439439
op.addLiteral(self.literal)

src/diffpy/srfit/equation/equationmod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def setRoot(self, root):
164164
def __call__(self, *args, **kw):
165165
"""Call the equation.
166166
167-
New Argument values are acceped as arguments or keyword
167+
New Argument values are accepted as arguments or keyword
168168
assignments (or both). The order of accepted arguments is given
169169
by the args attribute. The Equation will remember values set in
170170
this way.

src/diffpy/srfit/equation/literals/argument.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
##############################################################################
1515
"""Argument class.
1616
17-
Arguments are the leaves of an equation tree, in essense a variable or a
17+
Arguments are the leaves of an equation tree, in essence a variable or a
1818
constant.
1919
"""
2020

src/diffpy/srfit/equation/visitors/argfinder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, getconsts=True):
3434
"""Initialize.
3535
3636
Arguments
37-
getconsts -- Flag indicating whether to grap constant arguments
37+
getconsts -- Flag indicating whether to parse constant arguments
3838
(default True).
3939
"""
4040
self.args = []

src/diffpy/srfit/fitbase/configurable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class Configurable(object):
2626
A Configurable has state of which a FitRecipe must be aware.
2727
2828
Attributes
29-
_configobjs -- Set of Configureables in a hierarcy or instances.
30-
Messasges get passed up the hierarcy to a FitReciple
29+
_configobjs -- Set of Configureables in a hierarchy or instances.
30+
Messages get passed up the hierarchy to a FitReciple
3131
via these objects.
3232
"""
3333

src/diffpy/srfit/fitbase/fitcontribution.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
optionally one or more ProfileGenerators or Calculators that help in
2020
this, and a Profile that holds the observed and calculated signals.
2121
22-
See the examples in the documention for how to use a FitContribution.
22+
See the examples in the documentation for how to use a FitContribution.
2323
"""
2424

2525
__all__ = ["FitContribution"]
@@ -36,7 +36,7 @@ class FitContribution(ParameterSet):
3636
3737
FitContributions organize an Equation that calculates the signal, and a
3838
Profile that holds the signal. ProfileGenerators and Calculators can be
39-
used as well. Contraints and Restraints can be created as part of a
39+
used as well. Constraints and Restraints can be created as part of a
4040
FitContribution.
4141
4242
Attributes

src/diffpy/srfit/fitbase/fitrecipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def newVar(self, name, value=None, fixed=False, tag=None, tags=[]):
517517
This method lets new variables be created that are not tied to a
518518
Parameter. Orphan variables may cause a fit to fail, depending on the
519519
optimization routine, and therefore should only be created to be used
520-
in contraint or restraint equations.
520+
in constraint or restraint equations.
521521
522522
name -- The name of the variable. The variable will be able to be
523523
used by this name in restraint and constraint equations.

src/diffpy/srfit/fitbase/fitresults.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def update(self):
155155
self.residual = numpy.dot(res, res)
156156
self._calculateMetrics()
157157

158-
# Calcualte the restraints penalty
158+
# Calculate the restraints penalty
159159
w = self.chi2 / len(res)
160160
self.penalty = sum([r.penalty(w) for r in recipe._restraintlist])
161161

@@ -600,7 +600,7 @@ def _init(self, con, weight, fitres):
600600

601601
# FIXME: factor rw, chi2, cumrw, cumchi2 to separate functions.
602602
def _calculateMetrics(self):
603-
"""Calculte chi2 and Rw of the recipe."""
603+
"""Calculate chi2 and Rw of the recipe."""
604604
# We take absolute values in case the signal is complex
605605
num = numpy.abs(self.y - self.ycalc)
606606
y = numpy.abs(self.y)

src/diffpy/srfit/fitbase/profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def setCalculationPoints(self, x):
278278
if (self.dyobs == 1).all():
279279
self.dy = numpy.ones_like(self.x)
280280
else:
281-
# FIXME - This does not follow error propogation rules and it
281+
# FIXME - This does not follow error propagation rules and it
282282
# introduces (more) correlation between the data points.
283283
self.dy = rebinArray(self.dyobs, self.xobs, self.x)
284284

src/diffpy/srfit/fitbase/profileparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ProfileParser(object):
4646
dy -- A numpy array containing the uncertainty read
4747
from the file. This is None if the uncertainty
4848
cannot be read.
49-
_x -- Indpendent variable from the chosen bank
49+
_x -- Independent variable from the chosen bank
5050
_y -- Profile from the chosen bank
5151
_dx -- Uncertainty in independent variable from the chosen bank
5252
_dy -- Uncertainty in profile from the chosen bank

src/diffpy/srfit/fitbase/recipeorganizer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def registerFunction(self, f, name=None, argnames=None):
479479
passed in the equation string, as this will be handled automatically.
480480
481481
f -- The callable to register. If this is an Equation
482-
instance, then all that needs to be provied is a name.
482+
instance, then all that needs to be provided is a name.
483483
name -- The name of the function to be used in equations. If
484484
this is None (default), the method will try to
485485
determine the name of the function automatically.
@@ -722,7 +722,7 @@ def unconstrain(self, *pars):
722722
def getConstrainedPars(self, recurse=False):
723723
"""Get a list of constrained managed Parameters in this object.
724724
725-
recurse -- Recurse into managed objects and retrive their constrained
725+
recurse -- Recurse into managed objects and retrieve their constrained
726726
Parameters as well (default False).
727727
"""
728728
const = self._getConstraints(recurse)
@@ -762,7 +762,7 @@ def restrain(self, res, lb=-inf, ub=inf, sig=1, scaled=False, ns={}):
762762
763763
The penalty is calculated as
764764
(max(0, lb - val, val - ub)/sig)**2
765-
and val is the value of the calculated equation. This is multipled by
765+
and val is the value of the calculated equation. This is multiplied by
766766
the average chi^2 if scaled is True.
767767
768768
Raises ValueError if ns uses a name that is already used for a

src/diffpy/srfit/fitbase/restraint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Restraint(Validatable):
4343
4444
The penalty is calculated as
4545
(max(0, lb - val, val - ub)/sig)**2
46-
and val is the value of the calculated equation. This is multipled by the
46+
and val is the value of the calculated equation. This is multiplied by the
4747
average chi^2 if scaled is True.
4848
"""
4949

src/diffpy/srfit/pdf/basepdfgenerator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(self, name="pdf"):
8989
_parnames = ["delta1", "delta2", "qbroad", "scale", "qdamp"]
9090

9191
def _setCalculator(self, calc):
92-
"""Set the SrReal calulator instance.
92+
"""Set the SrReal calculator instance.
9393
9494
Setting the calculator creates Parameters from the variable
9595
attributes of the SrReal calculator.

src/diffpy/srfit/pdf/characteristicfunctions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def lognormalSphericalCF(r, psize, psig):
193193
psize -- The mean particle diameter
194194
psig -- The log-normal width of the particle diameter
195195
196-
Here, r is the independent variable, mu is the mean of the distrubution
196+
Here, r is the independent variable, mu is the mean of the distribution
197197
(not of the particle size), and s is the width of the distribution. This is
198198
the characteristic function for the lognormal distribution of particle
199199
diameter:

0 commit comments

Comments
 (0)