diff --git a/news/add-docformatter.rst b/news/add-docformatter.rst new file mode 100644 index 00000000..41a1befc --- /dev/null +++ b/news/add-docformatter.rst @@ -0,0 +1,23 @@ +**Added:** + +* Add docformatter config to pyproject.toml + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/pyproject.toml b/pyproject.toml index f007f315..735b5e78 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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?$' diff --git a/src/diffpy/morph/morph_helpers/__init__.py b/src/diffpy/morph/morph_helpers/__init__.py index fe7eeae5..c59dd2f5 100644 --- a/src/diffpy/morph/morph_helpers/__init__.py +++ b/src/diffpy/morph/morph_helpers/__init__.py @@ -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 diff --git a/src/diffpy/morph/morph_io.py b/src/diffpy/morph/morph_io.py index a306542b..b12cd3f1 100644 --- a/src/diffpy/morph/morph_io.py +++ b/src/diffpy/morph/morph_io.py @@ -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 ---------- @@ -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_.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_.cgr'. Used when saving multiple morphs. @@ -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 ---------- @@ -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 ---------- diff --git a/src/diffpy/morph/morphs/morphfuncy.py b/src/diffpy/morph/morphs/morphfuncy.py index 9e72b719..427db48d 100644 --- a/src/diffpy/morph/morphs/morphfuncy.py +++ b/src/diffpy/morph/morphs/morphfuncy.py @@ -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" @@ -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 ----------------------- diff --git a/src/diffpy/morph/morphs/morphresolution.py b/src/diffpy/morph/morphs/morphresolution.py index 922e39d3..eb4b65b1 100644 --- a/src/diffpy/morph/morphs/morphresolution.py +++ b/src/diffpy/morph/morphs/morphresolution.py @@ -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 diff --git a/src/diffpy/morph/plot.py b/src/diffpy/morph/plot.py index 21e94e8d..d0ca14b0 100644 --- a/src/diffpy/morph/plot.py +++ b/src/diffpy/morph/plot.py @@ -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 @@ -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. diff --git a/src/diffpy/morph/tools.py b/src/diffpy/morph/tools.py index 706b33db..3b56cc87 100644 --- a/src/diffpy/morph/tools.py +++ b/src/diffpy/morph/tools.py @@ -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 ---------- @@ -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 ----------