Révision dbef6e98
b/dockonsurf.py | ||
---|---|---|
18 | 18 |
|
19 | 19 |
print("Running DockOnSurf.\n" |
20 | 20 |
f"To check DockOnSurf activity see '{logger.handlers[0].baseFilename}'.\n" |
21 |
f"To kill DockOnSurf execution type: `$ kill {os.getpid()}`.")
|
|
21 |
f"To stop DockOnSurf execution type: `$ kill {os.getpid()}`.")
|
|
22 | 22 |
|
23 | 23 |
with daemon.DaemonContext(working_directory=os.getcwd(), umask=0o002, |
24 | 24 |
files_preserve=[logger.handlers[0].stream.fileno()]): |
b/modules/calculation.py | ||
---|---|---|
5 | 5 |
|
6 | 6 |
|
7 | 7 |
def check_finished_calcs(run_type, code): |
8 |
from modules.utilities import _human_key |
|
8 | 9 |
"""Returns two lists of calculations finished normally and abnormally. |
9 | 10 |
|
10 | 11 |
@param run_type: The type of calculation to check. |
... | ... | |
18 | 19 |
|
19 | 20 |
finished_calcs = [] |
20 | 21 |
unfinished_calcs = [] |
21 |
for conf in os.listdir(run_type):
|
|
22 |
for conf in sorted(os.listdir(run_type), key=_human_key):
|
|
22 | 23 |
if not os.path.isdir(f'{run_type}/{conf}') or 'conf_' not in conf: |
23 | 24 |
continue |
24 | 25 |
if code == 'cp2k': |
b/modules/utilities.py | ||
---|---|---|
80 | 80 |
finally: |
81 | 81 |
if isinstance(err, BaseException): |
82 | 82 |
raise err |
83 |
|
|
84 |
|
|
85 |
def _human_key(key): |
|
86 |
import re |
|
87 |
parts = re.split('(\d*\.\d+|\d+)', key) |
|
88 |
return tuple((e.swapcase() if i % 2 == 0 else float(e)) |
|
89 |
for i, e in enumerate(parts)) |
Formats disponibles : Unified diff