Skip to content

Commit

Permalink
removal of whitespace excluding .txt and .rst
Browse files Browse the repository at this point in the history
  • Loading branch information
cadenmyers13 committed May 28, 2024
1 parent 7d56e7f commit 1544be0
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[run]
source =
source =
src/diffpy/pdfmorph/
[report]
omit =
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,4 +42,3 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/manual/build/html

4 changes: 2 additions & 2 deletions doc/manual/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import sys
from pathlib import Path
from importlib.metadata import version
from pathlib import Path

import sphinx_rtd_theme
from jinja2 import Environment, FileSystemLoader, Template


sys.path.insert(0, str(Path("../../..").resolve()))
sys.path.insert(0, str(Path("../../../src").resolve()))

Expand Down
7 changes: 4 additions & 3 deletions run_tests.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/pdfmorph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"""

# top-level import
from diffpy.pdfmorph.pdfmorph_api import (morph_default_config, pdfmorph,
plot_morph)
from diffpy.pdfmorph.pdfmorph_api import morph_default_config, pdfmorph, plot_morph

# obtain version information
from diffpy.pdfmorph.version import __version__

Expand Down
6 changes: 2 additions & 4 deletions src/diffpy/pdfmorph/morph_helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@

"""List of helpers for certain morphing operations (currently only used for smear)."""

from diffpy.pdfmorph.morph_helpers.transformpdftordf import \
TransformXtalPDFtoRDF
from diffpy.pdfmorph.morph_helpers.transformrdftopdf import \
TransformXtalRDFtoPDF
from diffpy.pdfmorph.morph_helpers.transformpdftordf import TransformXtalPDFtoRDF
from diffpy.pdfmorph.morph_helpers.transformrdftopdf import TransformXtalRDFtoPDF

# List of helpers
morph_helpers = [
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/pdfmorph/morphs/morphishape.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""


Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/pdfmorph/pdfmorph_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def single_morph_output(
morph_file
Name of the morphed PDF file. Required when printing to a non-terminal file.
param xy_out: list
List of the form [x_morph_out, y_morph_out]. x_morph_out is a List of r values
List of the form [x_morph_out, y_morph_out]. x_morph_out is a List of r values
and y_morph_out is a List of gr values.
verbose: bool
Print additional details about the morph when True (default False).
Expand Down
21 changes: 13 additions & 8 deletions src/diffpy/pdfmorph/pdfmorphapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,31 +206,31 @@ def custom_error(self, msg):
type="float",
metavar="RADIUS",
help="""Apply characteristic function of sphere with radius RADIUS.
If PRADIUS is also specified, instead apply characteristic function of spheroid with equatorial radius RADIUS
If PRADIUS is also specified, instead apply characteristic function of spheroid with equatorial radius RADIUS
and polar radius PRADIUS.""",
)
group.add_option(
"--pradius",
type="float",
metavar="PRADIUS",
help="""Apply characteristic function of spheroid with equatorial
radius RADIUS and polar radius PRADIUS. If only PRADIUS is specified, instead apply characteristic
radius RADIUS and polar radius PRADIUS. If only PRADIUS is specified, instead apply characteristic
function of sphere with radius PRADIUS.""",
)
group.add_option(
"--iradius",
type="float",
metavar="IRADIUS",
help="""Apply inverse characteristic function of sphere with radius IRADIUS. If IPRADIUS is
also specified, instead apply inverse characteristic function of spheroid with equatorial
help="""Apply inverse characteristic function of sphere with radius IRADIUS. If IPRADIUS is
also specified, instead apply inverse characteristic function of spheroid with equatorial
radius IRADIUS and polar radius IPRADIUS.""",
)
group.add_option(
"--ipradius",
type="float",
metavar="IPRADIUS",
help="""Apply inverse characteristic function of spheroid with equatorial radius IRADIUS and
polar radius IPRADIUS. If only IPRADIUS is specified, instead apply inverse characteristic function
help="""Apply inverse characteristic function of spheroid with equatorial radius IRADIUS and
polar radius IPRADIUS. If only IPRADIUS is specified, instead apply inverse characteristic function
of sphere with radius IPRADIUS.""",
)

Expand Down Expand Up @@ -492,7 +492,9 @@ def multiple_morphs(parser, opts, pargs, stdout_flag=True):
# Sort files in directory by some field
if field is not None:
try:
target_list, field_list = tools.field_sort(target_list, field, opts.reverse, opts.serfile, get_field_values=True)
target_list, field_list = tools.field_sort(
target_list, field, opts.reverse, opts.serfile, get_field_values=True
)
except KeyError:
if opts.serfile is not None:
parser.custom_error("The requested field was not found in the metadata file.")
Expand Down Expand Up @@ -589,7 +591,10 @@ def multiple_morphs(parser, opts, pargs, stdout_flag=True):
# Can occur for non-refined plotting parameters
# i.e. --smear is not selected as an option, but smear is the plotting parameter
except ValueError:
parser.custom_error("The plot parameter is missing values for at least one morph and target pair. " "No plot shown.")
parser.custom_error(
"The plot parameter is missing values for at least one morph and target pair. "
"No plot shown."
)

return morph_results

Expand Down
3 changes: 1 addition & 2 deletions src/diffpy/pdfmorph/tests/test_morphpdftordf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
tests_dir = os.path.dirname(os.path.abspath(thisfile))
# testdata_dir = os.path.join(tests_dir, 'testdata')

from diffpy.pdfmorph.morph_helpers.transformpdftordf import \
TransformXtalPDFtoRDF
from diffpy.pdfmorph.morph_helpers.transformpdftordf import TransformXtalPDFtoRDF


class TestTransformXtalPDFtoRDF:
Expand Down
3 changes: 1 addition & 2 deletions src/diffpy/pdfmorph/tests/test_morphrdftopdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
tests_dir = os.path.dirname(os.path.abspath(thisfile))
# testdata_dir = os.path.join(tests_dir, 'testdata')

from diffpy.pdfmorph.morph_helpers.transformrdftopdf import \
TransformXtalRDFtoPDF
from diffpy.pdfmorph.morph_helpers.transformrdftopdf import TransformXtalRDFtoPDF


class TestTransformXtalRDFtoPDF:
Expand Down
1 change: 1 addition & 0 deletions src/diffpy/pdfmorph/tests/test_morphshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import os

import numpy
import pytest

Expand Down
3 changes: 1 addition & 2 deletions src/diffpy/pdfmorph/tests/test_pdfmorphapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +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()
Expand Down
3 changes: 1 addition & 2 deletions src/diffpy/pdfmorph/tests/test_pdfmorphio.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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()
Expand Down
3 changes: 1 addition & 2 deletions src/diffpy/pdfmorph/tests/test_pdfplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
import matplotlib.pyplot as plt
import numpy as np

from diffpy.pdfmorph.pdfmorph_api import (morph_default_config, pdfmorph,
plot_morph)
from diffpy.pdfmorph.pdfmorph_api import morph_default_config, pdfmorph, plot_morph
from diffpy.pdfmorph.tests.test_morphstretch import heaviside


Expand Down
6 changes: 2 additions & 4 deletions src/diffpy/pdfmorph/tests/test_refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
tests_dir = os.path.dirname(os.path.abspath(thisfile))
testdata_dir = os.path.join(tests_dir, "testdata")

from diffpy.pdfmorph.morph_helpers.transformpdftordf import \
TransformXtalPDFtoRDF
from diffpy.pdfmorph.morph_helpers.transformrdftopdf import \
TransformXtalRDFtoPDF
from diffpy.pdfmorph.morph_helpers.transformpdftordf import TransformXtalPDFtoRDF
from diffpy.pdfmorph.morph_helpers.transformrdftopdf import TransformXtalRDFtoPDF
from diffpy.pdfmorph.morphs.morphchain import MorphChain
from diffpy.pdfmorph.morphs.morphscale import MorphScale
from diffpy.pdfmorph.morphs.morphsmear import MorphSmear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@
"rstep": 0.01,
"rpoly": 0.7
}
}
}
2 changes: 1 addition & 1 deletion tutorial/sample_namesfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"SaVe_MoRph_As": "this_also_works.extension",
"note": "Capitalization does NOT matter. The program is case insensitive."
}
}
}

0 comments on commit 1544be0

Please sign in to comment.