From fe5f7ca1acfe1aaa9adfd99b54ed4d81a97a69ad Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Tue, 10 Jun 2025 17:17:47 -0400 Subject: [PATCH] chore: pre-commit auto fixes from prettier --- .codecov.yml | 8 +++---- .github/ISSUE_TEMPLATE/release_checklist.md | 6 ++--- .../workflows/build-wheel-release-upload.yml | 2 +- .github/workflows/check-news-item.yml | 2 +- .pre-commit-config.yaml | 24 +++++++++---------- src/diffpy/__init__.py | 1 - src/diffpy/morph/__init__.py | 3 +-- src/diffpy/morph/log.py | 1 - src/diffpy/morph/morph_api.py | 4 ++-- src/diffpy/morph/morph_helpers/__init__.py | 5 ++-- .../morph/morph_helpers/transformpdftordf.py | 6 +---- .../morph/morph_helpers/transformrdftopdf.py | 6 +---- src/diffpy/morph/morph_io.py | 10 ++++---- src/diffpy/morph/morphapp.py | 4 ++-- src/diffpy/morph/morphs/__init__.py | 4 +--- src/diffpy/morph/morphs/morph.py | 6 ++--- src/diffpy/morph/morphs/morphchain.py | 1 - src/diffpy/morph/morphs/morphfuncy.py | 2 +- src/diffpy/morph/morphs/morphishape.py | 11 ++++----- src/diffpy/morph/morphs/morphresolution.py | 5 +--- src/diffpy/morph/morphs/morphrgrid.py | 5 +--- src/diffpy/morph/morphs/morphscale.py | 5 +--- src/diffpy/morph/morphs/morphshape.py | 12 ++++------ src/diffpy/morph/morphs/morphshift.py | 5 +--- src/diffpy/morph/morphs/morphsmear.py | 5 +--- src/diffpy/morph/morphs/morphsqueeze.py | 6 +++-- src/diffpy/morph/morphs/morphstretch.py | 5 +--- src/diffpy/morph/plot.py | 3 +-- src/diffpy/morph/refine.py | 7 +++--- src/diffpy/morph/tools.py | 15 +++++------- src/diffpy/morph/version.py | 1 - tests/debug.py | 4 +--- tests/run.py | 5 ++-- tests/test_morphchain.py | 2 +- tests/test_morphpdftordf.py | 2 +- tests/test_morphrdftopdf.py | 2 +- tests/test_morphresolution.py | 2 +- tests/test_morphrgrid.py | 8 +++---- tests/test_morphscale.py | 2 +- tests/test_morphshape.py | 4 ++-- tests/test_morphshift.py | 2 +- tests/test_morphsmear.py | 2 +- tests/test_morphstretch.py | 2 +- tests/test_refine.py | 4 ++-- tests/test_tools.py | 7 +++--- tests/test_version.py | 3 +-- 46 files changed, 90 insertions(+), 141 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 5a94096e..4af5eb24 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,14 +1,14 @@ coverage: status: - project: # more options at https://docs.codecov.com/docs/commit-status + project: # more options at https://docs.codecov.com/docs/commit-status default: target: auto # use the coverage from the base commit, fail if coverage is lower - threshold: 0% # allow the coverage to drop by + threshold: 0% # allow the coverage to drop by comment: layout: " diff, flags, files" behavior: default require_changes: false - require_base: false # [true :: must have a base report to post] - require_head: false # [true :: must have a head report to post] + require_base: false # [true :: must have a base report to post] + require_head: false # [true :: must have a head report to post] hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage] diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index 0f560278..99ab0d83 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -12,7 +12,7 @@ assignees: "" - [ ] All the badges on the README are passing. - [ ] License information is verified as correct. If you are unsure, please comment below. - [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are - missing), tutorials, and other human written text is up-to-date with any changes in the code. + missing), tutorials, and other human written text is up-to-date with any changes in the code. - [ ] Installation instructions in the README, documentation and on the website (e.g., diffpy.org) are updated. - [ ] Successfully run any tutorial examples or do functional testing with the latest Python version. - [ ] Grammar and writing quality are checked (no typos). @@ -31,5 +31,5 @@ version information and details about the pre-release here: -- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments. -- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures. +- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments. +- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures. diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index cd49342e..0b6f7d81 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: tags: - - '*' # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml + - "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml jobs: release: diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index d672d34d..68490e47 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -3,7 +3,7 @@ name: Check for News on: pull_request_target: branches: - - main + - main jobs: check-news-item: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9cf0556f..194374f9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,14 @@ default_language_version: - python: python3 + python: python3 ci: - autofix_commit_msg: | - [pre-commit.ci] auto fixes from pre-commit hooks - autofix_prs: true - autoupdate_branch: 'pre-commit-autoupdate' - autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' - autoupdate_schedule: monthly - skip: [no-commit-to-branch] - submodules: false + autofix_commit_msg: | + [pre-commit.ci] auto fixes from pre-commit hooks + autofix_prs: true + autoupdate_branch: "pre-commit-autoupdate" + autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate" + autoupdate_schedule: monthly + skip: [no-commit-to-branch] + submodules: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 @@ -47,6 +47,6 @@ repos: - repo: https://github.com/codespell-project/codespell rev: v2.3.0 hooks: - - id: codespell - additional_dependencies: - - tomli + - id: codespell + additional_dependencies: + - tomli diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 38fef756..a14a0c96 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -12,7 +12,6 @@ # See LICENSE.rst for license information. # ############################################################################## - """morph - tools for manipulating and comparing PDF data. """ diff --git a/src/diffpy/morph/__init__.py b/src/diffpy/morph/__init__.py index b1006e3c..c87d5b6c 100644 --- a/src/diffpy/morph/__init__.py +++ b/src/diffpy/morph/__init__.py @@ -12,8 +12,7 @@ # See LICENSE.rst for license information. # ############################################################################## - -"""Tools for manipulating and comparing PDF profiles""" +"""Tools for manipulating and comparing PDF profiles.""" # key used when saving multiple morphs __save_morph_as__ = "save_morph_as" diff --git a/src/diffpy/morph/log.py b/src/diffpy/morph/log.py index 7e49af6b..c1919566 100644 --- a/src/diffpy/morph/log.py +++ b/src/diffpy/morph/log.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """Configuration of loggers used in this package. Logger instances: diff --git a/src/diffpy/morph/morph_api.py b/src/diffpy/morph/morph_api.py index 22496546..f4b06a72 100644 --- a/src/diffpy/morph/morph_api.py +++ b/src/diffpy/morph/morph_api.py @@ -54,7 +54,7 @@ def morph_default_config(**kwargs): - """function to generate default morph configuration + """Function to generate default morph configuration. Parameters ---------- @@ -96,7 +96,7 @@ def morph( verbose=False, **kwargs, ): - """function to perform PDF morphing. + """Function to perform PDF morphing. Parameters ---------- diff --git a/src/diffpy/morph/morph_helpers/__init__.py b/src/diffpy/morph/morph_helpers/__init__.py index 46b8fe5b..fe7eeae5 100644 --- a/src/diffpy/morph/morph_helpers/__init__.py +++ b/src/diffpy/morph/morph_helpers/__init__.py @@ -10,9 +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_helpers/transformpdftordf.py b/src/diffpy/morph/morph_helpers/transformpdftordf.py index 556edcbf..31331ed7 100644 --- a/src/diffpy/morph/morph_helpers/transformpdftordf.py +++ b/src/diffpy/morph/morph_helpers/transformpdftordf.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class TransformXtalPDFtoRDF -- Transform crystal PDFs to RDFs. -""" +"""Class TransformXtalPDFtoRDF -- Transform crystal PDFs to RDFs.""" from diffpy.morph.morphs.morph import LABEL_GR, LABEL_RA, LABEL_RR, Morph @@ -34,7 +31,6 @@ class TransformXtalPDFtoRDF(Morph): With s = baselineslope, R(r) = r * (G(r) - r * s) - """ # Define input output types diff --git a/src/diffpy/morph/morph_helpers/transformrdftopdf.py b/src/diffpy/morph/morph_helpers/transformrdftopdf.py index 4dce9731..495c7dda 100644 --- a/src/diffpy/morph/morph_helpers/transformrdftopdf.py +++ b/src/diffpy/morph/morph_helpers/transformrdftopdf.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class TransformXtalRDFtoPDF -- Transform crystal RDFs to PDFs. -""" +"""Class TransformXtalRDFtoPDF -- Transform crystal RDFs to PDFs.""" import numpy @@ -36,7 +33,6 @@ class TransformXtalRDFtoPDF(Morph): With s = baselineslope, G(r) = R(r) / r + r * s - """ # Define input output types diff --git a/src/diffpy/morph/morph_io.py b/src/diffpy/morph/morph_io.py index 722771c9..a306542b 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 ---------- @@ -136,9 +136,9 @@ 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'. + 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. diff --git a/src/diffpy/morph/morphapp.py b/src/diffpy/morph/morphapp.py index 2feba7c0..ad7ca73c 100755 --- a/src/diffpy/morph/morphapp.py +++ b/src/diffpy/morph/morphapp.py @@ -42,8 +42,8 @@ def __init__(self, *args, **kwargs): def custom_error(self, msg): """custom_error(msg : string) - Print a message incorporating 'msg' to stderr and exit. - Does not print usage. + Print a message incorporating 'msg' to stderr and exit. Does + not print usage. """ self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) diff --git a/src/diffpy/morph/morphs/__init__.py b/src/diffpy/morph/morphs/__init__.py index 0322e98f..a1cbdc88 100644 --- a/src/diffpy/morph/morphs/__init__.py +++ b/src/diffpy/morph/morphs/__init__.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Definition of morphs. -""" +"""Definition of morphs.""" from diffpy.morph.morphs.morph import Morph # noqa: F401 diff --git a/src/diffpy/morph/morphs/morph.py b/src/diffpy/morph/morphs/morph.py index 0b7cb543..5f6c2ccc 100644 --- a/src/diffpy/morph/morphs/morph.py +++ b/src/diffpy/morph/morphs/morph.py @@ -12,8 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - - """Morph -- base class for defining a morph. """ @@ -198,7 +196,7 @@ def checkConfig(self): return def plotInputs(self, xylabels=True): - """Plot input arrays using matplotlib.pyplot + """Plot input arrays using matplotlib.pyplot. Parameters ---------- @@ -220,7 +218,7 @@ def plotInputs(self, xylabels=True): return rv def plotOutputs(self, xylabels=True, **plotargs): - """Plot output arrays using matplotlib.pyplot + """Plot output arrays using matplotlib.pyplot. Parameters ---------- diff --git a/src/diffpy/morph/morphs/morphchain.py b/src/diffpy/morph/morphs/morphchain.py index 1dc05b41..e7a8f824 100644 --- a/src/diffpy/morph/morphs/morphchain.py +++ b/src/diffpy/morph/morphs/morphchain.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """MorphChain -- Chain of morphs executed in order. """ diff --git a/src/diffpy/morph/morphs/morphfuncy.py b/src/diffpy/morph/morphs/morphfuncy.py index e0b5fe7f..9e72b719 100644 --- a/src/diffpy/morph/morphs/morphfuncy.py +++ b/src/diffpy/morph/morphs/morphfuncy.py @@ -3,7 +3,7 @@ class MorphFuncy(Morph): """Apply the user-supplied Python function to the y-coordinates of the - morph data""" + morph data.""" # Define input output types summary = "Apply a Python function to the y-axis data" diff --git a/src/diffpy/morph/morphs/morphishape.py b/src/diffpy/morph/morphs/morphishape.py index 5cf3da91..6492b9d2 100644 --- a/src/diffpy/morph/morphs/morphishape.py +++ b/src/diffpy/morph/morphs/morphishape.py @@ -12,11 +12,8 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphISphere -- apply inverse spherical shape function -class MorphISpheroid -- apply inverse spheroidal shape function -""" +"""Class MorphISphere -- apply inverse spherical shape function class +MorphISpheroid -- apply inverse spheroidal shape function.""" import numpy @@ -26,7 +23,7 @@ class MorphISpheroid -- apply inverse spheroidal shape function class MorphISphere(Morph): - """Apply inverse spherical characteristic function to the morph + """Apply inverse spherical characteristic function to the morph. Configuration Variables ----------------------- @@ -56,7 +53,7 @@ def morph(self, x_morph, y_morph, x_target, y_target): class MorphISpheroid(Morph): - """Apply inverse spherical characteristic function to the morph + """Apply inverse spherical characteristic function to the morph. Configuration Variables ----------------------- diff --git a/src/diffpy/morph/morphs/morphresolution.py b/src/diffpy/morph/morphs/morphresolution.py index a7246ad3..922e39d3 100644 --- a/src/diffpy/morph/morphs/morphresolution.py +++ b/src/diffpy/morph/morphs/morphresolution.py @@ -12,10 +12,7 @@ # 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/morphs/morphrgrid.py b/src/diffpy/morph/morphs/morphrgrid.py index dc9b68d3..fadce9f7 100644 --- a/src/diffpy/morph/morphs/morphrgrid.py +++ b/src/diffpy/morph/morphs/morphrgrid.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphRGrid -- put morph and target on desired grid. -""" +"""Class MorphRGrid -- put morph and target on desired grid.""" import numpy diff --git a/src/diffpy/morph/morphs/morphscale.py b/src/diffpy/morph/morphs/morphscale.py index 2f5c6b4d..c2bd86c7 100644 --- a/src/diffpy/morph/morphs/morphscale.py +++ b/src/diffpy/morph/morphs/morphscale.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphScale -- scale the morph data -""" +"""Class MorphScale -- scale the morph data.""" from diffpy.morph.morphs.morph import LABEL_GR, LABEL_RA, Morph diff --git a/src/diffpy/morph/morphs/morphshape.py b/src/diffpy/morph/morphs/morphshape.py index 9aae3d78..0405f3d1 100644 --- a/src/diffpy/morph/morphs/morphshape.py +++ b/src/diffpy/morph/morphs/morphshape.py @@ -12,11 +12,8 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphSphere -- apply a spherical shape function to the morph -class MorphSpheroid -- apply a spheroidal shape function to the morph -""" +"""Class MorphSphere -- apply a spherical shape function to the morph class +MorphSpheroid -- apply a spheroidal shape function to the morph.""" import numpy @@ -28,7 +25,7 @@ class MorphSpheroid -- apply a spheroidal shape function to the morph class MorphSphere(Morph): - """Apply a spherical characteristic function to the morph + """Apply a spherical characteristic function to the morph. Configuration Variables ----------------------- @@ -56,7 +53,7 @@ def morph(self, x_morph, y_morph, x_target, y_target): class MorphSpheroid(Morph): - """Apply a spherical characteristic function to the morph + """Apply a spherical characteristic function to the morph. Configuration Variables ----------------------- @@ -143,7 +140,6 @@ def _spheroidalCF2(r, psize, axrat): axrat -- The ratio of axis lengths From Lei et al., Phys. Rev. B, 80, 024118 (2009) - """ pelpt = axrat diff --git a/src/diffpy/morph/morphs/morphshift.py b/src/diffpy/morph/morphs/morphshift.py index b3ac8818..b4f6c9f8 100644 --- a/src/diffpy/morph/morphs/morphshift.py +++ b/src/diffpy/morph/morphs/morphshift.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphShift -- shift the morph -""" +"""Class MorphShift -- shift the morph.""" import numpy diff --git a/src/diffpy/morph/morphs/morphsmear.py b/src/diffpy/morph/morphs/morphsmear.py index 2495ee38..b8735919 100644 --- a/src/diffpy/morph/morphs/morphsmear.py +++ b/src/diffpy/morph/morphs/morphsmear.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphSmear -- smear the morph. -""" +"""Class MorphSmear -- smear the morph.""" import numpy diff --git a/src/diffpy/morph/morphs/morphsqueeze.py b/src/diffpy/morph/morphs/morphsqueeze.py index fc6493d6..6e41fc3d 100644 --- a/src/diffpy/morph/morphs/morphsqueeze.py +++ b/src/diffpy/morph/morphs/morphsqueeze.py @@ -6,8 +6,10 @@ class MorphSqueeze(Morph): - """Apply a polynomial to squeeze the morph function. The morphed - data is returned on the same grid as the unmorphed data.""" + """Apply a polynomial to squeeze the morph function. + + The morphed data is returned on the same grid as the unmorphed data. + """ # Define input output types summary = "Squeeze morph by polynomial shift" diff --git a/src/diffpy/morph/morphs/morphstretch.py b/src/diffpy/morph/morphs/morphstretch.py index 6b99caea..78c25c8b 100644 --- a/src/diffpy/morph/morphs/morphstretch.py +++ b/src/diffpy/morph/morphs/morphstretch.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphStretch -- stretch the morph. -""" +"""Class MorphStretch -- stretch the morph.""" import numpy diff --git a/src/diffpy/morph/plot.py b/src/diffpy/morph/plot.py index 1ff29466..21e94e8d 100644 --- a/src/diffpy/morph/plot.py +++ b/src/diffpy/morph/plot.py @@ -227,8 +227,7 @@ def compare_funcs( def plot_param(target_labels, param_list, param_name=None, field=None): - """ - Plot Rw values for multiple morphs. + """Plot Rw values for multiple morphs. Parameters ---------- diff --git a/src/diffpy/morph/refine.py b/src/diffpy/morph/refine.py index 11b4a2c0..9514f8d8 100644 --- a/src/diffpy/morph/refine.py +++ b/src/diffpy/morph/refine.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """refine -- Refine a morph or morph chain """ @@ -82,9 +81,9 @@ def _residual(self, pvals): def _pearson(self, pvals): """Pearson correlation function. - This gives e**-p (vector), where p is the pearson correlation function. - We seek to minimize this, which occurs when the correlation is the - largest. + This gives e**-p (vector), where p is the pearson correlation + function. We seek to minimize this, which occurs when the + correlation is the largest. """ self._update_chain(pvals) _x_morph, _y_morph, _x_target, _y_target = self.chain( diff --git a/src/diffpy/morph/tools.py b/src/diffpy/morph/tools.py index f9b024dd..706b33db 100644 --- a/src/diffpy/morph/tools.py +++ b/src/diffpy/morph/tools.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""Tools used in morphs and morph chains. -""" +"""Tools used in morphs and morph chains.""" import numpy @@ -180,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 ---------- @@ -243,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 ---------- diff --git a/src/diffpy/morph/version.py b/src/diffpy/morph/version.py index 1077d2ca..effe3cd5 100644 --- a/src/diffpy/morph/version.py +++ b/src/diffpy/morph/version.py @@ -12,7 +12,6 @@ # See LICENSE.rst for license information. # ############################################################################## - """Definition of __version__.""" # We do not use the other three variables, but can be added back if needed. diff --git a/tests/debug.py b/tests/debug.py index 0d3926c0..6497a261 100644 --- a/tests/debug.py +++ b/tests/debug.py @@ -12,9 +12,7 @@ # See LICENSE.rst for license information. # ############################################################################## - -""" -Convenience module for debugging the unit tests using +"""Convenience module for debugging the unit tests using. python -m diffpy.morph.tests.debug diff --git a/tests/run.py b/tests/run.py index dc27a05b..c34754e3 100644 --- a/tests/run.py +++ b/tests/run.py @@ -12,9 +12,8 @@ # See LICENSE.rst for license information. # ############################################################################## -"""Convenience module for executing all unit tests with -python -m diffpy.morph.tests.run -""" +"""Convenience module for executing all unit tests with python -m +diffpy.morph.tests.run.""" import sys diff --git a/tests/test_morphchain.py b/tests/test_morphchain.py index 92ed0189..4c567379 100644 --- a/tests/test_morphchain.py +++ b/tests/test_morphchain.py @@ -27,7 +27,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphChain.morph()""" + """Check MorphChain.morph()""" # Define the morphs config = { "rmin": 1, diff --git a/tests/test_morphpdftordf.py b/tests/test_morphpdftordf.py index 1c39b534..6cdacb4a 100644 --- a/tests/test_morphpdftordf.py +++ b/tests/test_morphpdftordf.py @@ -30,7 +30,7 @@ def setup(self): return def test_transform(self, setup): - """check TransformXtalPDFtoRDF.morph()""" + """Check TransformXtalPDFtoRDF.morph()""" config = {"baselineslope": -1.0} transform = TransformXtalPDFtoRDF(config) diff --git a/tests/test_morphrdftopdf.py b/tests/test_morphrdftopdf.py index ee139cc1..05fd09cb 100644 --- a/tests/test_morphrdftopdf.py +++ b/tests/test_morphrdftopdf.py @@ -24,7 +24,7 @@ def setup(self): return def test_transform(self, setup): - """check TransformXtalRDFtoPDF.morph()""" + """Check TransformXtalRDFtoPDF.morph()""" config = {"baselineslope": -1.0} transform = TransformXtalRDFtoPDF(config) diff --git a/tests/test_morphresolution.py b/tests/test_morphresolution.py index 13a56d8d..40566113 100644 --- a/tests/test_morphresolution.py +++ b/tests/test_morphresolution.py @@ -24,7 +24,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphScale.morph()""" + """Check MorphScale.morph()""" config = {"qdamp": 0.01} morph = MorphResolutionDamping(config) diff --git a/tests/test_morphrgrid.py b/tests/test_morphrgrid.py index d823dbad..4187698c 100644 --- a/tests/test_morphrgrid.py +++ b/tests/test_morphrgrid.py @@ -34,7 +34,7 @@ def _runTests(self, xyallout, morph): return def testRangeInBounds(self, setup): - """Selected range is within input bounds""" + """Selected range is within input bounds.""" config = { "rmin": 1.0, @@ -52,7 +52,7 @@ def testRangeInBounds(self, setup): return def testRmaxOut(self, setup): - """Selected rmax is outside of input bounds""" + """Selected rmax is outside of input bounds.""" config = { "rmin": 1.0, @@ -70,7 +70,7 @@ def testRmaxOut(self, setup): return def testRminOut(self, setup): - """Selected rmin is outside of input bounds""" + """Selected rmin is outside of input bounds.""" config = { "rmin": 0.0, @@ -88,7 +88,7 @@ def testRminOut(self, setup): return def testRstepOut(self, setup): - """Selected rstep is outside of input bounds""" + """Selected rstep is outside of input bounds.""" config = { "rmin": 1.0, diff --git a/tests/test_morphscale.py b/tests/test_morphscale.py index ccabb483..fa39042c 100644 --- a/tests/test_morphscale.py +++ b/tests/test_morphscale.py @@ -24,7 +24,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphScale.morph()""" + """Check MorphScale.morph()""" config = {"scale": 2.0} morph = MorphScale(config) diff --git a/tests/test_morphshape.py b/tests/test_morphshape.py index 1905ebe8..18cd49ad 100644 --- a/tests/test_morphshape.py +++ b/tests/test_morphshape.py @@ -27,7 +27,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphSphere.morph()""" + """Check MorphSphere.morph()""" config = {"radius": 17.5} morph = MorphSphere(config) @@ -78,7 +78,7 @@ def reset(self): return def test_morph(self): - """check MorphSpheroid.morph() and MorphISpheroid.morph()""" + """Check MorphSpheroid.morph() and MorphISpheroid.morph()""" for idx in range(len(self.testfiles)): self.testfile = self.testfiles[idx] diff --git a/tests/test_morphshift.py b/tests/test_morphshift.py index 4f2e552b..895022d7 100644 --- a/tests/test_morphshift.py +++ b/tests/test_morphshift.py @@ -30,7 +30,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphScale.morph()""" + """Check MorphScale.morph()""" config = {"hshift": self.hshift, "vshift": self.vshift} morph = MorphShift(config) diff --git a/tests/test_morphsmear.py b/tests/test_morphsmear.py index aa431c0e..a0162840 100644 --- a/tests/test_morphsmear.py +++ b/tests/test_morphsmear.py @@ -28,7 +28,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphSmear.morph()""" + """Check MorphSmear.morph()""" morph = MorphSmear() morph.smear = 0.15 diff --git a/tests/test_morphstretch.py b/tests/test_morphstretch.py index 37b23a0c..8137b166 100644 --- a/tests/test_morphstretch.py +++ b/tests/test_morphstretch.py @@ -25,7 +25,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphStretch.morph()""" + """Check MorphStretch.morph()""" morph = MorphStretch() # Stretch by 50% diff --git a/tests/test_refine.py b/tests/test_refine.py index d9cbd6d4..33d8d4ac 100644 --- a/tests/test_refine.py +++ b/tests/test_refine.py @@ -30,7 +30,7 @@ def setup(self): return def test_refine_morph(self, setup): - """refine a morph""" + """Refine a morph.""" # Define the morphs config = { "scale": 1.0, @@ -50,7 +50,7 @@ def test_refine_morph(self, setup): return def test_refine_chain(self, setup): - """refine a chain""" + """Refine a chain.""" # Give this some texture self.y_morph[30:] = 5 self.y_target[33:] = 15 diff --git a/tests/test_tools.py b/tests/test_tools.py index 946b4a3d..4fcbd7f0 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -1,7 +1,6 @@ #!/usr/bin/env python -"""Unit tests for tools.py -""" +"""Unit tests for tools.py.""" import os @@ -29,14 +28,14 @@ def setup(self): return def test_estimateBaselineSlope(self, setup): - """check estimateBaselineSlope() using calculated data""" + """Check estimateBaselineSlope() using calculated data.""" slope = tools.estimateBaselineSlope(self.x_morph, self.y_morph) slopecalc = -4 * numpy.pi * self.rho0 assert numpy.allclose(slopecalc, slope, 1e-2) return def test_estimateScale(self, setup): - """check estimateScale() using calculated data""" + """Check estimateScale() using calculated data.""" import random x = random.random() diff --git a/tests/test_version.py b/tests/test_version.py index 230d27c2..38aa5669 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,5 +1,4 @@ -"""Unit tests for __version__.py -""" +"""Unit tests for __version__.py.""" import diffpy.morph