Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiwfn QTAIM parsing capabilities #3926

Merged
merged 34 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
64b622f
Initial commit; thank you, Santiago!
espottesmith Jul 11, 2024
437f42d
Refactoring to clean up parsing; add rings and cages
espottesmith Jul 11, 2024
951389a
More progress
espottesmith Jul 11, 2024
890ebf6
Almost done with first draft; just need to put all of the pieces toge…
espottesmith Jul 12, 2024
93abd2c
Some cleaning up; some work still to be done here
espottesmith Jul 12, 2024
b39e838
First draft, done
espottesmith Jul 15, 2024
c92d058
First steps towards tests
espottesmith Jul 15, 2024
c081dcd
Progress on tests; some small bugfixes
espottesmith Jul 16, 2024
e9e82ce
More tests
espottesmith Jul 16, 2024
6526e7b
Finished!
espottesmith Jul 16, 2024
f5cc1fe
Remove unnecessary files
espottesmith Jul 16, 2024
5835c07
Trying to fight linters and type checkers and all that nonsense
espottesmith Jul 16, 2024
778ce44
Merge remote-tracking branch 'mp/master' into qtaim
espottesmith Jul 16, 2024
ee9df59
pre-commit auto-fixes
pre-commit-ci[bot] Jul 16, 2024
1f797dc
Please, ruff, be kind
espottesmith Jul 16, 2024
ab6e75b
Merge branch 'qtaim' of https://github.com/espottesmith/pymatgen into…
espottesmith Jul 16, 2024
d806c13
Please no more linting, please no more linting
espottesmith Jul 16, 2024
3add13b
pre-commit auto-fixes
pre-commit-ci[bot] Jul 16, 2024
1b6b9af
(hopefully) just one more mypy issue
espottesmith Jul 16, 2024
95903c4
Merge branch 'qtaim' of https://github.com/espottesmith/pymatgen into…
espottesmith Jul 16, 2024
d460e89
Whoops
espottesmith Jul 16, 2024
30bf8f0
Opinionated linters hate Union and Optional
espottesmith Jul 16, 2024
ec0601a
pre-commit auto-fixes
pre-commit-ci[bot] Jul 16, 2024
17112d8
Merge branch 'qtaim' of https://github.com/espottesmith/pymatgen into…
espottesmith Jul 16, 2024
b65fe18
Someday, I will meet the creators of mypy, and they will feel my rage
espottesmith Jul 16, 2024
1ae14ba
Small type change suggested by @DanielYang59
espottesmith Jul 17, 2024
7432f43
pre-commit auto-fixes
pre-commit-ci[bot] Jul 17, 2024
c7db560
Merge branch 'master' into qtaim
espottesmith Jul 17, 2024
c2c2a40
Added wavefunction output as a feature of Q-Chem sets
espottesmith Jul 17, 2024
5e6d149
Add back in qtaim-based bond definition (rather than distance-based d…
espottesmith Jul 19, 2024
e69fbab
Somehow, the linter was mad at me for things that I never touched. In…
espottesmith Jul 19, 2024
59537fc
Added a third way to define bonds
espottesmith Jul 23, 2024
dcaa1c1
mypy, of course
espottesmith Jul 23, 2024
6be7e65
Merge remote-tracking branch 'mp/master' into qtaim
espottesmith Jul 30, 2024
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
Prev Previous commit
Next Next commit
pre-commit auto-fixes
  • Loading branch information
pre-commit-ci[bot] committed Jul 16, 2024
commit ee9df597d6eb021d09a663665534c4334544f8cd
10 changes: 5 additions & 5 deletions src/pymatgen/io/multiwfn.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import copy
import warnings
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
from typing import TYPE_CHECKING, Any, Literal

import numpy as np

Expand Down Expand Up @@ -133,7 +133,7 @@ def extract_info_from_cp_text(
return cp_name, cp_dict


def parse_cp(lines: list[str]) -> tuple[Optional[str], dict[str, Any]]:
def parse_cp(lines: list[str]) -> tuple[str | None, dict[str, Any]]:
"""
Parse information from a single QTAIM critical point.

Expand Down Expand Up @@ -166,7 +166,7 @@ def parse_cp(lines: list[str]) -> tuple[Optional[str], dict[str, Any]]:
return extract_info_from_cp_text(lines_split, cp_type, conditionals)


def get_qtaim_descs(file: Union[str, Path]) -> dict[str, dict[str, Any]]:
def get_qtaim_descs(file: str | Path) -> dict[str, dict[str, Any]]:
"""
Parse CPprop file from multiwfn by parsing each individual critical-point section.

Expand Down Expand Up @@ -238,7 +238,7 @@ def separate_cps_by_type(qtaim_descs: dict[str, dict[str, Any]]) -> dict[str, di

def match_atom_cp(
molecule: Molecule, index: int, atom_cp_dict: dict[str, dict[str, Any]], max_distance: float = 0.5
) -> tuple[Optional[str], dict]:
) -> tuple[str | None, dict]:
"""
From a dictionary with an atom's position and element symbol, find the corresponding cp in the atom CP dictionary

Expand Down Expand Up @@ -448,7 +448,7 @@ def sort_cps_by_distance(

def process_multiwfn_qtaim(
molecule: Molecule,
file: Union[str, Path],
file: str | Path,
espottesmith marked this conversation as resolved.
Show resolved Hide resolved
max_distance_atom: float = 0.5,
dist_threshold_bond: float = 1.0,
dist_threshold_ring_cage: float = 3.0,
Expand Down
1 change: 0 additions & 1 deletion tests/io/test_multiwfn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import copy

import pytest

from pymatgen.core.structure import Molecule
from pymatgen.io.multiwfn import (
QTAIM_CONDITIONALS,
Expand Down
Loading