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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
language_version: python3

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v3.1.0
rev: v3.2.0
hooks:
- id: setup-cfg-fmt
args:
Expand All @@ -42,25 +42,25 @@ repos:
]

- repo: https://github.com/asottile/pyupgrade
rev: v3.21.0
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py37-plus, --keep-runtime-typing]

- repo: https://github.com/pycqa/isort
rev: 7.0.0
rev: 8.0.1
hooks:
- id: isort
name: isort (python)
args: ["--profile", "black", "--line-length", "80", "--filter-files"]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.9.0
rev: 26.3.1
hooks:
- id: black
args: ["--line-length", "80"]

- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.15.2
rev: v1.23.1
hooks:
- id: zizmor
1 change: 1 addition & 0 deletions examples/batch-1.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
Running a simple batched calculation.
"""

import torch

import dxtb
Expand Down
1 change: 1 addition & 0 deletions examples/batch-2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
Obtaining the interaction energy of a dimer from a batched calculation.
"""

import tad_mctc as mctc
import torch

Expand Down
1 change: 1 addition & 0 deletions examples/forces.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
Calculating forces for vancomycin via AD.
"""

from pathlib import Path

import torch
Expand Down
1 change: 1 addition & 0 deletions examples/integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
Simple integral interface. Can be helpful for testing.
"""

from pathlib import Path

import torch
Expand Down
1 change: 1 addition & 0 deletions examples/issues/123/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
https://github.com/grimme-lab/dxtb/issues/123
"""

from __future__ import annotations

from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions examples/issues/179/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
https://github.com/grimme-lab/dxtb/issues/179
"""

import torch

import dxtb
Expand Down
1 change: 1 addition & 0 deletions examples/issues/183/cleaned.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
https://github.com/grimme-lab/dxtb/issues/183
"""

import torch

import dxtb
Expand Down
1 change: 1 addition & 0 deletions examples/issues/187/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
https://github.com/grimme-lab/dxtb/issues/187
"""

import torch

import dxtb
Expand Down
1 change: 1 addition & 0 deletions examples/issues/194/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
https://github.com/grimme-lab/dxtb/issues/194
"""

import torch

import dxtb
Expand Down
1 change: 1 addition & 0 deletions examples/issues/206/missing-reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
https://github.com/grimme-lab/dxtb/issues/206
"""

import concurrent.futures
import tempfile
from tempfile import NamedTemporaryFile
Expand Down
1 change: 1 addition & 0 deletions examples/issues/206/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
https://github.com/grimme-lab/dxtb/issues/206
"""

import concurrent.futures
import tempfile
from tempfile import NamedTemporaryFile
Expand Down
1 change: 1 addition & 0 deletions examples/issues/223/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
https://github.com/grimme-lab/dxtb/issues/223
"""

import torch
from tad_mctc import read
from tad_mctc.batch import pack
Expand Down
1 change: 1 addition & 0 deletions examples/limitation_xitorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
Example for xitorch's inability to be used together with functorch.
"""

from pathlib import Path

import torch
Expand Down
1 change: 1 addition & 0 deletions examples/profiling/batch-vs-seq-nicotine.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
Comparing sequential and batched execution.
"""

from pathlib import Path

import torch
Expand Down
1 change: 1 addition & 0 deletions examples/profiling/move-device.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
Simple energy calculation.
"""

import functools
import logging
import traceback
Expand Down
1 change: 1 addition & 0 deletions examples/readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
Example from README.md.
"""

import torch

import dxtb
Expand Down
2 changes: 1 addition & 1 deletion src/dxtb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

A fully differentiable extended tight-binding package.
"""

# pylint: disable=C0411,C0412,C0413,C0414

# import timer first to get correct total time
Expand All @@ -44,7 +45,6 @@

from dxtb.__version__ import __version__


# order is important here
from dxtb._src.io import OutputHandler as OutputHandler
from dxtb._src.basis.indexhelper import IndexHelper as IndexHelper
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/calculators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
This calculator provides analytical, autograd, and numerical versions of all
properties.
"""

from __future__ import annotations

from dxtb._src.constants import defaults
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/calculators/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
The default verbosity level is set to 5. The minimum verbosity level is 0,
which corresponds to no output. The maximum verbosity level is 10.
"""

from .cache import *
from .integral import *
from .main import *
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/calculators/gfn1.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

Calculator for the first generation extended tight-binding model (GFN1-xTB).
"""

from __future__ import annotations

import torch
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/calculators/gfn2.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

Calculator for the second generation extended tight-binding model (GFN2-xTB).
"""

from __future__ import annotations

import torch
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/calculators/properties/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- IR intensities
- static Raman intensities
"""

from dxtb._src.typing import TYPE_CHECKING

