orto 1.0.2__py3-none-any.whl → 1.0.4__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/__init__.py +1 -2
- orto/__version__.py +1 -1
- orto/input.py +30 -29
- {orto-1.0.2.dist-info → orto-1.0.4.dist-info}/METADATA +1 -1
- {orto-1.0.2.dist-info → orto-1.0.4.dist-info}/RECORD +8 -8
- {orto-1.0.2.dist-info → orto-1.0.4.dist-info}/WHEEL +0 -0
- {orto-1.0.2.dist-info → orto-1.0.4.dist-info}/entry_points.txt +0 -0
- {orto-1.0.2.dist-info → orto-1.0.4.dist-info}/top_level.txt +0 -0
orto/__init__.py
CHANGED
orto/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '1.0.
|
|
1
|
+
__version__ = '1.0.4'
|
orto/input.py
CHANGED
|
@@ -4,6 +4,7 @@ import numpy as np
|
|
|
4
4
|
import copy
|
|
5
5
|
import xyz_py as xyzp
|
|
6
6
|
|
|
7
|
+
from .exceptions import DataNotFoundError, DataFormattingError
|
|
7
8
|
from . import extractor as oe
|
|
8
9
|
from . import utils as ut
|
|
9
10
|
|
|
@@ -25,20 +26,20 @@ def get_nprocs(file_name: str | Path) -> int:
|
|
|
25
26
|
|
|
26
27
|
Raises
|
|
27
28
|
------
|
|
28
|
-
|
|
29
|
+
DataNotFoundError
|
|
29
30
|
If neither the PAL nor NProcs keyword is present in the input file
|
|
30
|
-
|
|
31
|
+
DataFormattingError
|
|
31
32
|
If both PAL and NProcs are present in the input file
|
|
32
|
-
|
|
33
|
+
DataFormattingError
|
|
33
34
|
If the PAL keyword is not a power of 2
|
|
34
|
-
|
|
35
|
+
DataFormattingError
|
|
35
36
|
If the %PAL block is malformed
|
|
36
37
|
'''
|
|
37
38
|
|
|
38
39
|
# Check for simple input line beginning with !
|
|
39
40
|
try:
|
|
40
41
|
simple = oe.SimpleInputExtractor.extract(file_name)
|
|
41
|
-
except
|
|
42
|
+
except DataNotFoundError:
|
|
42
43
|
ut.red_exit(
|
|
43
44
|
'Error: Missing simple input line (or !) in input file'
|
|
44
45
|
)
|
|
@@ -66,22 +67,22 @@ def get_nprocs(file_name: str | Path) -> int:
|
|
|
66
67
|
# Check for %PAL block in input file
|
|
67
68
|
try:
|
|
68
69
|
n_procs = oe.NProcsInputExtractor.extract(file_name)[0]
|
|
69
|
-
except
|
|
70
|
+
except DataNotFoundError:
|
|
70
71
|
if _palprocs:
|
|
71
72
|
n_procs = copy.copy(_palprocs)
|
|
72
73
|
_palprocs = 0
|
|
73
74
|
else:
|
|
74
|
-
raise
|
|
75
|
+
raise DataNotFoundError(
|
|
75
76
|
f'Missing number of processors in {file_name}\n'
|
|
76
77
|
'e.g. %pal nprocs 16 end'
|
|
77
78
|
)
|
|
78
|
-
except
|
|
79
|
-
raise
|
|
79
|
+
except DataFormattingError:
|
|
80
|
+
raise DataFormattingError(
|
|
80
81
|
f'%PAL block is malformed, perhaps missing END?\n in {file_name}'
|
|
81
82
|
)
|
|
82
83
|
|
|
83
84
|
if n_procs and _palprocs:
|
|
84
|
-
raise
|
|
85
|
+
raise DataFormattingError(
|
|
85
86
|
'Error: Both PAL and NProcs found in input file\n'
|
|
86
87
|
f'PAL: {_palprocs}, NProcs: {n_procs}'
|
|
87
88
|
)
|
|
@@ -107,15 +108,15 @@ def get_maxcore(file_name: str | Path) -> int:
|
|
|
107
108
|
|
|
108
109
|
Raises
|
|
109
110
|
------
|
|
110
|
-
|
|
111
|
+
DataNotFoundError
|
|
111
112
|
If %maxcore is not present in the input file
|
|
112
113
|
'''
|
|
113
114
|
|
|
114
115
|
# Load max core memory from input file
|
|
115
116
|
try:
|
|
116
117
|
maxcore = oe.MaxCoreInputExtractor.extract(file_name)[0]
|
|
117
|
-
except
|
|
118
|
-
raise
|
|
118
|
+
except DataNotFoundError:
|
|
119
|
+
raise DataNotFoundError(
|
|
119
120
|
f'Missing max core memory in {file_name}\n'
|
|
120
121
|
'e.g. %maxcore 3000'
|
|
121
122
|
)
|
|
@@ -142,21 +143,21 @@ def check_xyz(file_name: str | Path, skip_check) -> None:
|
|
|
142
143
|
|
|
143
144
|
Raises
|
|
144
145
|
------
|
|
145
|
-
|
|
146
|
+
DataNotFoundError
|
|
146
147
|
If neither *xyzfile nor *xyz are present in the input file
|
|
147
|
-
|
|
148
|
+
DataFormattingError
|
|
148
149
|
If xyz file is not formatted correctly
|
|
149
150
|
'''
|
|
150
151
|
|
|
151
152
|
# Get xyz file name and check it exists and is formatted correctly
|
|
152
153
|
try:
|
|
153
154
|
xyz_file = oe.XYZFileInputExtractor.extract(file_name)
|
|
154
|
-
except
|
|
155
|
+
except DataNotFoundError:
|
|
155
156
|
xyz_file = []
|
|
156
157
|
|
|
157
158
|
try:
|
|
158
159
|
xyzline = oe.XYZInputExtractor.extract(file_name)
|
|
159
|
-
except
|
|
160
|
+
except DataNotFoundError:
|
|
160
161
|
xyzline = []
|
|
161
162
|
|
|
162
163
|
if not len(xyz_file) and not len(xyzline):
|
|
@@ -183,7 +184,7 @@ def check_xyz(file_name: str | Path, skip_check) -> None:
|
|
|
183
184
|
allow_indices=False
|
|
184
185
|
)
|
|
185
186
|
except xyzp.XYZError as e:
|
|
186
|
-
raise
|
|
187
|
+
raise DataFormattingError(
|
|
187
188
|
f'{e}\n Use -sx to skip this check at your peril'
|
|
188
189
|
)
|
|
189
190
|
return
|
|
@@ -207,31 +208,31 @@ def check_moinp_moread(file_name: str | Path) -> None:
|
|
|
207
208
|
|
|
208
209
|
Raises
|
|
209
210
|
------
|
|
210
|
-
|
|
211
|
+
DataNotFoundError
|
|
211
212
|
If only one of MORead and MOInp are present in the input file
|
|
212
|
-
|
|
213
|
+
DataFormattingError
|
|
213
214
|
If the stem of the input file and MOInp file are the same
|
|
214
|
-
|
|
215
|
+
DataNotFoundError
|
|
215
216
|
If the MOInp file cannot be found
|
|
216
|
-
|
|
217
|
+
DataFormattingError
|
|
217
218
|
If the MOInp file has no extension
|
|
218
219
|
'''
|
|
219
220
|
|
|
220
221
|
# Check if MORead and/or MOInp are present
|
|
221
222
|
try:
|
|
222
223
|
moread = oe.MOReadExtractor.extract(file_name)
|
|
223
|
-
except
|
|
224
|
+
except DataNotFoundError:
|
|
224
225
|
moread = []
|
|
225
226
|
try:
|
|
226
227
|
moinp = oe.MOInpExtractor.extract(file_name)
|
|
227
|
-
except
|
|
228
|
+
except DataNotFoundError:
|
|
228
229
|
moinp = []
|
|
229
230
|
|
|
230
231
|
# Error if only one word present or if more than one of each word
|
|
231
232
|
if len(moinp) ^ len(moread):
|
|
232
|
-
raise
|
|
233
|
+
raise DataFormattingError('Error: Missing one of MOInp or MORead')
|
|
233
234
|
if len(moinp) + len(moread) > 2:
|
|
234
|
-
raise
|
|
235
|
+
raise DataFormattingError(
|
|
235
236
|
'Error: Multiple MORead and/or MOInp detected'
|
|
236
237
|
)
|
|
237
238
|
|
|
@@ -239,17 +240,17 @@ def check_moinp_moread(file_name: str | Path) -> None:
|
|
|
239
240
|
# Error if input orbitals have same stem as input file
|
|
240
241
|
moinp = Path(moinp[0])
|
|
241
242
|
if moinp.stem == file_name.stem:
|
|
242
|
-
raise
|
|
243
|
+
raise DataFormattingError(
|
|
243
244
|
'Error: Stem of orbital and input files cannot match'
|
|
244
245
|
)
|
|
245
246
|
|
|
246
247
|
# Error if cannot find orbital file
|
|
247
248
|
if not moinp.suffix:
|
|
248
|
-
raise
|
|
249
|
+
raise DataFormattingError(
|
|
249
250
|
f'Error: Orbital file {moinp} has no extension'
|
|
250
251
|
)
|
|
251
252
|
if not moinp.exists():
|
|
252
|
-
raise
|
|
253
|
+
raise DataFormattingError(
|
|
253
254
|
f'Error: Orbital file {moinp} cannot be found'
|
|
254
255
|
)
|
|
255
256
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
orto/__init__.py,sha256=
|
|
2
|
-
orto/__version__.py,sha256=
|
|
1
|
+
orto/__init__.py,sha256=IedlltYr3qYZxChNUdz62qogXA9Pos_MUvXdGXqAa0E,41
|
|
2
|
+
orto/__version__.py,sha256=thGZHY6pLPhJc6CwYBjUaQ6pGxLhwPMp_pjoYsiwvI4,22
|
|
3
3
|
orto/cli.py,sha256=yckaw1kryADOWz-NZPzXpXYTp8L9X89TVqUErfg3RsY,61241
|
|
4
4
|
orto/constants.py,sha256=2obWYg306Lce4U9Qs4MHg1yZq7SHFkazG-cnkD5svpo,343
|
|
5
5
|
orto/exceptions.py,sha256=D7oNeAEGeJNt5thzt6PaCn5FY6JcbJOWUE1N1LVhhuE,159
|
|
6
6
|
orto/extractor.py,sha256=tO2oFf6Cgwdnh_m1v8r1rXQO2_FL7s-1KBqLPy6zNco,67384
|
|
7
|
-
orto/input.py,sha256=
|
|
7
|
+
orto/input.py,sha256=cVhApyjCbqIDA0uRGqmt3UwKEn7djPjSWob70Ghg9fw,7060
|
|
8
8
|
orto/job.py,sha256=SM0nlc_bqhhPvfuuykhMvaUnkwC3Gp-6RvYw_a0TyGc,5855
|
|
9
9
|
orto/plotter.py,sha256=ICrO03T_HGe-H1XKZ2qzsKYdPY44E0PKiXqIQQawd7I,15633
|
|
10
10
|
orto/utils.py,sha256=gVfGplkfc6xGYgLMi_7I_yAdWG-QKRaqQdy9v5F4Mck,7279
|
|
11
|
-
orto-1.0.
|
|
12
|
-
orto-1.0.
|
|
13
|
-
orto-1.0.
|
|
14
|
-
orto-1.0.
|
|
15
|
-
orto-1.0.
|
|
11
|
+
orto-1.0.4.dist-info/METADATA,sha256=lluzNRekjQpJx9bJr2Nly8UmDOdaYEzB63p-BVS53u8,1140
|
|
12
|
+
orto-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
orto-1.0.4.dist-info/entry_points.txt,sha256=HXenCglMp_03JkN34pK2phkjXK9CFcXTGHKv5QaVY8I,39
|
|
14
|
+
orto-1.0.4.dist-info/top_level.txt,sha256=hQ-z28gTN_FZ2B5Kiwxr_9cUTcCoib9W5HjbkceDXw4,5
|
|
15
|
+
orto-1.0.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|