Skip to content

Commit f3042cd

Browse files
Expose other keywords and update docstrings
1 parent 4af68ae commit f3042cd

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

src/quemb/molbe/fragment.py

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,22 @@ class fragpart:
4444
write_geom: bool
4545
Whether to write 'fragment.xyz' file which contains all the fragments
4646
in cartesian coordinates.
47+
remove_nonunique_frags:
48+
Whether to remove fragments which are strict subsets of another
49+
fragment in the system. True by default.
50+
frag_prefix:
51+
Prefix to be appended to the fragment datanames. Useful for managing
52+
fragment scratch directories.
53+
connectivity:
54+
Keyword string specifying the distance metric to be used for edge
55+
weights in the fragment adjacency graph. Currently supports "euclidean"
56+
(which uses the square of the distance between atoms in real
57+
space to determine connectivity within a fragment.)
58+
cutoff:
59+
Atoms with an edge weight beyond `cutoff` will be excluded from the
60+
`shortest_path` calculation. This is crucial when handling very large
61+
systems, where computing the shortest paths from all to all becomes
62+
non-trivial. Defaults to 20.0.
4763
"""
4864

4965
def __init__(
@@ -55,8 +71,12 @@ def __init__(
5571
print_frags=True,
5672
write_geom=False,
5773
be_type="be2",
74+
frag_prefix="f",
75+
connectivity="euclidean",
5876
mol=None,
5977
frozen_core=False,
78+
cutoff=20,
79+
remove_nonnunique_frags=True,
6080
):
6181
# Initialize class attributes
6282
self.mol = mol
@@ -70,9 +90,13 @@ def __init__(
7090
self.center_idx = []
7191
self.centerf_idx = []
7292
self.be_type = be_type
93+
self.frag_prefix = frag_prefix
94+
self.connectivity = connectivity
7395
self.frozen_core = frozen_core
7496
self.iao_valence_basis = iao_valence_basis
7597
self.valence_only = valence_only
98+
self.cutoff = cutoff
99+
self.remove_nonnunique_frags = remove_nonnunique_frags
76100

77101
# Initialize class attributes necessary for mixed-basis BE
78102
self.Frag_atom = []
@@ -98,12 +122,13 @@ def __init__(
98122
elif frag_type == "graphgen":
99123
fragment_map = graphgen(
100124
mol=self.mol.copy(),
101-
be_type=be_type,
102-
frozen_core=frozen_core,
103-
remove_nonunique_frags=True,
104-
frag_prefix="f",
105-
connectivity="euclidean",
106-
iao_valence_basis=iao_valence_basis,
125+
be_type=self.be_type,
126+
frozen_core=self.frozen_core,
127+
remove_nonunique_frags=self.remove_nonnunique_frags,
128+
frag_prefix=self.frag_prefix,
129+
connectivity=self.connectivity,
130+
iao_valence_basis=self.iao_valence_basis,
131+
cutoff=self.cutoff,
107132
)
108133

109134
self.fsites = fragment_map.fsites

0 commit comments

Comments
 (0)