Skip to content

Commit e08f538

Browse files
committed
lint
1 parent 4009eb9 commit e08f538

10 files changed

Lines changed: 20 additions & 26 deletions

File tree

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ Scatterkit
66
.. inclusion-readme-intro-start
77
88
**Scatterkit** is an object-oriented python toolkit for analysing scattering of
9-
fluids from molecular simulations. Combined with MDAnalysis_,
10-
Scatterkit can be used to extract X-ray scattering data from trajectory files,
9+
fluids from molecular simulations. Combined with MDAnalysis_,
10+
Scatterkit can be used to extract X-ray scattering data from trajectory files,
1111
including LAMMPS, GROMACS, CHARMM or NAMD data. Scatterkit is open source and is
1212
released under the GNU general public license v3.0.
1313

1414
Scatterkit is a tool for beginners of molecular simulations with no prior Python experience.
1515
For these users Scatterkit provides a descriptive command line interface. Also experienced
16-
users can use the Python API for their day to day analysis.
16+
users can use the Python API for their day to day analysis.
1717

1818
Scatterkit is maintained by the MAICoS developer team.
1919
Keep up to date with Scatterkit news by following us on Twitter_. If you find an issue, you

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
from pathlib import Path
2020

2121
import numpy as np
22-
from setuptools import Extension, setup
23-
2422
import versioneer
23+
from setuptools import Extension, setup
2524

2625
VERSION = versioneer.get_version()
2726

src/scatterkit/__init__.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
"""scatterkit: SAXS analysis of MD trajectories"""
1+
"""scatterkit: SAXS analysis of MD trajectories."""
22

33
__authors__ = "MAICoS Developer Team"
44

5-
import warnings
6-
75
from ._version import get_versions
6+
from .saxs import Saxs
87

9-
__authors__ = "MAICoS Developer Team"
10-
#: Version information for MAICoS, following :pep:`440`
8+
#: Version information for Scatterkit, following :pep:`440`
119
#: and `semantic versioning <http://semver.org/>`_.
1210
__version__ = get_versions()["version"]
1311
del get_versions
1412

15-
from .saxs import Saxs
16-
1713
__all__ = [
1814
"Saxs",
1915
]

src/scatterkit/lib/math.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def atomic_form_factor(q: float, element: str) -> float:
4949
The magnitude of the scattering vector in reciprocal angstroms (1/Å).
5050
element : str
5151
The element for which the atomic form factor is calculated. Known elements are
52-
listed in the :attr:`scatterkit.lib.tables.elements` set. United-atom models such as
52+
listed in the :attr:`scatterkit.lib.tables.elements` set.
53+
United-atom models such as
5354
``"CH1"``, ``"CH2"``, ``"CH3"``, ``"CH4"``, ``"NH1"``, ``"NH2"``, and ``"NH3"``
5455
are also supported.
5556
@@ -99,6 +100,7 @@ def atomic_form_factor(q: float, element: str) -> float:
99100

100101
return form_factor.reshape(q2.shape)
101102

103+
102104
def rdf_structure_factor(
103105
rdf: np.ndarray, r: np.ndarray, density: float
104106
) -> tuple[np.ndarray, np.ndarray]:

src/scatterkit/lib/util.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
import re
1111
from collections.abc import Callable
12-
from pathlib import Path
13-
import sys
1412

1513
DOC_REGEX_PATTERN = re.compile(r"\$\{([^\}]+)\}")
1614

@@ -158,5 +156,3 @@ def scatterkit_banner(version: str = "", frame_char: str = "-") -> str:
158156
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
159157
"""
160158
return banner.replace("@", frame_char)
161-
162-

src/scatterkit/saxs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
import MDAnalysis as mda
1313
import numpy as np
14-
1514
from maicos.core import AnalysisBase
15+
1616
from .lib.math import atomic_form_factor, structure_factor
1717
from .lib.util import render_docs
1818

tests/data/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@
2828
# An SPC/E water molecule pointing in z-direction
2929
SPCE_ITP = DIR_PATH / "spce.itp"
3030
SPCE_GRO = DIR_PATH / "spce.gro"
31-
32-

tests/lib/test_math.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
import MDAnalysis as mda
1414
import numpy as np
1515
import pytest
16-
from numpy.testing import assert_allclose, assert_equal
16+
from numpy.testing import assert_allclose
1717

1818
import scatterkit.lib.math
1919
import scatterkit.lib.util
2020

2121
sys.path.append(str(Path(__file__).parents[1]))
22-
from data import SPCE_GRO, SPCE_ITP, WATER_GRO_NPT, WATER_TPR_NPT # noqa: E402
22+
from data import WATER_GRO_NPT, WATER_TPR_NPT # noqa: E402
2323

2424

2525
class Test_sfactor:

tests/lib/test_util.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@
77
# SPDX-License-Identifier: GPL-3.0-or-later
88
"""Tests for the utilities."""
99

10-
import pytest
11-
from numpy.testing import assert_allclose, assert_equal
1210
import sys
1311
from pathlib import Path
1412

13+
import pytest
14+
1515
import scatterkit.lib.util
1616

1717
sys.path.append(str(Path(__file__).parents[1]))
1818

19+
1920
def test_banner():
2021
"""Test banner string by checking some necesarry features.
2122
@@ -31,7 +32,9 @@ def test_banner():
3132
assert scatterkit.lib.util.scatterkit_banner().endswith("\n")
3233
# Check for correct length of lines (80 characters excluding top and bottom)
3334
# Also add in a long version string to check that it doesn't overflow
34-
for line in scatterkit.lib.util.scatterkit_banner(version="v1.10.11").split("\n")[1:-1]:
35+
for line in scatterkit.lib.util.scatterkit_banner(version="v1.10.11").split("\n")[
36+
1:-1
37+
]:
3538
assert len(line) == 80
3639
# Check that the version is correctly inserted
3740
assert "v0.0.1" in scatterkit.lib.util.scatterkit_banner(version="v0.0.1")

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ envlist =
1212
lint_folders =
1313
"{toxinidir}/setup.py" \
1414
"{toxinidir}/src" \
15-
"{toxinidir}/tests" \
15+
"{toxinidir}/tests"
1616

1717
# configures which environments run with each python version
1818
[testenv]

0 commit comments

Comments
 (0)