Skip to content

Commit ed2c088

Browse files
authored
ci: add docformatter config to pyproject.toml and apply them to the files (#214)
* ci: add docformatter config and apply it to files * docs: add news file
1 parent a48bb6b commit ed2c088

File tree

8 files changed

+56
-24
lines changed

8 files changed

+56
-24
lines changed

news/add-docformatter.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* Add docformatter config to pyproject.toml
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ exclude-file = ".codespell/ignore_lines.txt"
5959
ignore-words = ".codespell/ignore_words.txt"
6060
skip = "*.cif,*.dat,*agr"
6161

62+
[tool.docformatter]
63+
recursive = true
64+
wrap-summaries = 72
65+
wrap-descriptions = 72
66+
6267
[tool.black]
6368
line-length = 79
6469
include = '\.pyi?$'

src/diffpy/morph/morph_helpers/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# See LICENSE.txt for license information.
1111
#
1212
##############################################################################
13-
"""List of helpers for certain morphing operations (currently only used for
14-
smear)."""
13+
"""List of helpers for certain morphing operations (currently only used
14+
for smear)."""
1515

1616
from diffpy.morph.morph_helpers.transformpdftordf import TransformXtalPDFtoRDF
1717
from diffpy.morph.morph_helpers.transformrdftopdf import TransformXtalRDFtoPDF

src/diffpy/morph/morph_io.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ def single_morph_output(
3434
verbose=False,
3535
stdout_flag=False,
3636
):
37-
"""Helper function for printing details about a single morph. Handles both
38-
printing to terminal and printing to a file.
37+
"""Helper function for printing details about a single morph.
38+
Handles both printing to terminal and printing to a file.
3939
4040
Parameters
4141
----------
@@ -135,10 +135,10 @@ def create_morphs_directory(save_directory):
135135

136136

137137
def get_multisave_names(target_list: list, save_names_file=None, mm=False):
138-
"""Create or import a dictionary that specifies names to save morphs as.
139-
First attempt to import names from a specified file. If names for certain
140-
morphs not found, use default naming scheme: 'Morph_with_Target_<target
141-
file name>.cgr'.
138+
"""Create or import a dictionary that specifies names to save morphs
139+
as. First attempt to import names from a specified file. If names
140+
for certain morphs not found, use default naming scheme:
141+
'Morph_with_Target_<target file name>.cgr'.
142142
143143
Used when saving multiple morphs.
144144
@@ -204,8 +204,8 @@ def multiple_morph_output(
204204
stdout_flag=False,
205205
mm=False,
206206
):
207-
"""Helper function for printing details about a series of multiple morphs.
208-
Handles both printing to terminal and printing to a file.
207+
"""Helper function for printing details about a series of multiple
208+
morphs. Handles both printing to terminal and printing to a file.
209209
210210
Parameters
211211
----------
@@ -320,8 +320,8 @@ def multiple_morph_output(
320320

321321

322322
def tabulate_results(multiple_morph_results):
323-
"""Helper function to make a data table summarizing details about the
324-
results of multiple morphs.
323+
"""Helper function to make a data table summarizing details about
324+
the results of multiple morphs.
325325
326326
Parameters
327327
----------

src/diffpy/morph/morphs/morphfuncy.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33

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

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

1616
def morph(self, x_morph, y_morph, x_target, y_target):
17-
"""General morph function that applies a user-supplied function to the
18-
y-coordinates of morph data to make it align with a target.
17+
"""General morph function that applies a user-supplied function
18+
to the y-coordinates of morph data to make it align with a
19+
target.
1920
2021
Configuration Variables
2122
-----------------------

src/diffpy/morph/morphs/morphresolution.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See LICENSE.txt for license information.
1313
#
1414
##############################################################################
15-
"""Class MorphResolutionDamping -- apply resolution broadening to the morph."""
15+
"""Class MorphResolutionDamping -- apply resolution broadening to the
16+
morph."""
1617

1718

1819
import numpy

src/diffpy/morph/plot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See LICENSE.txt for license information.
1313
#
1414
##############################################################################
15-
"""Collection of plotting functions (originally specifically) for PDFs."""
15+
"""Collection of plotting functions (originally specifically) for
16+
PDFs."""
1617

1718
import matplotlib.pyplot as plt
1819
import numpy
@@ -80,7 +81,8 @@ def compare_funcs(
8081
legend=True,
8182
l_width=1.5,
8283
):
83-
"""Plot two functions g(r) on top of each other and difference curve.
84+
"""Plot two functions g(r) on top of each other and difference
85+
curve.
8486
8587
The second function will be shown as blue circles below and the first as
8688
a red line. The difference curve will be in green and offset for clarity.

src/diffpy/morph/tools.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ def case_insensitive_dictionary_search(key: str, dictionary: dict):
177177
def field_sort(
178178
filepaths: list, field, reverse=False, serfile=None, get_field_values=False
179179
):
180-
"""Sort a list of files by a field stored in header information. All files
181-
must contain this header information.
180+
"""Sort a list of files by a field stored in header information. All
181+
files must contain this header information.
182182
183183
Parameters
184184
----------
@@ -240,9 +240,9 @@ def field_sort(
240240
def get_values_from_dictionary_collection(
241241
dictionary_collection: iter, target_key
242242
):
243-
"""In an (iterable) collection of dictionaries, search for a target key in
244-
each dictionary. Return a list of all found values corresponding to that
245-
key.
243+
"""In an (iterable) collection of dictionaries, search for a target
244+
key in each dictionary. Return a list of all found values
245+
corresponding to that key.
246246
247247
Parameters
248248
----------

0 commit comments

Comments
 (0)