Skip to content

ci: add docformatter config to pyproject.toml and apply them to the files #214

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 2 commits into from
Jun 18, 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
23 changes: 23 additions & 0 deletions news/add-docformatter.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Add docformatter config to pyproject.toml

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ exclude-file = ".codespell/ignore_lines.txt"
ignore-words = ".codespell/ignore_words.txt"
skip = "*.cif,*.dat,*agr"

[tool.docformatter]
recursive = true
wrap-summaries = 72
wrap-descriptions = 72

[tool.black]
line-length = 79
include = '\.pyi?$'
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/morph/morph_helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# See LICENSE.txt for license information.
#
##############################################################################
"""List of helpers for certain morphing operations (currently only used for
smear)."""
"""List of helpers for certain morphing operations (currently only used
for smear)."""

from diffpy.morph.morph_helpers.transformpdftordf import TransformXtalPDFtoRDF
from diffpy.morph.morph_helpers.transformrdftopdf import TransformXtalRDFtoPDF
Expand Down
20 changes: 10 additions & 10 deletions src/diffpy/morph/morph_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def single_morph_output(
verbose=False,
stdout_flag=False,
):
"""Helper function for printing details about a single morph. Handles both
printing to terminal and printing to a file.
"""Helper function for printing details about a single morph.
Handles both printing to terminal and printing to a file.

Parameters
----------
Expand Down Expand Up @@ -135,10 +135,10 @@ def create_morphs_directory(save_directory):


def get_multisave_names(target_list: list, save_names_file=None, mm=False):
"""Create or import a dictionary that specifies names to save morphs as.
First attempt to import names from a specified file. If names for certain
morphs not found, use default naming scheme: 'Morph_with_Target_<target
file name>.cgr'.
"""Create or import a dictionary that specifies names to save morphs
as. First attempt to import names from a specified file. If names
for certain morphs not found, use default naming scheme:
'Morph_with_Target_<target file name>.cgr'.

Used when saving multiple morphs.

Expand Down Expand Up @@ -204,8 +204,8 @@ def multiple_morph_output(
stdout_flag=False,
mm=False,
):
"""Helper function for printing details about a series of multiple morphs.
Handles both printing to terminal and printing to a file.
"""Helper function for printing details about a series of multiple
morphs. Handles both printing to terminal and printing to a file.

Parameters
----------
Expand Down Expand Up @@ -320,8 +320,8 @@ def multiple_morph_output(


def tabulate_results(multiple_morph_results):
"""Helper function to make a data table summarizing details about the
results of multiple morphs.
"""Helper function to make a data table summarizing details about
the results of multiple morphs.

Parameters
----------
Expand Down
9 changes: 5 additions & 4 deletions src/diffpy/morph/morphs/morphfuncy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


class MorphFuncy(Morph):
"""Apply the user-supplied Python function to the y-coordinates of the
morph data."""
"""Apply the user-supplied Python function to the y-coordinates of
the morph data."""

# Define input output types
summary = "Apply a Python function to the y-axis data"
Expand All @@ -14,8 +14,9 @@ class MorphFuncy(Morph):
parnames = ["funcy"]

def morph(self, x_morph, y_morph, x_target, y_target):
"""General morph function that applies a user-supplied function to the
y-coordinates of morph data to make it align with a target.
"""General morph function that applies a user-supplied function
to the y-coordinates of morph data to make it align with a
target.

Configuration Variables
-----------------------
Expand Down
3 changes: 2 additions & 1 deletion src/diffpy/morph/morphs/morphresolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See LICENSE.txt for license information.
#
##############################################################################
"""Class MorphResolutionDamping -- apply resolution broadening to the morph."""
"""Class MorphResolutionDamping -- apply resolution broadening to the
morph."""


import numpy
Expand Down
6 changes: 4 additions & 2 deletions src/diffpy/morph/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See LICENSE.txt for license information.
#
##############################################################################
"""Collection of plotting functions (originally specifically) for PDFs."""
"""Collection of plotting functions (originally specifically) for
PDFs."""

import matplotlib.pyplot as plt
import numpy
Expand Down Expand Up @@ -80,7 +81,8 @@ def compare_funcs(
legend=True,
l_width=1.5,
):
"""Plot two functions g(r) on top of each other and difference curve.
"""Plot two functions g(r) on top of each other and difference
curve.

The second function will be shown as blue circles below and the first as
a red line. The difference curve will be in green and offset for clarity.
Expand Down
10 changes: 5 additions & 5 deletions src/diffpy/morph/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ def case_insensitive_dictionary_search(key: str, dictionary: dict):
def field_sort(
filepaths: list, field, reverse=False, serfile=None, get_field_values=False
):
"""Sort a list of files by a field stored in header information. All files
must contain this header information.
"""Sort a list of files by a field stored in header information. All
files must contain this header information.

Parameters
----------
Expand Down Expand Up @@ -240,9 +240,9 @@ def field_sort(
def get_values_from_dictionary_collection(
dictionary_collection: iter, target_key
):
"""In an (iterable) collection of dictionaries, search for a target key in
each dictionary. Return a list of all found values corresponding to that
key.
"""In an (iterable) collection of dictionaries, search for a target
key in each dictionary. Return a list of all found values
corresponding to that key.

Parameters
----------
Expand Down
Loading