Skip to content

chore: codespell #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .codespell/ignore_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ mater

;; Frobenius norm used in np.linalg.norm
fro

;; nin is a legit variable in builder
nin

;; highT is used for high Temperature in examples/debymodelII
highT
118 changes: 0 additions & 118 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion doc/examples/coreshellnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def makeRecipe(stru1, stru2, datname):
recipe.constrain(generator_zns.scale, "1 - scale_CdS")
# We also want the resolution factor to be the same on each.

# Vary the gloabal scale as well.
# Vary the global scale as well.
recipe.addVar(contribution.scale, 0.3)

# Now we can configure the structural parameters. We tag the different
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/crystalpdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

This is example of fitting the fcc nickel structure to measured PDF
data. The purpose of this example is to demonstrate and describe the
classes in configuraiton options involved with setting up a fit in this
classes in configuration options involved with setting up a fit in this
way. The main benefit of using SrFit for PDF refinement is the
flexibility of modifying the PDF profile function for specific needs,
adding restraints to a fit and the ability to simultaneously refine a
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/crystalpdfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def makeRecipe(
recipe.constrain(xgenerator_sini_si.scale, "1 - pscale_sini_ni")

# The qdamp parameters are too correlated to vary so we fix them based on
# previous measurments.
# previous measurements.
xgenerator_ni.qdamp.value = 0.055
xgenerator_si.qdamp.value = 0.051
ngenerator_ni.qdamp.value = 0.030
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/crystalpdftwodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def makeRecipe(ciffile, xdatname, ndatname):
recipe.addVar(ngenerator.scale, 1, "nscale")
recipe.addVar(xgenerator.qdamp, 0.01, "xqdamp")
recipe.addVar(ngenerator.qdamp, 0.01, "nqdamp")
# delta2 is a non-structual material propery. Thus, we constrain together
# delta2 is a non-structual material property. Thus, we constrain together
# delta2 Parameter from each PDFGenerator.
delta2 = recipe.newVar("delta2", 2)
recipe.constrain(xgenerator.delta2, delta2)
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/crystalpdftwophase.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def makeRecipe(niciffile, siciffile, datname):
recipe.constrain(generator_ni.qdamp, "qdamp")
recipe.constrain(generator_si.qdamp, "qdamp")

# Vary the gloabal scale as well.
# Vary the global scale as well.
recipe.addVar(contribution.scale, 1)

# Now we can configure the structural parameters. Since we're using
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/debyemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def makeRecipe():
# We would like to 'suggest' that the offset should remain positive. This
# is somethine that we know about the system that might help the refinement
# converge to a physically reasonable result. We will do this with a soft
# contraint, or restraint. Here we restrain the offset variable to between
# constraint, or restraint. Here we restrain the offset variable to between
# 0 and infinity. We tell the recipe that we want to scale the penalty for
# breaking the restraint by the point-average chi^2 value so that the
# restraint is roughly as significant as any other data point throughout
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/ellipsoidsas.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def makeRecipe(datname):

## Configure the fit variables
# The SASGenerator uses the parameters from the params and dispersion
# attribues of the model. These vary from model to model, but are adopted
# attributes of the model. These vary from model to model, but are adopted
# as SrFit Parameters within the generator. Whereas the dispersion
# parameters are accessible as, e.g. "radius.width", within the
# SASGenerator these are named like "radius_width".
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/gaussianrecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

Extensions

After reading through the code, try to perform the folowing tasks. The process
After reading through the code, try to perform the following tasks. The process
will leave you with a much better understanding of how SrFit works.

- Play around with setting the values of the Variables and Parameters. What
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/npintensity.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def makeData(strufile, q, datname, scale, a, Uiso, sig, bkgc, nl=1):

y += bkgd

# Multipy by a scale factor
# Multiply by a scale factor
y *= scale

# Calculate the uncertainty
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/simplepdftwophase.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def makeRecipe(niciffile, siciffile, datname):
# for free by the PDFContribution. We simply need to add it to the recipe.
recipe.addVar(contribution.qdamp, 0.03)

# Vary the gloabal scale as well.
# Vary the global scale as well.
recipe.addVar(contribution.scale, 1)

# Now we can configure the structural parameters. Since we're using
Expand Down
6 changes: 3 additions & 3 deletions src/diffpy/srfit/equation/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def _getUndefinedArgs(self, eqstr):
# builders. These will be treated as arguments that need to be
# generated.
for tok in set(args):
# Move genuine varibles to the eqargs dictionary
# Move genuine variables to the eqargs dictionary
if (
# Check registered builders
tok in self.builders
Expand Down Expand Up @@ -427,13 +427,13 @@ def __evalBinary(self, other, OperatorClass, onleft=True):
Other can be an BaseBuilder or a constant.

onleft -- Indicates that the operator was passed on the left side
(defualt True).
(default True).
"""
# Create the Operator
op = OperatorClass()

# onleft takes care of non-commutative operators, and assures that the
# ordering is perserved.
# ordering is preserved.
if onleft:
# Add the literals to the operator
op.addLiteral(self.literal)
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srfit/equation/equationmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def setRoot(self, root):
def __call__(self, *args, **kw):
"""Call the equation.

New Argument values are acceped as arguments or keyword
New Argument values are accepted as arguments or keyword
assignments (or both). The order of accepted arguments is given
by the args attribute. The Equation will remember values set in
this way.
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srfit/equation/literals/argument.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
##############################################################################
"""Argument class.

Arguments are the leaves of an equation tree, in essense a variable or a
Arguments are the leaves of an equation tree, in essence a variable or a
constant.
"""

Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srfit/equation/visitors/argfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, getconsts=True):
"""Initialize.

Arguments
getconsts -- Flag indicating whether to grap constant arguments
getconsts -- Flag indicating whether to parse constant arguments
(default True).
"""
self.args = []
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/srfit/fitbase/configurable.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class Configurable(object):
A Configurable has state of which a FitRecipe must be aware.

Attributes
_configobjs -- Set of Configureables in a hierarcy or instances.
Messasges get passed up the hierarcy to a FitReciple
_configobjs -- Set of Configureables in a hierarchy or instances.
Messages get passed up the hierarchy to a FitReciple
via these objects.
"""

Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/srfit/fitbase/fitcontribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
optionally one or more ProfileGenerators or Calculators that help in
this, and a Profile that holds the observed and calculated signals.

See the examples in the documention for how to use a FitContribution.
See the examples in the documentation for how to use a FitContribution.
"""

__all__ = ["FitContribution"]
Expand All @@ -36,7 +36,7 @@ class FitContribution(ParameterSet):

FitContributions organize an Equation that calculates the signal, and a
Profile that holds the signal. ProfileGenerators and Calculators can be
used as well. Contraints and Restraints can be created as part of a
used as well. Constraints and Restraints can be created as part of a
FitContribution.

Attributes
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srfit/fitbase/fitrecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def newVar(self, name, value=None, fixed=False, tag=None, tags=[]):
This method lets new variables be created that are not tied to a
Parameter. Orphan variables may cause a fit to fail, depending on the
optimization routine, and therefore should only be created to be used
in contraint or restraint equations.
in constraint or restraint equations.

name -- The name of the variable. The variable will be able to be
used by this name in restraint and constraint equations.
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/srfit/fitbase/fitresults.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def update(self):
self.residual = numpy.dot(res, res)
self._calculateMetrics()

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

Expand Down Expand Up @@ -600,7 +600,7 @@ def _init(self, con, weight, fitres):

# FIXME: factor rw, chi2, cumrw, cumchi2 to separate functions.
def _calculateMetrics(self):
"""Calculte chi2 and Rw of the recipe."""
"""Calculate chi2 and Rw of the recipe."""
# We take absolute values in case the signal is complex
num = numpy.abs(self.y - self.ycalc)
y = numpy.abs(self.y)
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srfit/fitbase/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def setCalculationPoints(self, x):
if (self.dyobs == 1).all():
self.dy = numpy.ones_like(self.x)
else:
# FIXME - This does not follow error propogation rules and it
# FIXME - This does not follow error propagation rules and it
# introduces (more) correlation between the data points.
self.dy = rebinArray(self.dyobs, self.xobs, self.x)

Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srfit/fitbase/profileparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ProfileParser(object):
dy -- A numpy array containing the uncertainty read
from the file. This is None if the uncertainty
cannot be read.
_x -- Indpendent variable from the chosen bank
_x -- Independent variable from the chosen bank
_y -- Profile from the chosen bank
_dx -- Uncertainty in independent variable from the chosen bank
_dy -- Uncertainty in profile from the chosen bank
Expand Down
6 changes: 3 additions & 3 deletions src/diffpy/srfit/fitbase/recipeorganizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def registerFunction(self, f, name=None, argnames=None):
passed in the equation string, as this will be handled automatically.

f -- The callable to register. If this is an Equation
instance, then all that needs to be provied is a name.
instance, then all that needs to be provided is a name.
name -- The name of the function to be used in equations. If
this is None (default), the method will try to
determine the name of the function automatically.
Expand Down Expand Up @@ -722,7 +722,7 @@ def unconstrain(self, *pars):
def getConstrainedPars(self, recurse=False):
"""Get a list of constrained managed Parameters in this object.

recurse -- Recurse into managed objects and retrive their constrained
recurse -- Recurse into managed objects and retrieve their constrained
Parameters as well (default False).
"""
const = self._getConstraints(recurse)
Expand Down Expand Up @@ -762,7 +762,7 @@ def restrain(self, res, lb=-inf, ub=inf, sig=1, scaled=False, ns={}):

The penalty is calculated as
(max(0, lb - val, val - ub)/sig)**2
and val is the value of the calculated equation. This is multipled by
and val is the value of the calculated equation. This is multiplied by
the average chi^2 if scaled is True.

Raises ValueError if ns uses a name that is already used for a
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srfit/fitbase/restraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Restraint(Validatable):

The penalty is calculated as
(max(0, lb - val, val - ub)/sig)**2
and val is the value of the calculated equation. This is multipled by the
and val is the value of the calculated equation. This is multiplied by the
average chi^2 if scaled is True.
"""

Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srfit/pdf/basepdfgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __init__(self, name="pdf"):
_parnames = ["delta1", "delta2", "qbroad", "scale", "qdamp"]

def _setCalculator(self, calc):
"""Set the SrReal calulator instance.
"""Set the SrReal calculator instance.

Setting the calculator creates Parameters from the variable
attributes of the SrReal calculator.
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srfit/pdf/characteristicfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def lognormalSphericalCF(r, psize, psig):
psize -- The mean particle diameter
psig -- The log-normal width of the particle diameter

Here, r is the independent variable, mu is the mean of the distrubution
Here, r is the independent variable, mu is the mean of the distribution
(not of the particle size), and s is the width of the distribution. This is
the characteristic function for the lognormal distribution of particle
diameter:
Expand Down
Loading
Loading