orto 1.0.2__tar.gz → 1.0.4__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orto
3
- Version: 1.0.2
3
+ Version: 1.0.4
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
@@ -1,4 +1,3 @@
1
- from orto.cli import *
2
1
  """
3
2
  orto is a package for using Orca
4
- """
3
+ """
@@ -0,0 +1 @@
1
+ __version__ = '1.0.4'
@@ -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
- oe.DataNotFoundError
29
+ DataNotFoundError
29
30
  If neither the PAL nor NProcs keyword is present in the input file
30
- oe.DataFormattingError
31
+ DataFormattingError
31
32
  If both PAL and NProcs are present in the input file
32
- oe.DataFormattingError
33
+ DataFormattingError
33
34
  If the PAL keyword is not a power of 2
34
- oe.DataFormattingError
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 oe.DataNotFoundError:
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 oe.DataNotFoundError:
70
+ except DataNotFoundError:
70
71
  if _palprocs:
71
72
  n_procs = copy.copy(_palprocs)
72
73
  _palprocs = 0
73
74
  else:
74
- raise oe.DataNotFoundError(
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 oe.DataFormattingError:
79
- raise oe.DataFormattingError(
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 oe.DataFormattingError(
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
- oe.DataNotFoundError
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 oe.DataNotFoundError:
118
- raise oe.DataNotFoundError(
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
- oe.DataNotFoundError
146
+ DataNotFoundError
146
147
  If neither *xyzfile nor *xyz are present in the input file
147
- oe.DataFormattingError
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 oe.DataNotFoundError:
155
+ except DataNotFoundError:
155
156
  xyz_file = []
156
157
 
157
158
  try:
158
159
  xyzline = oe.XYZInputExtractor.extract(file_name)
159
- except oe.DataNotFoundError:
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 oe.DataFormattingError(
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
- oe.DataNotFoundError
211
+ DataNotFoundError
211
212
  If only one of MORead and MOInp are present in the input file
212
- oe.DataFormattingError
213
+ DataFormattingError
213
214
  If the stem of the input file and MOInp file are the same
214
- oe.DataNotFoundError
215
+ DataNotFoundError
215
216
  If the MOInp file cannot be found
216
- oe.DataFormattingError
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 oe.DataNotFoundError:
224
+ except DataNotFoundError:
224
225
  moread = []
225
226
  try:
226
227
  moinp = oe.MOInpExtractor.extract(file_name)
227
- except oe.DataNotFoundError:
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 oe.DataFormattingError('Error: Missing one of MOInp or MORead')
233
+ raise DataFormattingError('Error: Missing one of MOInp or MORead')
233
234
  if len(moinp) + len(moread) > 2:
234
- raise oe.DataFormattingError(
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 oe.DataFormattingError(
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 oe.DataFormattingError(
249
+ raise DataFormattingError(
249
250
  f'Error: Orbital file {moinp} has no extension'
250
251
  )
251
252
  if not moinp.exists():
252
- raise oe.DataFormattingError(
253
+ raise DataFormattingError(
253
254
  f'Error: Orbital file {moinp} cannot be found'
254
255
  )
255
256
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orto
3
- Version: 1.0.2
3
+ Version: 1.0.4
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
@@ -8,7 +8,7 @@ Please see the `orto` documentation for more details.
8
8
 
9
9
  # DO NOT EDIT THIS NUMBER!
10
10
  # IT IS AUTOMATICALLY CHANGED BY python-semantic-release
11
- __version__ = '1.0.2'
11
+ __version__ = '1.0.4'
12
12
 
13
13
  setuptools.setup(
14
14
  name='orto',
@@ -1 +0,0 @@
1
- __version__ = '1.0.2'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes