rdworks 0.49.1__py3-none-any.whl → 0.50.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/xtb/wrapper.py +44 -7
- {rdworks-0.49.1.dist-info → rdworks-0.50.1.dist-info}/METADATA +1 -1
- {rdworks-0.49.1.dist-info → rdworks-0.50.1.dist-info}/RECORD +7 -7
- {rdworks-0.49.1.dist-info → rdworks-0.50.1.dist-info}/WHEEL +0 -0
- {rdworks-0.49.1.dist-info → rdworks-0.50.1.dist-info}/licenses/LICENSE +0 -0
- {rdworks-0.49.1.dist-info → rdworks-0.50.1.dist-info}/top_level.txt +0 -0
rdworks/__init__.py
CHANGED
rdworks/xtb/wrapper.py
CHANGED
@@ -59,6 +59,43 @@ class GFN2xTB:
|
|
59
59
|
return shutil.which('xtb') is not None
|
60
60
|
|
61
61
|
|
62
|
+
@staticmethod
|
63
|
+
def is_optimize_ready() -> bool:
|
64
|
+
try:
|
65
|
+
h2o = [
|
66
|
+
'$coord',
|
67
|
+
' 0.00000000000000 0.00000000000000 -0.73578586109551 o',
|
68
|
+
' 1.44183152868459 0.00000000000000 0.36789293054775 h',
|
69
|
+
'-1.44183152868459 0.00000000000000 0.36789293054775 h',
|
70
|
+
'$end',
|
71
|
+
]
|
72
|
+
|
73
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
74
|
+
test_geometry = os.path.join(temp_dir, 'coord')
|
75
|
+
with open(test_geometry, 'w') as f:
|
76
|
+
f.write('\n'.join(h2o))
|
77
|
+
proc = subprocess.run(['xtb', test_geometry, '--opt'],
|
78
|
+
capture_output=True,
|
79
|
+
text=True)
|
80
|
+
assert proc.returncode == 0
|
81
|
+
|
82
|
+
return True
|
83
|
+
|
84
|
+
except:
|
85
|
+
print("""
|
86
|
+
Conda installed xTB has the Fortran runtime error in geometry optimization.
|
87
|
+
Please install xtb using the compiled binary:
|
88
|
+
|
89
|
+
$ wget https://github.com/grimme-lab/xtb/releases/download/v6.7.1/xtb-6.7.1-linux-x86_64.tar.xz
|
90
|
+
$ tar -xf xtb-6.7.1-linux-x86_64.tar.xz
|
91
|
+
$ cp -r xtb-dist/bin/* /usr/local/bin/
|
92
|
+
$ cp -r xtb-dist/lib/* /usr/local/lib/
|
93
|
+
$ cp -r xtb-dist/include/* /usr/local/include/
|
94
|
+
$ cp -r xtb-dist/share /usr/local/ """)
|
95
|
+
|
96
|
+
return False
|
97
|
+
|
98
|
+
|
62
99
|
@staticmethod
|
63
100
|
def is_cpx_ready() -> bool:
|
64
101
|
"""Checks if the CPCM-X command-line tool, `cpx`, is accessible in the system.
|
@@ -70,7 +107,7 @@ class GFN2xTB:
|
|
70
107
|
|
71
108
|
|
72
109
|
@staticmethod
|
73
|
-
def
|
110
|
+
def is_cpcmx_ready() -> bool:
|
74
111
|
"""Checks if xtb works with the `--cpcmx` option.
|
75
112
|
|
76
113
|
xtb distributed by the conda does not include CPCM-X function (as of June 17, 2025).
|
@@ -101,7 +138,8 @@ class GFN2xTB:
|
|
101
138
|
"""
|
102
139
|
return all([GFN2xTB.is_xtb_ready(),
|
103
140
|
GFN2xTB.is_cpx_ready(),
|
104
|
-
GFN2xTB.
|
141
|
+
GFN2xTB.is_cpcmx_ready(),
|
142
|
+
GFN2xTB.is_optimize_ready()])
|
105
143
|
|
106
144
|
|
107
145
|
@staticmethod
|
@@ -115,10 +153,9 @@ class GFN2xTB:
|
|
115
153
|
cmd = ['xtb', '--version']
|
116
154
|
proc = subprocess.run(cmd, capture_output=True, text=True)
|
117
155
|
assert proc.returncode == 0, "GFN2xTB() Error: xtb not available"
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
return line
|
156
|
+
match = re.search('xtb\s+version\s+(?P<version>[\d.]+)', proc.stdout)
|
157
|
+
if match:
|
158
|
+
return match.group('version')
|
122
159
|
|
123
160
|
return None
|
124
161
|
|
@@ -362,7 +399,7 @@ class GFN2xTB:
|
|
362
399
|
elif water == 'alpb':
|
363
400
|
options += ['--alpb', 'water']
|
364
401
|
# it does not provide Gsolv contribution to the total energy
|
365
|
-
elif water == 'cpcmx' and self.
|
402
|
+
elif water == 'cpcmx' and self.is_cpcmx_ready():
|
366
403
|
options += ['--cpcmx', 'water']
|
367
404
|
|
368
405
|
if verbose:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
rdworks/__init__.py,sha256=
|
1
|
+
rdworks/__init__.py,sha256=cELiDVknzDSz59Afufwk8LssqIuPLWLsxO73NISKfLY,1391
|
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
|
@@ -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=w_SX3q7D4_peHERFzONesG8c-a6UTRzfBLx313D8rNE,23638
|
69
|
+
rdworks-0.50.1.dist-info/licenses/LICENSE,sha256=UOkJSBqYyQUvtCp7a-vdCANeEcLE2dnTie_eB1By5SY,1074
|
70
|
+
rdworks-0.50.1.dist-info/METADATA,sha256=Rh6pJzHolql4Q3OJot3eO8OQ7K2R9nPqpPc3Vwt3l0Y,1967
|
71
|
+
rdworks-0.50.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
72
|
+
rdworks-0.50.1.dist-info/top_level.txt,sha256=05C98HbvBK2axUBogC_hAT_CdpOeQYGnQ6vRAgawr8s,8
|
73
|
+
rdworks-0.50.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|