rdworks 0.46.1__py3-none-any.whl → 0.47.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rdworks/__init__.py +1 -1
- rdworks/torsion.py +1 -1
- rdworks/xtb/wrapper.py +49 -31
- {rdworks-0.46.1.dist-info → rdworks-0.47.1.dist-info}/METADATA +1 -1
- {rdworks-0.46.1.dist-info → rdworks-0.47.1.dist-info}/RECORD +8 -8
- {rdworks-0.46.1.dist-info → rdworks-0.47.1.dist-info}/WHEEL +0 -0
- {rdworks-0.46.1.dist-info → rdworks-0.47.1.dist-info}/licenses/LICENSE +0 -0
- {rdworks-0.46.1.dist-info → rdworks-0.47.1.dist-info}/top_level.txt +0 -0
rdworks/__init__.py
CHANGED
rdworks/torsion.py
CHANGED
@@ -462,7 +462,7 @@ def create_torsion_fragment(rdmol: Chem.Mol,
|
|
462
462
|
|
463
463
|
# fragmented
|
464
464
|
WBO_filtered = False
|
465
|
-
if GFN2xTB
|
465
|
+
if GFN2xTB.is_ready():
|
466
466
|
# filter candidate(s) by Wiberg bond order (WBO) if xTB is available
|
467
467
|
jk = tuple(sorted([j, k]))
|
468
468
|
wbo_passed_candidates = {}
|
rdworks/xtb/wrapper.py
CHANGED
@@ -45,42 +45,28 @@ class GFN2xTB:
|
|
45
45
|
resource.setrlimit(resource.RLIMIT_STACK, (resource.RLIM_INFINITY, resource.RLIM_INFINITY))
|
46
46
|
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
Returns:
|
52
|
-
str | None: version statement.
|
53
|
-
"""
|
54
|
-
cmd = ['xtb', '--version']
|
55
|
-
proc = subprocess.run(cmd, capture_output=True, text=True)
|
56
|
-
assert proc.returncode == 0, "GFN2xTB() Error: xtb not available"
|
57
|
-
for line in proc.stdout.split('\n'):
|
58
|
-
line = line.strip()
|
59
|
-
if 'version' in line:
|
60
|
-
return line
|
61
|
-
|
62
|
-
return None
|
63
|
-
|
64
|
-
|
65
|
-
def is_xtb_ready(self, cmd: str = 'xtb') -> bool:
|
48
|
+
@staticmethod
|
49
|
+
def is_xtb_ready() -> bool:
|
66
50
|
"""Check if xtb is available.
|
67
51
|
|
68
52
|
Returns:
|
69
53
|
bool: True if `xtb` is available, False otherwise.
|
70
54
|
"""
|
71
|
-
return shutil.which(
|
55
|
+
return shutil.which('xtb') is not None
|
72
56
|
|
73
57
|
|
74
|
-
|
58
|
+
@staticmethod
|
59
|
+
def is_cpx_ready() -> bool:
|
75
60
|
"""Checks if the CPCM-X command-line tool, `cpx`, is accessible in the system.
|
76
61
|
|
77
62
|
Returns:
|
78
63
|
bool: True if the cpx is found, False otherwise.
|
79
64
|
"""
|
80
|
-
return shutil.which(
|
65
|
+
return shutil.which('cpx') is not None
|
81
66
|
|
82
67
|
|
83
|
-
|
68
|
+
@staticmethod
|
69
|
+
def is_cpcmx_option_ready() -> bool:
|
84
70
|
"""Checks if xtb works with the `--cpcmx` option.
|
85
71
|
|
86
72
|
xtb distributed by the conda does not include CPCM-X function (as of June 17, 2025).
|
@@ -89,18 +75,50 @@ class GFN2xTB:
|
|
89
75
|
Returns:
|
90
76
|
bool: True if the --cpcmx option is working, False otherwise.
|
91
77
|
"""
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
line
|
98
|
-
|
99
|
-
|
78
|
+
if GFN2xTB.is_xtb_ready():
|
79
|
+
cmd = ['xtb', '--cpcmx']
|
80
|
+
proc = subprocess.run(cmd, capture_output=True, text=True)
|
81
|
+
# we are expecting an error because no input file is given
|
82
|
+
assert proc.returncode != 0
|
83
|
+
for line in proc.stdout.split('\n'):
|
84
|
+
line = line.strip()
|
85
|
+
if 'CPCM-X library was not included' in line:
|
86
|
+
return False
|
100
87
|
|
101
88
|
return True
|
102
89
|
|
103
90
|
|
91
|
+
@staticmethod
|
92
|
+
def is_ready() -> bool:
|
93
|
+
"""Check if `xtb` and `cpx` are accessible and `xtb --cpcmx` are available.
|
94
|
+
|
95
|
+
Returns:
|
96
|
+
bool: True if both `xtb` and `cpx` are accessible, False otherwise.
|
97
|
+
"""
|
98
|
+
return all([GFN2xTB.is_xtb_ready(),
|
99
|
+
GFN2xTB.is_cpx_ready(),
|
100
|
+
GFN2xTB.is_cpcmx_option_ready()])
|
101
|
+
|
102
|
+
|
103
|
+
@staticmethod
|
104
|
+
def version() -> str | None:
|
105
|
+
"""Check xtb version.
|
106
|
+
|
107
|
+
Returns:
|
108
|
+
str | None: version statement.
|
109
|
+
"""
|
110
|
+
if GFN2xTB.is_ready():
|
111
|
+
cmd = ['xtb', '--version']
|
112
|
+
proc = subprocess.run(cmd, capture_output=True, text=True)
|
113
|
+
assert proc.returncode == 0, "GFN2xTB() Error: xtb not available"
|
114
|
+
for line in proc.stdout.split('\n'):
|
115
|
+
line = line.strip()
|
116
|
+
if 'version' in line:
|
117
|
+
return line
|
118
|
+
|
119
|
+
return None
|
120
|
+
|
121
|
+
|
104
122
|
def to_xyz(self) -> str:
|
105
123
|
"""Export to XYZ formatted string.
|
106
124
|
|
@@ -345,7 +363,7 @@ class GFN2xTB:
|
|
345
363
|
elif water == 'alpb':
|
346
364
|
options += ['--alpb', 'water']
|
347
365
|
# it does not provide Gsolv contribution to the total energy
|
348
|
-
elif water == 'cpcmx' and self.
|
366
|
+
elif water == 'cpcmx' and self.is_cpcmx_option_ready():
|
349
367
|
options += ['--cpcmx', 'water']
|
350
368
|
|
351
369
|
# 'xtbout.json', 'xtbrestart', 'xtbtopo.mol', 'charges', and 'wbo' files will be
|
@@ -1,4 +1,4 @@
|
|
1
|
-
rdworks/__init__.py,sha256=
|
1
|
+
rdworks/__init__.py,sha256=CkKXxGhqvK8jzCxjOXnj2IOOvdHKpHE6ekjM5ZECSUw,1368
|
2
2
|
rdworks/conf.py,sha256=iQLb3Qg3pjGiiMVMJ5-d57BC1id3zxEhEGlhhrLrA_c,34162
|
3
3
|
rdworks/descriptor.py,sha256=34T_dQ6g8v3u-ym8TLKbQtxIIV5TEo-d3pdedq3o-cg,2106
|
4
4
|
rdworks/display.py,sha256=JR0gR26UpH-JCxVOaqXZCUj2MiGZSrx9Me87FncspVI,13469
|
@@ -14,7 +14,7 @@ rdworks/std.py,sha256=qOVS_lGogueLKh4rsbrsYIMR0c7z_xh6BqLEzD4X9sE,7938
|
|
14
14
|
rdworks/stereoisomers.py,sha256=g8hhPI-mbYX-MzbF1uAqo5fDZOCNiKYjxI-kLBGdGgg,4980
|
15
15
|
rdworks/tautomers.py,sha256=gtZHZJ-aJbryhBdljHbfjx7xhVW3u_OzdYPtwPail54,610
|
16
16
|
rdworks/testdata.py,sha256=TmbNPA-ju6nTBt_Yts4EJUFmL9Cd6DCVXrDF42QLlHw,1732
|
17
|
-
rdworks/torsion.py,sha256=
|
17
|
+
rdworks/torsion.py,sha256=UUaYOvNS89SlLFauYiAboUqysy32EN0_Gktc4xxuDQI,18788
|
18
18
|
rdworks/units.py,sha256=nljKPHcr6IWoAp0CkL7y1gSNDd6a07NeVfxXwSMuHQM,365
|
19
19
|
rdworks/utils.py,sha256=d2Sio8WTlGPsmBOHIYDCMWg_7X4rTWjJQAqzd7ywo2A,14191
|
20
20
|
rdworks/xml.py,sha256=aaMhwVRGvt1VzasaKDnkYnZ4kp2cIgvGb1CsmMgwQ_c,10704
|
@@ -65,9 +65,9 @@ rdworks/predefined/misc/reactive-part-2.xml,sha256=0vNTMwWrrQmxBpbgbyRHx8sVs83cq
|
|
65
65
|
rdworks/predefined/misc/reactive-part-3.xml,sha256=LgWHSEbRTVmgBoIO45xbTo1xQJs0Xu51j3JnIapRYo4,3094
|
66
66
|
rdworks/predefined/misc/reactive.xml,sha256=syedoQ6VYUfRLnxy99ObuDniJ_a_WhrWAJbTKFfJ6VY,11248
|
67
67
|
rdworks/xtb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
68
|
-
rdworks/xtb/wrapper.py,sha256=
|
69
|
-
rdworks-0.
|
70
|
-
rdworks-0.
|
71
|
-
rdworks-0.
|
72
|
-
rdworks-0.
|
73
|
-
rdworks-0.
|
68
|
+
rdworks/xtb/wrapper.py,sha256=NQgkdRKN5YEtv_UPYKWDijzMEs5v2kFrhUWHqiro7bE,22174
|
69
|
+
rdworks-0.47.1.dist-info/licenses/LICENSE,sha256=UOkJSBqYyQUvtCp7a-vdCANeEcLE2dnTie_eB1By5SY,1074
|
70
|
+
rdworks-0.47.1.dist-info/METADATA,sha256=w8BCgsWZ6AqzjSjZL1z4ker0-mwca09u5XiBsXa0ycw,1967
|
71
|
+
rdworks-0.47.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
72
|
+
rdworks-0.47.1.dist-info/top_level.txt,sha256=05C98HbvBK2axUBogC_hAT_CdpOeQYGnQ6vRAgawr8s,8
|
73
|
+
rdworks-0.47.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|