Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
144994c
chore: update pre-commit
danielsirakov May 31, 2026
63dfe87
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] May 31, 2026
bb3c635
chore: fix docformatter and black conflict
danielsirakov Jun 20, 2026
203cde3
Merge branch 'update_pre-commit' of github.com:danielsirakov/diffpy.s…
danielsirakov Jun 20, 2026
cc6ae96
chore: run pre-commit for file I missed
danielsirakov Jun 20, 2026
8977ae6
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Jun 20, 2026
3b3f610
chore: add #FIXME workaround
danielsirakov Jun 22, 2026
9dedf07
chore: add #FIXME workaround
danielsirakov Jun 22, 2026
526a6b4
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Jun 22, 2026
d6dcdab
chore: add another #FIXME workaround
danielsirakov Jun 22, 2026
58d0a66
Merge branch 'update_pre-commit' of github.com:danielsirakov/diffpy.s…
danielsirakov Jun 22, 2026
8a67499
chore: add another #FIXME workaround
danielsirakov Jun 22, 2026
c39542a
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Jun 22, 2026
c824bf4
chore: moved import statement to the top of import modules
danielsirakov Jun 23, 2026
99c5381
chore: moved import statement to the top of import modules
danielsirakov Jun 23, 2026
a8ae0bb
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Jun 23, 2026
92e5781
chore: added try except workaround
danielsirakov Jun 25, 2026
564fa2c
Merge branch 'update_pre-commit' of github.com:danielsirakov/diffpy.s…
danielsirakov Jun 25, 2026
986689c
release: update python support to 3.14
danielsirakov Jun 26, 2026
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
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ci:
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -21,31 +21,31 @@ repos:
- id: check-toml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 26.5.1
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.3.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.13.2
rev: 9.0.0a3
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
rev: 0.9.1
hooks:
- id: nbstripout
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: no-commit-to-branch
name: Prevent Commit to Main Branch
args: ["--branch", "main"]
stages: [pre-commit]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.2
hooks:
- id: codespell
additional_dependencies:
Expand All @@ -58,8 +58,8 @@ repos:
additional_dependencies:
- "prettier@^3.2.4"
# docformatter - PEP 257 compliant docstring formatter
- repo: https://github.com/s-weigand/docformatter
rev: 5757c5190d95e5449f102ace83df92e7d3b06c6c
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.8
hooks:
- id: docformatter
additional_dependencies: [tomli]
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Authors
=======
-------

Christopher Farrow, Pavol Juhas, Simon J. L. Billinge, and members of the Billinge Group

Expand Down
3 changes: 0 additions & 3 deletions docs/examples/coreshellnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

def makeRecipe(stru1, stru2, datname):
"""Create a fitting recipe for crystalline PDF data."""

# The Profile
profile = Profile()

Expand Down Expand Up @@ -133,7 +132,6 @@ def makeRecipe(stru1, stru2, datname):

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# All this should be pretty familiar by now.
r = recipe.cdszns.profile.x
g = recipe.cdszns.profile.y
Expand All @@ -157,7 +155,6 @@ def plotResults(recipe):

def main():
"""Set up and refine the recipe."""

# Make the data and the recipe
cdsciffile = "data/CdS.cif"
znsciffile = "data/ZnS.cif"
Expand Down
2 changes: 0 additions & 2 deletions docs/examples/crystalpdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

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

# The Profile
# This will be used to store the observed and calculated PDF profile.
profile = Profile()
Expand Down Expand Up @@ -131,7 +130,6 @@ def makeRecipe(ciffile, datname):

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# All this should be pretty familiar by now.
r = recipe.nickel.profile.x
g = recipe.nickel.profile.y
Expand Down
2 changes: 0 additions & 2 deletions docs/examples/crystalpdfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def makeRecipe(
ciffile_ni, ciffile_si, xdata_ni, ndata_ni, xdata_si, xdata_sini
):
"""Create a fitting recipe for crystalline PDF data."""

