-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfill.py
36 lines (32 loc) · 1020 Bytes
/
fill.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
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE','materialsweb2.settings')
import django
django.setup()
from simulation import *
from simulation.analysis.vasp.calculation import Calculation
import os
from materialsweb2.settings import BASE_DIR
a=os.walk(BASE_DIR+'/static/database/MAX_phases/')
for b in a:
if len(b[1])==0:
path = b[0]
try:
print(path)
calc = Calculation().read(path)
calc.create_all(path)
calc.save()
except:
print(path)
'''
for b in a:
c=b[0].split('/')
if c[-1] != 'pbe_bands' and c[-1] != 'hse_bands':
path = '/var/www/materialsweb/static/database/MAX_phases/all_competitors/'+c[-1]
try:
calc = Calculation().read(path)
calc.create_all(path)
calc.save()
#print('Path: '+path)
except:
print(path+'')
'''