Skip to content
Prev Previous commit
Next Next commit
use the correct docformatter
  • Loading branch information
cadenmyers13 committed Aug 11, 2026
commit 098741417108d5f430f2446cbb4a38b85aafd301
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 0 additions & 2 deletions docs/examples/core/debye-waller/debyemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def make_recipe():
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 @@ -160,7 +159,6 @@ def make_recipe():

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

# Create the recipe
recipe = make_recipe()

Expand Down
2 changes: 0 additions & 2 deletions docs/examples/core/debye-waller/debyemodelII.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def make_recipeII():
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 = make_recipe()
Expand Down Expand Up @@ -97,7 +96,6 @@ def make_recipeII():

def plot_results(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.get_values()
Expand Down
1 change: 0 additions & 1 deletion docs/examples/core/gaussianfit/gaussiangenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def make_recipe():
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
3 changes: 0 additions & 3 deletions docs/examples/core/gaussianfit/gaussianrecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,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 @@ -93,7 +92,6 @@ def make_recipe():
Once we define the FitRecipe, we can send it an optimizer to be
optimized. See the 'optimize_recipe' function.
"""

# The Profile
# Create a Profile to hold the experimental and calculated signal.
profile = Profile()
Expand Down Expand Up @@ -167,7 +165,6 @@ def optimize_recipe(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 Down
1 change: 0 additions & 1 deletion docs/examples/core/gaussianfit/simplerecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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
1 change: 0 additions & 1 deletion docs/examples/core/gaussianfit/threedoublepeaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def make_recipe():
Robust version with safe defaults for dy, safe peak location
constraint, and stable delta/gaussian handling.
"""

# Profile - load data and ensure y/dy are set
profile = Profile()
data = str(Path(__file__).parent / "threedoublepeaks.dat")
Expand Down
3 changes: 0 additions & 3 deletions docs/examples/core/intensityfit/npintensity.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ def make_recipe(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 @@ -338,7 +337,6 @@ def main():

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

# The background is not part of the standard observed/fit/diff plot
# that plot_recipe produces, so we overlay it afterwards.
q = recipe.bucky.profile.x
Expand Down Expand Up @@ -488,7 +486,6 @@ def make_data(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
1 change: 0 additions & 1 deletion docs/examples/core/intensityfit/npintensityII.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def make_recipe(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
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ def main():
----------
None
"""

# Make some folders to store our output files.
resdir = PWD / "res"
fitdir = PWD / "fit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ def main():
----------
None
"""

# Make some folders to store our output files.
resdir = PWD / "res"
fitdir = PWD / "fit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ def main():
----------
None
"""

# Make some folders to store our output files.
resdir = PWD / "res"
fitdir = PWD / "fit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ def main():
----------
None
"""

# Make some folders to store our output files.
resdir = PWD / "res"
fitdir = PWD / "fit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def make_recipe(stru_path, dat_path):
fitrecipe : The initialized Fit Recipe object using the datname and
structure provided.
"""

stru1 = Structure(filename=str(stru_path))

# 9: Create a Profile object for the experimental dataset and
Expand Down Expand Up @@ -187,7 +186,6 @@ def main():
----------
None
"""

# Make some folders to store our output files.
resdir = PWD / "res"
fitdir = PWD / "fit"
Expand Down
2 changes: 0 additions & 2 deletions docs/examples/pdf/nanoparticle-fit/coreshellnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

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

# The Profile
profile = Profile()

Expand Down Expand Up @@ -141,7 +140,6 @@ def make_recipe(stru1, stru2, datname):

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

# Make the data and the recipe
base_path = Path(__file__).parent
cdsciffile = base_path / "CdS.cif"
Expand Down
66 changes: 37 additions & 29 deletions src/diffpy/cmi/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,23 @@ def _build_parser() -> argparse.ArgumentParser:
"""
p = argparse.ArgumentParser(
prog="cmi",
description=("""\
Welcome to diffpy.cmi, a complex modeling infrastructure for
multi-modal analysis of scientific data.

Diffpy.cmi is designed as an extensible complex modeling
infrastructure. Users and developers can readily integrate
novel data types and constraints into custom workflows. While
widely used for advanced analysis of structural data, the
framework is general and can be applied to any problem where
model parameters are refined to fit calculated quantities to
data.

Diffpy.cmi is comprised of modular units called 'packs' and
'profiles' that facilitate tailored installations for specific
scientific applications. Run 'cmi info -h' for more details.
"""),
description=(
"\nWelcome to diffpy.cmi, a complex modeling "
"infrastructure for multi-modal analysis of "
"scientific data. "
"Diffpy.cmi is designed as an extensible complex "
"modeling infrastructure. Users and developers can "
"readily integrate novel data types and constraints "
"into custom workflows. While widely used for "
"advanced analysis of structural data, the framework "
"is general and can be applied to any problem where "
"model parameters are refined to fit calculated "
"quantities to data. "
"Diffpy.cmi is comprised of modular units called "
"'packs' and 'profiles' that facilitate tailored "
"installations for specific scientific applications. "
"Run 'cmi info -h' for more details."
),
formatter_class=argparse.RawDescriptionHelpFormatter,
)
p.add_argument(
Expand All @@ -89,19 +90,26 @@ def _build_parser() -> argparse.ArgumentParser:
p_info = sub.add_parser(
"info",
help=("Prints info about packs, profiles, and examples.\n "),
description=("""
Definitions:
pack: A collection of data processing routines, models, and examples.
For example, the 'pdf' pack contains packages used for modeling
and refinement of the Atomic Pair Distribution Function (PDF).

profile: A set of pre-defined packs or configurations for a specific
scientific workflow. Profiles can be installed or customized
for different use cases.

examples: Example scripts or folders that can be copied locally using
'cmi copy <example_name>'.
"""),
description=(
"\n"
"Definitions:\n"
"pack: A collection of data processing routines, models, "
"and examples.\n"
" For example, the 'pdf' pack contains packages used "
"for modeling\n"
" and refinement of the Atomic Pair Distribution "
"Function (PDF).\n"
"\n"
"profile: A set of pre-defined packs or configurations for a "
"specific\n"
" scientific workflow. Profiles can be installed or "
"customized\n"
" for different use cases.\n"
"\n"
"examples: Example scripts or folders that can be copied "
"locally using\n"
" 'cmi copy <example_name>'.\n"
),
formatter_class=argparse.RawDescriptionHelpFormatter,
)
p_info.set_defaults()
Expand Down
Loading