Skip to content

Introduce type hints in the HF backend files - #236

Merged
frieschneider merged 25 commits into
masterfrom
backend_type_hints
Aug 21, 2026
Merged

Introduce type hints in the HF backend files#236
frieschneider merged 25 commits into
masterfrom
backend_type_hints

Conversation

@jonasleitner

@jonasleitner jonasleitner commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Improves static typing of the Python-facing API. Mostly annotations and stub
regeneration, plus a few interface changes needed to make the generated stub
useful.

C++ / pybind11 interface

  • Named all binding arguments so the stub exposes keyword arguments instead of arg0, arg1, ...
  • New libadcc_src/pyiface/ndarray.hh: NDArray<T, Ndim>, a thin py::array_t<T>
    wrapper that carries the dimensionality into the stub
    (numpy.ndarray[tuple[int, int], numpy.dtype[numpy.float64]]) and rejects
    arrays of the wrong ndim at the boundary (data type casts unchanged).
  • py::array / py::tuple / py::list parameters replaced by more specific types that generate
    more specific signatures for the stub file. The runtime behavior should not be affected.
  • pybind11 minimal version updated to 3.0 for the support of variadic arguments.

Python backends

  • Type hints for pyscf, psi4 and EriBuilder. Note that a breaking change in the signature of
    EriBuilder.compute_mo_eri is introduced.
  • veloxchem: added get_nuclear_repulsion_energy so the backend remains functional.

Additionally, the temporary libxc-c=7.0.0 pin for psi4 is removed again.

Comment thread adcc/backends/EriBuilder.py Outdated
Comment thread adcc/backends/psi4.py
Comment thread adcc/backends/pyscf.py
Co-authored-by: Friederike Schneider <110526409+frieschneider@users.noreply.github.com>
Comment thread adcc/backends/psi4.py Outdated
Comment thread adcc/backends/EriBuilder.py Outdated
jonasleitner and others added 2 commits August 20, 2026 09:25
Co-authored-by: Friederike Schneider <110526409+frieschneider@users.noreply.github.com>
@frieschneider
frieschneider merged commit 5d383fd into master Aug 21, 2026
9 of 10 checks passed
@frieschneider
frieschneider deleted the backend_type_hints branch August 21, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants