diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ab95a6..f2f3c63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,12 +24,12 @@ jobs: os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025, macos-15-intel, macos-15] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: fetch-depth: 0 - name: Build wheels - uses: pypa/cibuildwheel@v3.4.1 + uses: pypa/cibuildwheel@v4.1.1 - uses: actions/upload-artifact@v7 with: @@ -41,12 +41,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: fetch-depth: 0 - name: setup Python - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: "3.14" check-latest: true diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5eeabcb..6d77496 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,12 +13,12 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: fetch-depth: 0 - name: setup Python - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: "3.14" check-latest: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ce146b2..d31ca34 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,12 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: "3.14" check-latest: true diff --git a/.github/workflows/tests-dev.yml b/.github/workflows/tests-dev.yml index 12451f6..fc77deb 100644 --- a/.github/workflows/tests-dev.yml +++ b/.github/workflows/tests-dev.yml @@ -13,12 +13,12 @@ jobs: python-version: ["3.11", "3.14"] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} @@ -35,7 +35,7 @@ jobs: python-version: ["3.11", "3.14"] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: fetch-depth: 0 @@ -43,7 +43,7 @@ jobs: run: git checkout $(git describe --tags --abbrev=0) - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d035c2c..d7816b4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,12 +26,12 @@ jobs: python-version: "3.14" steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} check-latest: true @@ -44,7 +44,7 @@ jobs: coverage xml - name: upload to codecov.io - uses: codecov/codecov-action@v6 + uses: codecov/codecov-action@v7 with: fail_ci_if_error: true files: tests/coverage.xml diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e1e10ae..4680984 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,12 @@ CHANGELOG file - keep the format consistent (79 char width, Y/M/D date format) and do not use tabs but use spaces for formatting +Unreleased +---------- +Henrik Stooß + +- Bump the action-dependencies and fix formatting (#24) + v0.1.1 (2026/05/12) ------------------- Henrik Stooß diff --git a/docs/src/conf.py b/docs/src/conf.py index 0d4a5e2..5d61785 100755 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -12,7 +12,7 @@ the documentation: http://www.sphinx-doc.org/en/master/config """ -from datetime import datetime +from datetime import UTC, datetime from pathlib import Path # -- Path setup -------------------------------------------------------------- @@ -30,7 +30,7 @@ project = project_dict["name"] author = scatterkit.__authors__ version = scatterkit.__version__ -copyright = f"{datetime.now().date().year}, {author}" +copyright = f"{datetime.now(tz=UTC).year}, {author}" # -- General configuration --------------------------------------------------- @@ -116,9 +116,9 @@ # font-awesome logos html_css_files = [ - "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/fontawesome.min.css", # noqa: E501 - "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/solid.min.css", # noqa: E501 - "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/brands.min.css", # noqa: E501 + "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/fontawesome.min.css", + "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/solid.min.css", + "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/brands.min.css", ] # -- Options for HTMLHelp output --------------------------------------------- diff --git a/examples/dipole-correlations.py b/examples/dipole-correlations.py index 65203ae..6882112 100644 --- a/examples/dipole-correlations.py +++ b/examples/dipole-correlations.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) diff --git a/examples/saxs.py b/examples/saxs.py index df988d6..c4d9b80 100644 --- a/examples/saxs.py +++ b/examples/saxs.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) diff --git a/setup.py b/setup.py index 4f31d2c..b963b98 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) @@ -49,7 +48,7 @@ def hasfunction(cc, funcname, include=None, extra_postargs=None): [fname], output_dir=str(tmpdir), extra_postargs=extra_postargs ) cc.link_executable(objects, str(tmpdir / "a.out")) - except Exception: + except Exception: # noqa: BLE001 return False return True finally: diff --git a/src/scatterkit/__init__.py b/src/scatterkit/__init__.py index 732ac45..d021615 100644 --- a/src/scatterkit/__init__.py +++ b/src/scatterkit/__init__.py @@ -9,4 +9,4 @@ from .rdfdiporder import RDFDiporder from .saxs import Saxs -__all__ = ["Saxs", "DiporderStructureFactor", "RDFDiporder"] +__all__ = ["DiporderStructureFactor", "RDFDiporder", "Saxs"] diff --git a/src/scatterkit/__main__.py b/src/scatterkit/__main__.py index 7983199..a70277a 100644 --- a/src/scatterkit/__main__.py +++ b/src/scatterkit/__main__.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) diff --git a/src/scatterkit/diporderstructurefactor.py b/src/scatterkit/diporderstructurefactor.py index e6d7f83..cb6e689 100644 --- a/src/scatterkit/diporderstructurefactor.py +++ b/src/scatterkit/diporderstructurefactor.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) @@ -136,11 +135,11 @@ def get_unit_vectors( scattering_vectors = scattering_vectors[nonzeros] structure_factors = structure_factors[nonzeros] - histogram_kwargs = dict( - a=scattering_vectors, - bins=self.n_bins, - range=(self.qmin, self.qmax), - ) + histogram_kwargs = { + "a": scattering_vectors, + "bins": self.n_bins, + "range": (self.qmin, self.qmax), + } structure_factors_binned, _ = np.histogram( weights=structure_factors, **histogram_kwargs ) diff --git a/src/scatterkit/lib/tables.py b/src/scatterkit/lib/tables.py index 2e0f6fb..eca2f9a 100644 --- a/src/scatterkit/lib/tables.py +++ b/src/scatterkit/lib/tables.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) diff --git a/src/scatterkit/lib/util.py b/src/scatterkit/lib/util.py index 19970ec..0e3bf87 100644 --- a/src/scatterkit/lib/util.py +++ b/src/scatterkit/lib/util.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) @@ -12,12 +11,14 @@ DOC_REGEX_PATTERN = re.compile(r"\$\{([^\}]+)\}") -DOC_DICT = dict( +DOC_DICT = { ##################### # DESCRIPTION SECTION ##################### - SAVE_METHOD_DESCRIPTION="Save results of analysis to file specified by ``output``.", - RUN_METHOD_DESCRIPTION="""Iterate over the trajectory. + "SAVE_METHOD_DESCRIPTION": ( + "Save results of analysis to file specified by ``output``." + ), + "RUN_METHOD_DESCRIPTION": """Iterate over the trajectory. Parameters ---------- @@ -46,15 +47,15 @@ ########################## # SINGLE PARAMETER SECTION ########################## - ATOMGROUP_PARAMETER="""atomgroup : MDAnalysis.core.groups.AtomGroup + "ATOMGROUP_PARAMETER": """atomgroup : MDAnalysis.core.groups.AtomGroup A :class:`~MDAnalysis.core.groups.AtomGroup` for which the calculations are performed.""", - OUTPUT_PARAMETER="""output : str + "OUTPUT_PARAMETER": """output : str Output filename.""", ################################### # MULTI/COMBINES PARAMETERS SECTION ################################### - BASE_CLASS_PARAMETERS="""refgroup : MDAnalysis.core.groups.AtomGroup + "BASE_CLASS_PARAMETERS": """refgroup : MDAnalysis.core.groups.AtomGroup Reference :class:`~MDAnalysis.core.groups.AtomGroup` used for the calculation. If ``refgroup`` is provided, the calculation is performed relative to the center of mass of the AtomGroup. If ``refgroup`` is :obj:`None` the calculations are performed @@ -91,19 +92,19 @@ concfreq : int When concfreq (for conclude frequency) is larger than ``0``, the conclude function is called and the output files are written every ``concfreq`` frames.""", - Q_SPACE_PARAMETERS="""qmin : float + "Q_SPACE_PARAMETERS": """qmin : float Starting q (1/Å) qmax : float Ending q (1/Å) dq : float bin_width (1/Å)""", - PDF_PARAMETERS="""g1 : MDAnalysis.core.groups.AtomGroup + "PDF_PARAMETERS": """g1 : MDAnalysis.core.groups.AtomGroup First AtomGroup. g2 : MDAnalysis.core.groups.AtomGroup Second AtomGroup.""", - BIN_WIDTH_PARAMETER="""bin_width : float + "BIN_WIDTH_PARAMETER": """bin_width : float Width of the bins (in Å).""", - RADIAL_CLASS_PARAMETERS="""rmin : float + "RADIAL_CLASS_PARAMETERS": """rmin : float Minimal radial coordinate relative to the center of mass of the refgroup for evaluation (in Å). rmax : float @@ -111,19 +112,19 @@ evaluation (in Å). If ``rmax=None``, the box extension is taken.""", - BIN_METHOD_PARAMETER="""bin_method : {``"com"``, ``"cog"``, ``"coc"``} + "BIN_METHOD_PARAMETER": """bin_method : {``"com"``, ``"cog"``, ``"coc"``} Method for the position binning. The possible options are center of mass (``"com"``), center of geometry (``"cog"``), and center of charge (``"coc"``).""", - GROUPING_PARAMETER="""grouping : {``"atoms"``, ``"residues"``, ``"segments"``, ``"molecules"``, ``"fragments"``} + "GROUPING_PARAMETER": """grouping : {``"atoms"``, ``"residues"``, ``"segments"``, ``"molecules"``, ``"fragments"``} Atom grouping for the calculations. The possible grouping options are the atom positions (in the case where ``grouping="atoms"``) or the center of mass of the specified grouping unit (in the case where ``grouping="residues"``, ``"segments"``, ``"molecules"`` or ``"fragments"``).""", # noqa: E501 -) +} """Dictionary containing the keys and the actual docstring used by :func:`scatterkit.lib.util.render_docs`. :meta hide-value: diff --git a/src/scatterkit/lib/weights.py b/src/scatterkit/lib/weights.py index b8dc50f..f128b8a 100644 --- a/src/scatterkit/lib/weights.py +++ b/src/scatterkit/lib/weights.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) diff --git a/src/scatterkit/rdfdiporder.py b/src/scatterkit/rdfdiporder.py index 92d96ef..a7f9887 100644 --- a/src/scatterkit/rdfdiporder.py +++ b/src/scatterkit/rdfdiporder.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) diff --git a/src/scatterkit/saxs.py b/src/scatterkit/saxs.py index 8d9f896..75b0076 100644 --- a/src/scatterkit/saxs.py +++ b/src/scatterkit/saxs.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) @@ -215,11 +214,11 @@ def _single_frame(self) -> float: structure_factors = structure_factors[nonzeros] scattering_intensities = scattering_intensities[nonzeros] - histogram_kwargs = dict( - a=scattering_vectors, - bins=self.n_bins, - range=(self.qmin, self.qmax), - ) + histogram_kwargs = { + "a": scattering_vectors, + "bins": self.n_bins, + "range": (self.qmin, self.qmax), + } structure_factors, _ = np.histogram( weights=structure_factors, **histogram_kwargs ) diff --git a/tests/data/__init__.py b/tests/data/__init__.py index a71bbf6..3683001 100644 --- a/tests/data/__init__.py +++ b/tests/data/__init__.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 """init file for datafiles.""" # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # diff --git a/tests/lib/test_math.py b/tests/lib/test_math.py index 82cdace..d5f5df8 100644 --- a/tests/lib/test_math.py +++ b/tests/lib/test_math.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) @@ -19,7 +18,7 @@ import scatterkit.lib.util sys.path.append(str(Path(__file__).parents[1])) -from data import WATER_GRO_NPT, WATER_TPR_NPT # noqa: E402 +from data import WATER_GRO_NPT, WATER_TPR_NPT class Test_sfactor: diff --git a/tests/lib/test_util.py b/tests/lib/test_util.py index 8ecfa63..38c8e7e 100644 --- a/tests/lib/test_util.py +++ b/tests/lib/test_util.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) @@ -34,12 +33,12 @@ def test_render_docs(doc, new_doc): def func(): pass - DOC_DICT = dict( - TEST="test", - BLA="blu", - INNER="inner", - OUTER="desc with ${INNER}", - ) + DOC_DICT = { + "TEST": "test", + "BLA": "blu", + "INNER": "inner", + "OUTER": "desc with ${INNER}", + } func.__doc__ = doc func_decorated = scatterkit.lib.util._render_docs(func, doc_dict=DOC_DICT) diff --git a/tests/lib/test_weights.py b/tests/lib/test_weights.py index 3039d6f..8b6fe01 100644 --- a/tests/lib/test_weights.py +++ b/tests/lib/test_weights.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) @@ -18,8 +17,8 @@ import scatterkit.lib.weights sys.path.append(str(Path(__file__).parents[1])) -from data import SPCE_GRO, SPCE_ITP # noqa: E402 -from util import line_of_water_molecules # noqa: E402 +from data import SPCE_GRO, SPCE_ITP +from util import line_of_water_molecules @pytest.fixture diff --git a/tests/test_diporderstructurefactor.py b/tests/test_diporderstructurefactor.py index 65f8d72..96ee1ab 100644 --- a/tests/test_diporderstructurefactor.py +++ b/tests/test_diporderstructurefactor.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) @@ -19,7 +18,7 @@ from scatterkit.lib.math import compute_rdf_structure_factor sys.path.append(str(Path(__file__).parents[1])) -from data import WATER_TPR_NVT, WATER_XTC_NVT # noqa: E402 +from data import WATER_TPR_NVT, WATER_XTC_NVT class TestDiporderStructureFactor: diff --git a/tests/test_rdfdiporder.py b/tests/test_rdfdiporder.py index 99339aa..58b0ef4 100644 --- a/tests/test_rdfdiporder.py +++ b/tests/test_rdfdiporder.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) diff --git a/tests/test_saxs.py b/tests/test_saxs.py index 813bcbd..85191f0 100644 --- a/tests/test_saxs.py +++ b/tests/test_saxs.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) diff --git a/tests/util.py b/tests/util.py index 86ed209..53734a7 100644 --- a/tests/util.py +++ b/tests/util.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # Copyright (c) 2025 Authors and contributors # (see the AUTHORS.rst file for the full list of names) @@ -14,7 +13,7 @@ import numpy as np sys.path.append(str(Path(__file__).parents[1])) -from data import SPCE_GRO, SPCE_ITP # noqa: E402 +from data import SPCE_GRO, SPCE_ITP # Useful functions for creating test systems