if TYPE_CHECKING:
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/calculators/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class **inherits from all types**, i.e., it provides the energy and properties
if we need to differentiate for multiple properties at once (e.g., Hessian and
dipole moment for IR spectra). Hence, the default is ``use_functorch=False``.
"""

from .analytical import AnalyticalCalculator
from .autograd import AutogradCalculator
from .energy import EnergyCalculator
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/calculators/types/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Abstract helper classes for reduction of boilerplace method definitions (i.e.,
duplication) in calculators.
"""

from __future__ import annotations

from abc import ABC, abstractmethod
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/calculators/types/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class and implement the :meth:`calculate` method and the corresponding methods
to calculate the properties specified within this :meth:`calculate`, as well as
the :attr:`implemented_properties` attribute.
"""

from __future__ import annotations

from abc import abstractmethod
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/components/classicals/dispersion/d3.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

The DFT-D3 dispersion model.
"""

from __future__ import annotations

import tad_dftd3 as d3
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/components/classicals/halogen/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
A factory function to create instances of the :class:`dxtb.components.Halogen`
class.
"""

from __future__ import annotations

import torch
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/components/interactions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Provides base class for interactions in the extended tight-binding Hamiltonian.
The `Interaction` class is not purely abstract as its methods return zero.
"""

# pylint: disable=unused-argument

from __future__ import annotations
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/exlibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
to reduce import times and to avoid unnecessary imports if the library is not
used.
"""

from typing import TYPE_CHECKING

if TYPE_CHECKING:
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/exlibs/pyscf/mol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@

mol = M(numbers, positions)
"""

from .base import *
1 change: 1 addition & 0 deletions src/dxtb/_src/exlibs/pyscf/mol/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
This module contains a class for a molecular representation in PySCF's format.
It also contains the short-cut version as in PySCF (``M``).
"""

from __future__ import annotations

import warnings
Expand Down
2 changes: 1 addition & 1 deletion src/dxtb/_src/exlibs/xitorch/_impls/linalg/symeig.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def davidson(
print(
"Iter %3d (guess size: %d): resid: %.3e, devals: %.3e"
% (i + 1, nguess, max_resid, max_deigval)
) # type:ignore
) # type: ignore

if max_resid < best_resid:
best_resid = max_resid
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/exlibs/xitorch/_impls/optimize/minimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

Implementations of minimizer functions.
"""

import warnings
from typing import Callable, List, Optional

Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/integral/driver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
The `PyTorch` drivers are implemented in pure Python, but are currently only
available for overlap integrals.
"""

from .base import IntDriver

# no specific driver imports here to allow lazy loading of drivers
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/integral/driver/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
The driver manager contains the selection logic, i.e., the it instantiates
the appropriate driver based on the configuration.
"""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/integral/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

Factory functions for integral classes.
"""

# pylint: disable=import-outside-toplevel

from __future__ import annotations
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/integral/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

Note that the Hamiltonian is different as it does not require a driver.
"""

from .dipole import *
from .overlap import *
from .quadrupole import *
1 change: 1 addition & 0 deletions src/dxtb/_src/loader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

Collection of various loaders for different purposes.
"""

from dxtb._src.typing import TYPE_CHECKING

if TYPE_CHECKING:
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/loader/lazy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@

del _lazy
"""

from .lazy_module import *
from .lazy_param import *
from .lazy_var import *
1 change: 1 addition & 0 deletions src/dxtb/_src/param/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

.. _tblite: https://tblite.readthedocs.io
"""

# pylint: disable=import-outside-toplevel

from __future__ import annotations
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/param/gfn1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@
# Verify that the parameters are now loaded
print(GFN1_XTB._loaded is None) # Expected output: False
"""

from .load import GFN1_XTB as GFN1_XTB
1 change: 1 addition & 0 deletions src/dxtb/_src/param/gfn2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@
# Now, the parameters should be loaded
print(GFN2_XTB._loaded is None) # Expected output: False
"""

from .load import GFN2_XTB as GFN2_XTB
1 change: 1 addition & 0 deletions src/dxtb/_src/param/module/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
The :class:`.ParamModule` class automatically converts a Pydantic
model into a hierarchical :class:`~torch.nn.Module` tree.
"""

from .param import *
1 change: 1 addition & 0 deletions src/dxtb/_src/param/module/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
The :class:`.ParamModule` class automatically converts a Pydantic
model into a hierarchical :class:`~torch.nn.Module` tree.
"""

from __future__ import annotations

import torch
Expand Down
1 change: 1 addition & 0 deletions src/dxtb/_src/param/module/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Types for the differentiable representation of the extended tight-binding
parametrization using PyTorch.
"""

from __future__ import annotations

from torch import nn
Expand Down
Loading
Loading