-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmv_all_mp2.py
executable file
·36 lines (32 loc) · 1.18 KB
/
mv_all_mp2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/home/mdi0316/anaconda3/bin/python
import os, shutil
with open('all_mp2s', 'r') as a:
lines = a.readlines()
for l in lines:
if len(l.strip().split('/')) == 13:
try:
folder = '/'.join( l.strip().split('/')[1:-1] )
folder = os.path.join( '/data/mdi0316/WORK', folder )
dimer = l.strip().split('/')[2]
opt_from = l.strip().split('/')[6]
basis = l.strip().split('/')[8]
T = l.strip().split('/')[9]
P = l.strip().split('/')[10]
R = l.strip().split('/')[11]
name = l.strip().split('/')[12]
label = 'gms_SCAN_{}_ENE_MP2_{}_{}_{}_{}'.format( dimer.lower(), basis, T, P, R )
if name.startswith('log'):
slurm_id = name.split('_')[-1]
new_name = 'log.{}_{}'.format(label, slurm_id)
else:
if name.endswith('inp'):
new_name = '{}.inp'.format(label)
elif name.endswith('dat'):
new_name = '{}.dat'.format(label)
else:
print( explosion )
os.chdir( folder )
shutil.move( name, new_name )
except( FileNotFoundError ):
print( folder )
print( name )