Skip to content
This repository was archived by the owner on Aug 16, 2022. It is now read-only.

Commit 486e7b1

Browse files
committed
apps reconsiderations
1 parent 39424a4 commit 486e7b1

File tree

6 files changed

+48
-56
lines changed

6 files changed

+48
-56
lines changed

tilde/apps/N/N.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

tilde/apps/N/__init__.py

Whitespace-only changes.

tilde/apps/mulliken/__init__.py

Whitespace-only changes.

tilde/apps/mulliken/manifest.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

tilde/apps/mulliken/mulliken.py

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
'''
2+
An example of using Tilting module with ASE
3+
'''
4+
5+
from ase.lattice.spacegroup import crystal
6+
7+
import set_path
8+
from tilde.core.settings import settings
9+
from tilde.core.api import API
10+
from tilde.parsers import Output
11+
12+
13+
crystal_obj = crystal(
14+
('Sr', 'Ti', 'O', 'O'),
15+
basis=[(0, 0.5, 0.25), (0, 0, 0), (0, 0, 0.25), (0.255, 0.755, 0)],
16+
spacegroup=140, cellpar=[5.511, 5.511, 7.796, 90, 90, 90],
17+
primitive_cell=True
18+
)
19+
20+
settings['skip_unfinished'], settings['skip_notenergy'] = False, False
21+
work = API(settings)
22+
23+
searched_category = (8, 'perovskite') # defined in /init-data.sql
24+
searched_category_id = None # defined in hierarchy
25+
found = False
26+
for cid, series in work.hierarchy_values.iteritems():
27+
if found: break
28+
elif cid == searched_category[0]:
29+
for num, name in series.iteritems():
30+
if name == searched_category[1]:
31+
found, searched_category_id = True, num
32+
break
33+
else: raise RuntimeError("Cannot determine the category id in the hierarchy!")
34+
35+
virtual_calc = Output() # we always consider "calculation" while using tilde
36+
virtual_calc.structures = [ crystal_obj ]
37+
virtual_calc, error = work.classify(virtual_calc)
38+
if error:
39+
raise RuntimeError(error)
40+
41+
virtual_calc = work.postprocess(virtual_calc)
42+
is_perovskite = searched_category_id in virtual_calc.info['tags']
43+
44+
print "Object:", virtual_calc.info['standard']
45+
print "Is perovskite?", is_perovskite
46+
if is_perovskite:
47+
print virtual_calc.apps
48+
#print "Extracted tilting is:", virtual_calc.apps['perovskite_tilting']['data']

0 commit comments

Comments
 (0)