From a2eba1a68e7dc156426c099358ac19351eb8a0f9 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 29 May 2024 12:26:45 -0400 Subject: [PATCH] edits made by running pre-commit (removing whitespace) --- .coveragerc | 2 +- .github/workflows/docs.yml | 3 +- doc/manual/source/conf.py | 74 ++++++++++--------- run_tests.py | 7 +- src/diffpy/pdfmorph/morphs/morphishape.py | 2 +- src/diffpy/pdfmorph/tests/test_morphshape.py | 1 + src/diffpy/pdfmorph/tests/test_pdfmorphapp.py | 6 +- src/diffpy/pdfmorph/tests/test_pdfmorphio.py | 6 +- .../testdata/testsequence_serialfile.json | 2 +- tutorial/sample_namesfile.json | 2 +- 10 files changed, 53 insertions(+), 52 deletions(-) diff --git a/.coveragerc b/.coveragerc index 534dc1d4..54b18689 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,5 @@ [run] -source = +source = src/diffpy/pdfmorph/ [report] omit = diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index cb6fbf82..6f6953af 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -25,7 +25,7 @@ jobs: - name: install requirements run: >- - conda install -n build -c conda-forge + conda install -n build -c conda-forge --file requirements/build.txt --file requirements/run.txt --file requirements/docs.txt @@ -42,4 +42,3 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./doc/manual/build/html - diff --git a/doc/manual/source/conf.py b/doc/manual/source/conf.py index e61dd8dd..224ee995 100644 --- a/doc/manual/source/conf.py +++ b/doc/manual/source/conf.py @@ -13,30 +13,32 @@ import sys from pathlib import Path -sys.path.insert(0, str(Path('../../..').resolve())) -sys.path.insert(0, str(Path('../../../src').resolve())) +sys.path.insert(0, str(Path("../../..").resolve())) +sys.path.insert(0, str(Path("../../../src").resolve())) # -- Project information ----------------------------------------------------- -project = 'PDFmorph' -project_full = 'diffpy.pdfmorph' -copyright = '2009-2019, Trustees of Columbia University in the City of New York, all rights reserved.' -author = 'Chris Farrow, Christopher J. Wright, Pavol Juhás, Chia-Hao (Timothy) Liu, S. Matthew Román, Simon J.L. Billinge' +project = "PDFmorph" +project_full = "diffpy.pdfmorph" +copyright = "2009-2019, Trustees of Columbia University in the City of New York, all rights reserved." +author = "Chris Farrow, Christopher J. Wright, Pavol Juhás, Chia-Hao (Timothy) Liu, S. Matthew Román, Simon J.L. Billinge" # The full version, including alpha/beta/rc tags from importlib.metadata import version + fullversion = version(project_full) # The short X.Y version. -version = ''.join(fullversion.split('.post')[:1]) +version = "".join(fullversion.split(".post")[:1]) # The full version, including alpha/beta/rc tags. release = fullversion # Get current date for copyright import time -today = time.strftime('%B %d, %Y', time.localtime()) + +today = time.strftime("%B %d, %Y", time.localtime()) year = today.split()[-1] -copyright = copyright.replace('%Y', year) +copyright = copyright.replace("%Y", year) # -- General configuration --------------------------------------------------- @@ -44,34 +46,35 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['sphinx.ext.autodoc', - 'sphinx.ext.napoleon', - 'sphinx.ext.todo', - 'sphinx.ext.viewcode', - 'sphinx.ext.intersphinx', - 'sphinx_rtd_theme', - 'm2r', +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", + "sphinx.ext.intersphinx", + "sphinx_rtd_theme", + "m2r", ] napoleon_google_docstring = False napoleon_use_param = False napoleon_use_ivar = False # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] -from jinja2 import Template, Environment, FileSystemLoader +from jinja2 import Environment, FileSystemLoader, Template -source_suffix = '.rst' +source_suffix = ".rst" -master_doc = 'index' +master_doc = "index" -language = 'en' +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['Thumbs.db', '.DS_Store'] +exclude_patterns = ["Thumbs.db", ".DS_Store"] -pygments_style = 'sphinx' +pygments_style = "sphinx" todo_include_todos = True @@ -80,7 +83,8 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. import sphinx_rtd_theme -html_theme = 'sphinx_rtd_theme' + +html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] html_theme_options = {} @@ -90,20 +94,24 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = [] -htmlhelp_basename = 'PDFmorphdoc' +htmlhelp_basename = "PDFmorphdoc" latex_documents = [ - (master_doc, 'pdfmorph.tex', 'PDFmorph Documentation', - 'author', 'manual'), + (master_doc, "pdfmorph.tex", "PDFmorph Documentation", "author", "manual"), ] -man_pages = [ - (master_doc, 'pdfmorph', 'PDFmorph Documentation', [author], 1) -] +man_pages = [(master_doc, "pdfmorph", "PDFmorph Documentation", [author], 1)] texinfo_documents = [ - (master_doc, 'PDFmorph', 'PDFmorph Documentation', author, - 'PDFmorph', 'One line description of project.', 'Miscellaneous'), + ( + master_doc, + "PDFmorph", + "PDFmorph Documentation", + author, + "PDFmorph", + "One line description of project.", + "Miscellaneous", + ), ] epub_title = project @@ -111,4 +119,4 @@ epub_publisher = author epub_copyright = copyright -epub_exclude_files = ['search.html'] +epub_exclude_files = ["search.html"] diff --git a/run_tests.py b/run_tests.py index cdba6f0a..829a2e31 100644 --- a/run_tests.py +++ b/run_tests.py @@ -1,15 +1,16 @@ #!/usr/bin/env python import sys + import pytest -if __name__ == '__main__': +if __name__ == "__main__": # show output results from every test function - args = ['-v'] + args = ["-v"] # show the message output for skipped and expected failure tests if len(sys.argv) > 1: args.extend(sys.argv[1:]) - print('pytest arguments: {}'.format(args)) + print("pytest arguments: {}".format(args)) # # compute coverage stats for xpdAcq # call pytest and exit with the return code from pytest so that # travis will fail correctly if tests fail diff --git a/src/diffpy/pdfmorph/morphs/morphishape.py b/src/diffpy/pdfmorph/morphs/morphishape.py index 79e1291e..23128fd7 100644 --- a/src/diffpy/pdfmorph/morphs/morphishape.py +++ b/src/diffpy/pdfmorph/morphs/morphishape.py @@ -15,7 +15,7 @@ """class MorphISphere -- apply inverse spherical shape function -class MorphISpheroid -- apply inverse spheroidal shape function +class MorphISpheroid -- apply inverse spheroidal shape function """ diff --git a/src/diffpy/pdfmorph/tests/test_morphshape.py b/src/diffpy/pdfmorph/tests/test_morphshape.py index b45517a2..8fcc5241 100644 --- a/src/diffpy/pdfmorph/tests/test_morphshape.py +++ b/src/diffpy/pdfmorph/tests/test_morphshape.py @@ -2,6 +2,7 @@ import os + import numpy import pytest diff --git a/src/diffpy/pdfmorph/tests/test_pdfmorphapp.py b/src/diffpy/pdfmorph/tests/test_pdfmorphapp.py index a0cccf01..f035d064 100644 --- a/src/diffpy/pdfmorph/tests/test_pdfmorphapp.py +++ b/src/diffpy/pdfmorph/tests/test_pdfmorphapp.py @@ -4,11 +4,7 @@ import pytest -from diffpy.pdfmorph.pdfmorphapp import ( - create_option_parser, - multiple_morphs, - single_morph, -) +from diffpy.pdfmorph.pdfmorphapp import create_option_parser, multiple_morphs, single_morph thisfile = locals().get("__file__", "file.py") tests_dir = Path(thisfile).parent.resolve() diff --git a/src/diffpy/pdfmorph/tests/test_pdfmorphio.py b/src/diffpy/pdfmorph/tests/test_pdfmorphio.py index bec5183f..06659753 100644 --- a/src/diffpy/pdfmorph/tests/test_pdfmorphio.py +++ b/src/diffpy/pdfmorph/tests/test_pdfmorphio.py @@ -10,11 +10,7 @@ except ImportError: pass -from diffpy.pdfmorph.pdfmorphapp import ( - create_option_parser, - multiple_morphs, - single_morph, -) +from diffpy.pdfmorph.pdfmorphapp import create_option_parser, multiple_morphs, single_morph thisfile = locals().get("__file__", "file.py") tests_dir = Path(thisfile).parent.resolve() diff --git a/src/diffpy/pdfmorph/tests/testdata/testsequence_serialfile.json b/src/diffpy/pdfmorph/tests/testdata/testsequence_serialfile.json index 2f6a888a..bc49ce93 100644 --- a/src/diffpy/pdfmorph/tests/testdata/testsequence_serialfile.json +++ b/src/diffpy/pdfmorph/tests/testdata/testsequence_serialfile.json @@ -132,4 +132,4 @@ "rstep": 0.01, "rpoly": 0.7 } -} \ No newline at end of file +} diff --git a/tutorial/sample_namesfile.json b/tutorial/sample_namesfile.json index b6874e6f..c53abc57 100644 --- a/tutorial/sample_namesfile.json +++ b/tutorial/sample_namesfile.json @@ -10,4 +10,4 @@ "SaVe_MoRph_As": "this_also_works.extension", "note": "Capitalization does NOT matter. The program is case insensitive." } -} \ No newline at end of file +}