Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -35,15 +35,15 @@ jobs:
python-version: ["3.11", "3.14"]

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Check out latest release tag
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 }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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ß
Expand Down
10 changes: 5 additions & 5 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 --------------------------------------------------------------
Expand All @@ -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 ---------------------------------------------------

Expand Down Expand Up @@ -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 ---------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion examples/dipole-correlations.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 0 additions & 1 deletion examples/saxs.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/scatterkit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
from .rdfdiporder import RDFDiporder
from .saxs import Saxs

__all__ = ["Saxs", "DiporderStructureFactor", "RDFDiporder"]
__all__ = ["DiporderStructureFactor", "RDFDiporder", "Saxs"]
1 change: 0 additions & 1 deletion src/scatterkit/__main__.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
11 changes: 5 additions & 6 deletions src/scatterkit/diporderstructurefactor.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
)
Expand Down
1 change: 0 additions & 1 deletion src/scatterkit/lib/tables.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
29 changes: 15 additions & 14 deletions src/scatterkit/lib/util.py
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
----------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -91,39 +92,39 @@
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
Maximal radial coordinate relative to the center of mass of the refgroup for
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:
Expand Down
1 change: 0 additions & 1 deletion src/scatterkit/lib/weights.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/scatterkit/rdfdiporder.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
11 changes: 5 additions & 6 deletions src/scatterkit/saxs.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
)
Expand Down
1 change: 0 additions & 1 deletion tests/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python3
"""init file for datafiles."""
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
#
Expand Down
3 changes: 1 addition & 2 deletions tests/lib/test_math.py
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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:
Expand Down
13 changes: 6 additions & 7 deletions tests/lib/test_util.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Loading