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
70 changes: 70 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# pre-commit hooks for propSAPT. They check only the files being committed.
#
# One-time setup, in the prop-sapt environment (the hooks then run on its Python):
# pip install pre-commit
# pre-commit install # installs the commit hook
# pre-commit run --all-files # first run over the existing code
#
# Day to day:
# pre-commit autoupdate # bump hook versions (every month or two)
# SKIP=<hook-id> git commit ... # skip one hook once, after checking by hand
#
# black and flake8 run the checks CI runs (.github/workflows/python-package-conda.yml).
# black's style is fixed within a major version: bump its rev together with the pins
# in CI and prop-sapt.yaml.

repos:
# --- General hygiene ------------------------------------------------------
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files # stray data dumps and outputs
args: [--maxkb=1000]
- id: check-merge-conflict
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: debug-statements # leftover breakpoint() / pdb
- id: detect-private-key
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: no-commit-to-branch # main changes only through pull requests

# --- Secrets (API keys, tokens, passwords) ---------------------------------
# detect-private-key above catches private keys only. For a thorough scan,
# uncomment gitleaks. pre-commit builds it with Go, which it downloads on
# first run if Go isn't installed (a few minutes, once).
# - repo: https://github.com/gitleaks/gitleaks
# rev: v8.30.0
# hooks:
# - id: gitleaks

# --- Python ---------------------------------------------------------------
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.10.1
hooks:
- id: black

# The errors CI stops on: syntax errors and undefined names.
- repo: https://github.com/PyCQA/flake8
rev: 7.5.0
hooks:
- id: flake8
args: ["--select=E9,F63,F7,F82", --show-source]

# --- Notebooks ------------------------------------------------------------
# The example notebooks are kept without outputs and widget state.
- repo: https://github.com/kynan/nbstripout
rev: 0.9.2
hooks:
- id: nbstripout

# --- Metadata -------------------------------------------------------------
# CITATION.cff feeds GitHub's "Cite this repository" and Zenodo. The workflows
# are checked against their schema, as release.yml runs only on a tag push.
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.40.0
hooks:
- id: check-github-workflows
- id: check-citation-file-format
4 changes: 4 additions & 0 deletions AI-USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,7 @@ The short version, for disclosures; the log below has the detail.
### 2026-11-25

- Worked through a code review of the Psi4 backend pull request: J/K inputs cleared after a failed build, monomers with different numbers of orbitals rejected, `nao_aux` renamed `naux` (it now counts spherical fitting functions), Psi4's timer around the whole dimer construction again, clear errors from the Psi4 getters with another backend, the tensor folding of `compute_jk` tested on both sides, with docs and changelog notes for the API changes.

### 2026-12-02

- Added a pre-commit configuration (`.pre-commit-config.yaml`), adapted from a suggested setup after reviewing it against the repository.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6 changes: 3 additions & 3 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ To perform the SAPT energy decomposition, SAPT0 for an ``RHF`` dimer and SAPT(DF

# Calculate all SAPT components
energy_result = calc_sapt_energy(dimer)

print(energy_result)

The result is a pandas Series of all SAPT energy components. It is also saved to
Expand Down Expand Up @@ -130,7 +130,7 @@ To calculate interaction-induced properties for a general one-electron operator:

# Calculate property contributions
property_result = calc_property(dimer, property_matrix)

print(property_result)

For predefined properties, you can use the convenience functions, e.g., to calculate the dipole moment:
Expand Down Expand Up @@ -271,7 +271,7 @@ A bundle that does not match raises :class:`~prop_sapt.artifacts.ArtifactError`.
The older layout of bare :file:`delta_dm_<key>.npy` and :file:`wfn_mon_<A/B>.npy` files is
still written with :python:`matrix_format="npy"`, but it is deprecated, and so is the
``compress_matrices`` argument.


.. _viamd:

Expand Down