orto 1.0.6__py3-none-any.whl → 1.1.0__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.
- orto/__version__.py +1 -1
- orto/cli.py +23 -1
- orto/extractor.py +22 -2
- orto/input.py +114 -0
- {orto-1.0.6.dist-info → orto-1.1.0.dist-info}/METADATA +2 -2
- orto-1.1.0.dist-info/RECORD +15 -0
- orto-1.0.6.dist-info/RECORD +0 -15
- {orto-1.0.6.dist-info → orto-1.1.0.dist-info}/WHEEL +0 -0
- {orto-1.0.6.dist-info → orto-1.1.0.dist-info}/entry_points.txt +0 -0
- {orto-1.0.6.dist-info → orto-1.1.0.dist-info}/top_level.txt +0 -0
orto/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '1.0
|
|
1
|
+
__version__ = '1.1.0'
|
orto/cli.py
CHANGED
|
@@ -464,7 +464,7 @@ def gen_job_func(uargs):
|
|
|
464
464
|
|
|
465
465
|
# Check xyz file is present
|
|
466
466
|
try:
|
|
467
|
-
inp.
|
|
467
|
+
inp.check_coord(oj.input_file, uargs.skip_xyz)
|
|
468
468
|
except (DataNotFoundError, DataFormattingError) as e:
|
|
469
469
|
ut.red_exit(str(e))
|
|
470
470
|
|
|
@@ -504,6 +504,28 @@ def gen_job_func(uargs):
|
|
|
504
504
|
# Use orca file value
|
|
505
505
|
config['mem_per_cpu'] = maxcore
|
|
506
506
|
|
|
507
|
+
# Check if NBO is requested
|
|
508
|
+
if inp.get_nbo(oj.input_file):
|
|
509
|
+
# Check if NBO module has been provided to orto
|
|
510
|
+
try:
|
|
511
|
+
if os.getenv('orto_nbo_load') is not None:
|
|
512
|
+
nbo_module = os.getenv('orto_nbo_load')
|
|
513
|
+
else:
|
|
514
|
+
ut.red_exit(
|
|
515
|
+
'Missing orto_nbo_load environment variable'
|
|
516
|
+
)
|
|
517
|
+
except ValueError:
|
|
518
|
+
ut.red_exit(
|
|
519
|
+
(
|
|
520
|
+
'Missing or malformed orto_nbo_load'
|
|
521
|
+
'environment variable'
|
|
522
|
+
)
|
|
523
|
+
)
|
|
524
|
+
oj.pre_orca += f'module load {nbo_module}\n'
|
|
525
|
+
oj.pre_orca += f'export NBOFIL={oj.input_file.stem}\n'
|
|
526
|
+
else:
|
|
527
|
+
nbo_module = None
|
|
528
|
+
|
|
507
529
|
# Set SLURM error and output file names
|
|
508
530
|
config['error'] = 'slurm.%j.e'
|
|
509
531
|
config['output'] = 'slurm.%j.o'
|
orto/extractor.py
CHANGED
|
@@ -1880,7 +1880,7 @@ class MOInpExtractor(extto.LineExtractor):
|
|
|
1880
1880
|
|
|
1881
1881
|
class XYZInputExtractor(extto.LineExtractor):
|
|
1882
1882
|
'''
|
|
1883
|
-
Extracts
|
|
1883
|
+
Extracts *xyz line of an input file
|
|
1884
1884
|
|
|
1885
1885
|
*xyz charge multiplicity
|
|
1886
1886
|
'''
|
|
@@ -1936,6 +1936,26 @@ class XYZInputExtractor(extto.LineExtractor):
|
|
|
1936
1936
|
return _ext.data
|
|
1937
1937
|
|
|
1938
1938
|
|
|
1939
|
+
class IntInputExtractor(XYZInputExtractor):
|
|
1940
|
+
'''
|
|
1941
|
+
Extracts *int line of an input file
|
|
1942
|
+
|
|
1943
|
+
*int charge multiplicity
|
|
1944
|
+
'''
|
|
1945
|
+
|
|
1946
|
+
# Regex pattern for line
|
|
1947
|
+
PATTERN = rb'\* *int *-?\d+ *\d'
|
|
1948
|
+
|
|
1949
|
+
MODIFIERS = [re.IGNORECASE]
|
|
1950
|
+
|
|
1951
|
+
@property
|
|
1952
|
+
def data(self) -> list[str]:
|
|
1953
|
+
'''
|
|
1954
|
+
*int line, one entry per match
|
|
1955
|
+
'''
|
|
1956
|
+
return self._data
|
|
1957
|
+
|
|
1958
|
+
|
|
1939
1959
|
class MaxCoreInputExtractor(extto.LineExtractor):
|
|
1940
1960
|
'''
|
|
1941
1961
|
Extracts maxcore from input file\n
|
|
@@ -2006,7 +2026,7 @@ class SimpleInputExtractor(extto.LineExtractor):
|
|
|
2006
2026
|
# Regex pattern for line
|
|
2007
2027
|
PATTERN = rb'^ *!.*'
|
|
2008
2028
|
|
|
2009
|
-
MODIFIERS = [re.IGNORECASE]
|
|
2029
|
+
MODIFIERS = [re.IGNORECASE, re.MULTILINE]
|
|
2010
2030
|
|
|
2011
2031
|
@property
|
|
2012
2032
|
def data(self) -> list[str]:
|
orto/input.py
CHANGED
|
@@ -9,6 +9,45 @@ from . import extractor as oe
|
|
|
9
9
|
from . import utils as ut
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
def get_nbo(file_name: str | Path) -> bool:
|
|
13
|
+
'''
|
|
14
|
+
Check if NBO is present in the simple input line.\n
|
|
15
|
+
|
|
16
|
+
Parameters
|
|
17
|
+
----------
|
|
18
|
+
file_name: str | Path
|
|
19
|
+
Orca input file as either name or Path object
|
|
20
|
+
|
|
21
|
+
Returns
|
|
22
|
+
-------
|
|
23
|
+
bool
|
|
24
|
+
True if NBO is present, False otherwise
|
|
25
|
+
'''
|
|
26
|
+
# Check for simple input line beginning with !
|
|
27
|
+
try:
|
|
28
|
+
simple = oe.SimpleInputExtractor.extract(file_name)
|
|
29
|
+
except DataNotFoundError:
|
|
30
|
+
ut.red_exit(
|
|
31
|
+
'Error: Missing simple input line (or !) in input file'
|
|
32
|
+
)
|
|
33
|
+
# Check for NBO in simple input
|
|
34
|
+
nbo_simple = re.findall(
|
|
35
|
+
r'NBO',
|
|
36
|
+
simple[0],
|
|
37
|
+
flags=re.IGNORECASE
|
|
38
|
+
)
|
|
39
|
+
if len(nbo_simple):
|
|
40
|
+
# Set to True if found
|
|
41
|
+
if nbo_simple is None:
|
|
42
|
+
_nbo = True
|
|
43
|
+
else:
|
|
44
|
+
_nbo = True
|
|
45
|
+
else:
|
|
46
|
+
_nbo = False
|
|
47
|
+
|
|
48
|
+
return _nbo
|
|
49
|
+
|
|
50
|
+
|
|
12
51
|
def get_nprocs(file_name: str | Path) -> int:
|
|
13
52
|
'''
|
|
14
53
|
Get the number of processors from the input file.\n
|
|
@@ -124,6 +163,81 @@ def get_maxcore(file_name: str | Path) -> int:
|
|
|
124
163
|
return maxcore
|
|
125
164
|
|
|
126
165
|
|
|
166
|
+
def check_coord(file_name: str | Path, skip_check) -> None:
|
|
167
|
+
'''
|
|
168
|
+
Check *xyz, *xyzfile, or *int line is present in input file.\n
|
|
169
|
+
If xyzfile is given, then also checks if this exists and is formatted \n
|
|
170
|
+
correctly.\n
|
|
171
|
+
|
|
172
|
+
Parameters
|
|
173
|
+
----------
|
|
174
|
+
file_name: str | Path
|
|
175
|
+
Orca input file as either name or Path object
|
|
176
|
+
skip_check: bool
|
|
177
|
+
If True, skip the xyz file check
|
|
178
|
+
|
|
179
|
+
Returns
|
|
180
|
+
-------
|
|
181
|
+
None
|
|
182
|
+
|
|
183
|
+
Raises
|
|
184
|
+
------
|
|
185
|
+
DataNotFoundError
|
|
186
|
+
If neither *xyzfile, *xyz, nor *int are present in the input file
|
|
187
|
+
DataFormattingError
|
|
188
|
+
If xyz file is not formatted correctly
|
|
189
|
+
'''
|
|
190
|
+
|
|
191
|
+
# Get xyz file name and check it exists and is formatted correctly
|
|
192
|
+
try:
|
|
193
|
+
xyz_file = oe.XYZFileInputExtractor.extract(file_name)
|
|
194
|
+
except DataNotFoundError:
|
|
195
|
+
xyz_file = []
|
|
196
|
+
|
|
197
|
+
try:
|
|
198
|
+
xyzline = oe.XYZInputExtractor.extract(file_name)
|
|
199
|
+
except DataNotFoundError:
|
|
200
|
+
xyzline = []
|
|
201
|
+
|
|
202
|
+
try:
|
|
203
|
+
intline = oe.IntInputExtractor.extract(file_name)
|
|
204
|
+
except DataNotFoundError:
|
|
205
|
+
intline = []
|
|
206
|
+
|
|
207
|
+
lens = [len(xyz_file), len(xyzline), len(intline)]
|
|
208
|
+
|
|
209
|
+
if not sum(lens):
|
|
210
|
+
ut.red_exit(
|
|
211
|
+
'Error: missing or incorrect *xyzfile or *xyz line in input'
|
|
212
|
+
)
|
|
213
|
+
elif sum(lens) > 1:
|
|
214
|
+
ut.red_exit(
|
|
215
|
+
(
|
|
216
|
+
'Error: multiple *xyzfile or *xyz lines in input.\n'
|
|
217
|
+
'Only one can be present'
|
|
218
|
+
)
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
if len(xyz_file):
|
|
222
|
+
xyz_file = Path(xyz_file[0])
|
|
223
|
+
if not xyz_file.is_file():
|
|
224
|
+
ut.red_exit(
|
|
225
|
+
'Error: xyz file specified in input cannot be found'
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
if not skip_check:
|
|
229
|
+
try:
|
|
230
|
+
xyzp.check_xyz(
|
|
231
|
+
xyz_file.absolute(),
|
|
232
|
+
allow_indices=False
|
|
233
|
+
)
|
|
234
|
+
except xyzp.XYZError as e:
|
|
235
|
+
raise DataFormattingError(
|
|
236
|
+
f'{e}\n Use -sx to skip this check at your peril'
|
|
237
|
+
)
|
|
238
|
+
return
|
|
239
|
+
|
|
240
|
+
|
|
127
241
|
def check_xyz(file_name: str | Path, skip_check) -> None:
|
|
128
242
|
'''
|
|
129
243
|
Check *xyz or *xyzfile line is present in input file.\n
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: orto
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: A package to make life easier when performing Orca calculations.
|
|
5
5
|
Home-page: https://orto.kragskow.group
|
|
6
6
|
Author: Jon Kragskow
|
|
@@ -15,7 +15,7 @@ Description-Content-Type: text/markdown
|
|
|
15
15
|
Requires-Dist: numpy>=2.1.2
|
|
16
16
|
Requires-Dist: xyz_py>=5.13.1
|
|
17
17
|
Requires-Dist: matplotlib>=3.9.2
|
|
18
|
-
Requires-Dist: extto>=0.
|
|
18
|
+
Requires-Dist: extto>=1.0.0
|
|
19
19
|
Requires-Dist: pandas>=2.2.3
|
|
20
20
|
Requires-Dist: subto>=0.1.1
|
|
21
21
|
Requires-Dist: python-docx>=1.1.2
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
orto/__init__.py,sha256=IedlltYr3qYZxChNUdz62qogXA9Pos_MUvXdGXqAa0E,41
|
|
2
|
+
orto/__version__.py,sha256=b6-WiVk0Li5MaV2rBnHYl104TsouINojSWKqHDas0js,22
|
|
3
|
+
orto/cli.py,sha256=ywJuTP9X_hyD4bEwxU5vVkLDQm4YJGsWaLZ8TFCNxeo,62167
|
|
4
|
+
orto/constants.py,sha256=2obWYg306Lce4U9Qs4MHg1yZq7SHFkazG-cnkD5svpo,343
|
|
5
|
+
orto/exceptions.py,sha256=D7oNeAEGeJNt5thzt6PaCn5FY6JcbJOWUE1N1LVhhuE,159
|
|
6
|
+
orto/extractor.py,sha256=aeZK130lBIERS4Pj1jvTlxCwVB_AhFLUB16zQrDhcbM,67767
|
|
7
|
+
orto/input.py,sha256=N8JbySSVEC_qmXZ7ppJsZ7Z1qel6PfalGYRtnX1hJ6U,9900
|
|
8
|
+
orto/job.py,sha256=SM0nlc_bqhhPvfuuykhMvaUnkwC3Gp-6RvYw_a0TyGc,5855
|
|
9
|
+
orto/plotter.py,sha256=ICrO03T_HGe-H1XKZ2qzsKYdPY44E0PKiXqIQQawd7I,15633
|
|
10
|
+
orto/utils.py,sha256=gVfGplkfc6xGYgLMi_7I_yAdWG-QKRaqQdy9v5F4Mck,7279
|
|
11
|
+
orto-1.1.0.dist-info/METADATA,sha256=TfXaxaTmcxbT1fbq5yQI9r24aV_1g7P0cj4g9mZlxic,1140
|
|
12
|
+
orto-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
orto-1.1.0.dist-info/entry_points.txt,sha256=HXenCglMp_03JkN34pK2phkjXK9CFcXTGHKv5QaVY8I,39
|
|
14
|
+
orto-1.1.0.dist-info/top_level.txt,sha256=hQ-z28gTN_FZ2B5Kiwxr_9cUTcCoib9W5HjbkceDXw4,5
|
|
15
|
+
orto-1.1.0.dist-info/RECORD,,
|
orto-1.0.6.dist-info/RECORD
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
orto/__init__.py,sha256=IedlltYr3qYZxChNUdz62qogXA9Pos_MUvXdGXqAa0E,41
|
|
2
|
-
orto/__version__.py,sha256=iNeZ6LZ9iCV_ugsqAh5K1fFqbKkfU8o3NbLYBWI3m1I,22
|
|
3
|
-
orto/cli.py,sha256=S05ypFp4NEv1ZVaa4xTSz_oTrAeVwpL1rd8qNRviz8A,61349
|
|
4
|
-
orto/constants.py,sha256=2obWYg306Lce4U9Qs4MHg1yZq7SHFkazG-cnkD5svpo,343
|
|
5
|
-
orto/exceptions.py,sha256=D7oNeAEGeJNt5thzt6PaCn5FY6JcbJOWUE1N1LVhhuE,159
|
|
6
|
-
orto/extractor.py,sha256=tO2oFf6Cgwdnh_m1v8r1rXQO2_FL7s-1KBqLPy6zNco,67384
|
|
7
|
-
orto/input.py,sha256=DGWG0IQ_QS9RCm4BlgFPyt4_WW6Tz9k2Mybwd1O9SJo,7003
|
|
8
|
-
orto/job.py,sha256=SM0nlc_bqhhPvfuuykhMvaUnkwC3Gp-6RvYw_a0TyGc,5855
|
|
9
|
-
orto/plotter.py,sha256=ICrO03T_HGe-H1XKZ2qzsKYdPY44E0PKiXqIQQawd7I,15633
|
|
10
|
-
orto/utils.py,sha256=gVfGplkfc6xGYgLMi_7I_yAdWG-QKRaqQdy9v5F4Mck,7279
|
|
11
|
-
orto-1.0.6.dist-info/METADATA,sha256=CxH6biskRO90R3ezsXOGAQiViTuYV0uRWnoTQ6PrnYw,1140
|
|
12
|
-
orto-1.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
-
orto-1.0.6.dist-info/entry_points.txt,sha256=HXenCglMp_03JkN34pK2phkjXK9CFcXTGHKv5QaVY8I,39
|
|
14
|
-
orto-1.0.6.dist-info/top_level.txt,sha256=hQ-z28gTN_FZ2B5Kiwxr_9cUTcCoib9W5HjbkceDXw4,5
|
|
15
|
-
orto-1.0.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|