Révision a7128ce1
b/modules/dos_input.py | ||
---|---|---|
67 | 67 |
|
68 | 68 |
|
69 | 69 |
def str2lst(cmplx_str, func=int): # TODO: enable deeper level of nested lists |
70 |
# TODO Treat all-enclosing parenthesis as a list instead of list of lists. |
|
70 | 71 |
"""Converts a string of integers, and groups of them, to a list. |
71 | 72 |
|
72 | 73 |
Keyword arguments: |
... | ... | |
85 | 86 |
""" |
86 | 87 |
|
87 | 88 |
# Checks |
88 |
error_msg = "Function argument should be a str,sequence of integer " \ |
|
89 |
error_msg = "Function argument should be a str, sequence of integer " \
|
|
89 | 90 |
"numbers separated by ',' ';' or ' '." \ |
90 | 91 |
"\nThey can be grouped in parentheses-like enclosers: '()', " \ |
91 | 92 |
"'[]' or {}. Nested groups are not allowed. \n" \ |
... | ... | |
159 | 160 |
[(UnboundLocalError, "Invalid CP2K input file")], inp_file) |
160 | 161 |
|
161 | 162 |
|
163 |
# Global |
|
164 |
|
|
162 | 165 |
def get_run_type(): |
163 | 166 |
isolated, screening, refinement = (False, False, False) |
164 | 167 |
run_type_vals = ['isolated', 'screening', 'refinement', 'adsorption', |
... | ... | |
274 | 277 |
return special_atoms |
275 | 278 |
|
276 | 279 |
|
280 |
# Isolated |
|
281 |
|
|
277 | 282 |
def get_isol_inp_file(): |
278 | 283 |
isol_inp_file = dos_inp.get('Isolated', 'isol_inp_file') |
279 | 284 |
if not os.path.isfile(isol_inp_file): |
... | ... | |
328 | 333 |
return min_confs |
329 | 334 |
|
330 | 335 |
|
336 |
# Screening |
|
337 |
|
|
331 | 338 |
def get_screen_inp_file(): |
332 | 339 |
screen_inp_file = dos_inp.get('Screening', 'screen_inp_file') |
333 | 340 |
if not os.path.isfile(screen_inp_file): |
... | ... | |
527 | 534 |
return try_disso |
528 | 535 |
|
529 | 536 |
|
530 |
def get_refine_inp_file(): |
|
537 |
# Refinement |
|
538 |
|
|
539 |
def get_refine_inp_file(): # TODO if not specified try isol_inp_file. |
|
531 | 540 |
refine_inp_file = dos_inp.get('Refinement', 'refine_inp_file') |
532 | 541 |
if not os.path.isfile(refine_inp_file): |
533 | 542 |
logger.error(f'File {refine_inp_file} not found') |
Formats disponibles : Unified diff