# The Profiles
# We need a profile for each data set.
xprofile_ni = makeProfile(xdata_ni)
Expand Down Expand Up @@ -146,7 +145,6 @@ def makeRecipe(

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# All this should be pretty familiar by now.
xnickel = recipe.xnickel
xr_ni = xnickel.profile.x
Expand Down
1 change: 0 additions & 1 deletion docs/examples/crystalpdfobjcryst.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

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

# The Profile
# This will be used to store the observed and calculated PDF profile.
profile = Profile()
Expand Down
2 changes: 0 additions & 2 deletions docs/examples/crystalpdftwodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

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

# The Profiles
# We need a profile for each data set. This means that we will need two
# FitContributions as well.
Expand Down Expand Up @@ -137,7 +136,6 @@ def makeRecipe(ciffile, xdatname, ndatname):

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# All this should be pretty familiar by now.
xr = recipe.xnickel.profile.x
xg = recipe.xnickel.profile.y
Expand Down
2 changes: 0 additions & 2 deletions docs/examples/crystalpdftwophase.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

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

# The Profile
profile = Profile()

Expand Down Expand Up @@ -142,7 +141,6 @@ def makeRecipe(niciffile, siciffile, datname):

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# All this should be pretty familiar by now.
r = recipe.nisi.profile.x
g = recipe.nisi.profile.y
Expand Down
3 changes: 0 additions & 3 deletions docs/examples/debyemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def makeRecipe():
optimize for the data/equation pair. This can be modified, but we
won't do that here.
"""

# The Profile
# Create a Profile to hold the experimental and calculated signal.
profile = Profile()
Expand Down Expand Up @@ -159,7 +158,6 @@ def makeRecipe():

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# Plot this.
# Note that since the contribution was given the name "pb", it is
# accessible from the recipe with this name. This is a useful way to
Expand All @@ -182,7 +180,6 @@ def plotResults(recipe):

def main():
"""The workflow of creating, running and inspecting a fit."""

# Create the recipe
recipe = makeRecipe()

Expand Down
2 changes: 0 additions & 2 deletions docs/examples/debyemodelII.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def makeRecipeII():
constrain the Debye temperature in each FitContribution to be the
same.
"""

# We'll throw these away. We just want the FitContributions that are
# configured within the recipes.
m1 = makeRecipe()
Expand Down Expand Up @@ -95,7 +94,6 @@ def makeRecipeII():

def plotResults(recipe):
"""Display the results contained within a refined FitRecipe."""

# The variable values are returned in the order in which the variables were
# added to the FitRecipe.
lowToffset, highToffset, thetaD = recipe.getValues()
Expand Down
2 changes: 0 additions & 2 deletions docs/examples/ellipsoidsas.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

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

# The Profile
# This will be used to store the observed and calculated I(Q) data.
profile = Profile()
Expand Down Expand Up @@ -89,7 +88,6 @@ def makeRecipe(datname):

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# All this should be pretty familiar by now.
r = recipe.ellipsoid.profile.x
y = recipe.ellipsoid.profile.y
Expand Down
1 change: 0 additions & 1 deletion docs/examples/gaussiangenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ def makeRecipe():
This will create a FitContribution that uses the GaussianGenerator,
associate this with a Profile, and use this to define a FitRecipe.
"""

# The Profile
# Create a Profile to hold the experimental and calculated signal.
profile = Profile()
Expand Down
4 changes: 0 additions & 4 deletions docs/examples/gaussianrecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@

def main():
"""The workflow of creating, running and inspecting a fit."""

# Start by creating the recipe. The recipe describes the data to be fit,
# the profile generator used to simulate the data and the variables that
# will be tuned by the optimizer.
Expand Down Expand Up @@ -95,7 +94,6 @@ def makeRecipe():
Once we define the FitRecipe, we can send it an optimizer to be
optimized. See the 'scipyOptimize' function.
"""

# The Profile
# Create a Profile to hold the experimental and calculated signal.
profile = Profile()
Expand Down Expand Up @@ -168,7 +166,6 @@ def scipyOptimize(recipe):
we can be minimized using a scipy optimizer. The details are
described in the source.
"""

# We're going to use the least-squares (Levenberg-Marquardt) optimizer from
# scipy. We simply have to give it the function to minimize
# (recipe.residual) and the starting values of the Variables
Expand All @@ -183,7 +180,6 @@ def scipyOptimize(recipe):

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# We can access the data and fit profile through the Profile we created
# above. We get to it through our FitContribution, which we named "g1".
#
Expand Down
3 changes: 0 additions & 3 deletions docs/examples/npintensity.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def makeRecipe(strufile, datname):
This will create a FitContribution that uses the IntensityGenerator,
associate this with a Profile, and use this to define a FitRecipe.
"""

# The Profile
# Create a Profile. This will hold the experimental and calculated signal.
profile = Profile()
Expand Down Expand Up @@ -336,7 +335,6 @@ def main():

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# All this should be pretty familiar by now.
q = recipe.bucky.profile.x

Expand Down Expand Up @@ -484,7 +482,6 @@ def makeData(strufile, q, datname, scale, a, Uiso, sig, bkgc, nl=1):
bkgc -- A parameter that gives minor control of the background.
nl -- Noise level (0, inf), default 1, larger -> less noise.
"""

from diffpy.structure import Structure

S = Structure()
Expand Down
2 changes: 0 additions & 2 deletions docs/examples/npintensityII.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def makeRecipe(strufile, datname1, datname2):
(which is generated by the IntensityGenerator when we load the
structure) in both generators.
"""

# The Profiles
# Create two Profiles for the two FitContributions.
profile1 = Profile()
Expand Down Expand Up @@ -187,7 +186,6 @@ def gaussian(q, q0, width):

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# plotting song and dance
q = recipe.bucky1.profile.x

Expand Down
2 changes: 0 additions & 2 deletions docs/examples/nppdfcrystal.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

def makeRecipe(ciffile, grdata):
"""Make a recipe to model a crystal-like nanoparticle PDF."""

# Set up a PDF fit as has been done in other examples.
pdfprofile = Profile()

Expand Down Expand Up @@ -83,7 +82,6 @@ def makeRecipe(ciffile, grdata):

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# All this should be pretty familiar by now.
r = recipe.pdf.profile.x
g = recipe.pdf.profile.y
Expand Down
3 changes: 0 additions & 3 deletions docs/examples/nppdfobjcryst.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

def makeRecipe(molecule, datname):
"""Create a recipe that uses the DebyePDFGenerator."""

# The Profile
profile = Profile()

Expand Down Expand Up @@ -110,7 +109,6 @@ def makeRecipe(molecule, datname):

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# Plot this.
r = recipe.bucky.profile.x
g = recipe.bucky.profile.y
Expand Down Expand Up @@ -221,7 +219,6 @@ def main():

def makeC60():
"""Make the C60 molecule using pyobjcryst."""

from pyobjcryst.crystal import Crystal
from pyobjcryst.molecule import Molecule
from pyobjcryst.scatteringpower import ScatteringPowerAtom
Expand Down
3 changes: 0 additions & 3 deletions docs/examples/nppdfsas.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def makeRecipe(ciffile, grdata, iqdata):
The fit I(q) is fed into the calculation of G(r), which provides
feedback for the fit parameters of both.
"""

# Create a PDF contribution as before
pdfprofile = Profile()
pdfparser = PDFParser()
Expand Down Expand Up @@ -120,7 +119,6 @@ def makeRecipe(ciffile, grdata, iqdata):

def fitRecipe(recipe):
"""We refine in stages to help the refinement converge."""

# Tune SAS.
recipe.setWeight(recipe.pdf, 0)
recipe.fix("all")
Expand All @@ -147,7 +145,6 @@ def fitRecipe(recipe):

def plotResults(recipe):
"""Plot the results contained within a refined FitRecipe."""

# All this should be pretty familiar by now.
r = recipe.pdf.profile.x
g = recipe.pdf.profile.y
Expand Down
1 change: 0 additions & 1 deletion docs/examples/simplepdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

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

# Work directly with a custom PDFContribution to load the data
contribution = PDFContribution("nickel")
contribution.loadData(datname)
Expand Down
1 change: 0 additions & 1 deletion docs/examples/simplepdftwophase.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

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

# Load data and add it to the profile
contribution = PDFContribution("nisi")
contribution.loadData(datname)
Expand Down
1 change: 0 additions & 1 deletion docs/examples/simplerecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

def main():
"""Set up a simple recipe in a few lines."""

# The SimpleRecipe class is a type of FitRecipe. It provides attribute-like
# access to variables and a residual function that can be minimized.
recipe = SimpleRecipe()
Expand Down
Loading
Loading