Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
id: setuppy
uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.14"

- name: "Set up Poetry"
uses: abatilo/actions-poetry@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-and-type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
python-version: ["3.14"]
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
run: poetry run black --check turtlemd

- name: "Run ruff"
run: poetry run ruff turtlemd
run: poetry run ruff check turtlemd

- name: "Run mypy"
run: poetry run mypy turtlemd
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.12", "3.13", "3.14"]
runs-on: ubuntu-latest

steps:
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/psf/black
rev: 23.7.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.9.0
hooks:
- id: black-jupyter
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.11
language_version: python3.14
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ coverage-print:
pytest --cov-report html --cov=turtlemd -rP tests/

ruff:
poetry run ruff turtlemd
poetry run ruff check turtlemd

black:
poetry run black --check turtlemd
Expand Down
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "turtlemd"
version = "2023.3.1"
version = "2025.1"
description = "A slow molecular dynamics library for testing"
authors = [
"Daniel Zhang <daniel.t.zhang@ntnu.no>",
Expand All @@ -11,13 +11,13 @@ license = "MIT"
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.10,<3.13"
python = ">=3.12,<3.15"
numpy = "^1.24.2"

[tool.poetry.group.dev.dependencies]
ruff = "^0.0.261"
black = "^23.3.0"
mypy = "^1.2.0"
ruff = "^0.14.0"
black = "^25.9.0"
mypy = "^1.18.0"
pytest = "^7.3.1"
pytest-cov = "^4.0.0"
pytest-randomly = "^3.12.0"
Expand All @@ -27,12 +27,13 @@ flake8 = "^6.0.0"

[tool.ruff]
line-length = 79

[tool.ruff.lint]
select = ["F", "E", "W", "I001", "UP"]
ignore-init-module-imports = true

[tool.black]
line-length = 79
target-version = ["py310", "py311", "py312"]
target-version = ["py312", "py313", "py314"]

[tool.mypy]
warn_unused_ignores = true
Expand Down
1 change: 1 addition & 0 deletions turtlemd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""TurtleMD is a slow MD library for testing."""

from .version import __version__

__all__ = ["__version__"]
1 change: 1 addition & 0 deletions turtlemd/integrators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Definition of time integrators."""

import logging
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
Expand Down
1 change: 1 addition & 0 deletions turtlemd/potentials/lennardjones.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module defining a Lennard-Jones pair potential."""

import itertools
import logging
from typing import Any
Expand Down
1 change: 1 addition & 0 deletions turtlemd/potentials/potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This module defines the generic class for potential functions.
This class is sub-classed in all potential functions.
"""

from __future__ import annotations

import logging
Expand Down
5 changes: 2 additions & 3 deletions turtlemd/potentials/well.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* DoubleWellPair (:py:class:`.DoubleWellPair`)
This class defines a double well pair potential.
"""

import logging

import numpy as np
Expand Down Expand Up @@ -276,9 +277,7 @@ def force(self, system: System) -> tuple[np.ndarray, np.ndarray]:
delta = box.pbc_dist(particles.pos[i] - particles.pos[j])
delr = np.sqrt(np.dot(delta, delta))
diff = delr - rwidth
forceij = (
height4 * (1.0 - diff**2 / width2) * (diff / width2)
)
forceij = height4 * (1.0 - diff**2 / width2) * (diff / width2)
forceij = forceij * delta / delr
forces[i] += forceij
forces[j] -= forceij
Expand Down
1 change: 1 addition & 0 deletions turtlemd/simulation/mdsimulation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Definition of a simulation."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions turtlemd/simulation/stopping.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Definitions for stopping a simulation."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions turtlemd/system/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""For importing the most commonly used system methods."""

from .box import Box
from .particles import Particles
from .system import System
Expand Down
1 change: 1 addition & 0 deletions turtlemd/system/box.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define a simulation box."""

import itertools
import logging
from abc import ABC, abstractmethod
Expand Down
1 change: 1 addition & 0 deletions turtlemd/system/particles.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Tha particle list collects the mass, positions, velocities,
forces, types, etc. for a collection of particles.
"""

from collections.abc import Iterator
from typing import SupportsIndex

Expand Down
1 change: 1 addition & 0 deletions turtlemd/system/system.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Definition of the simulation system."""

from __future__ import annotations

from typing import TYPE_CHECKING, Any, TypedDict
Expand Down
1 change: 1 addition & 0 deletions turtlemd/tools/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Some helper methods for setting up simulations."""

import itertools

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions turtlemd/tools/xyz.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Methods to read particles from xyz-files."""

import logging
import pathlib
from collections.abc import Iterator
Expand Down
1 change: 1 addition & 0 deletions turtlemd/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Version information."""

from importlib import metadata

__version__ = metadata.version("turtlemd")