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

Commit e543ad8

Browse files
committed
fix #46, #47, #49
1 parent 486e7b1 commit e543ad8

18 files changed

+180
-108
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Tilde
22
==========
33
[![DOI](https://zenodo.org/badge/18811/tilde-lab/tilde.svg)](https://zenodo.org/badge/latestdoi/18811/tilde-lab/tilde)
44

5-
Tilde is an intelligent data organizer and Python framework for computational (**ab initio**) materials science. Tilde creates systemized repositories from the simulation logs of [VASP](http://www.vasp.at), [CRYSTAL](http://www.crystal.unito.it) and [Quantum ESPRESSO](http://www.quantum-espresso.org) packages. The folders with the log files can be scanned and the results added into a repository. Repository GUI is coming.
5+
Tilde is an intelligent data organizer and Python framework for computational (**ab initio**) materials science. Tilde creates systemized data repositories from the simulation logs of [VASP](http://www.vasp.at), [CRYSTAL](http://www.crystal.unito.it) and [Quantum ESPRESSO](http://www.quantum-espresso.org) packages. The folders with the log files can be scanned and the results added into a repository. Web-based repository GUI is [available](https://github.com/tilde-lab/berlinium).
66

77
## Installation
88

@@ -27,6 +27,8 @@ Then test if the framework is ready:
2727
./utils/tilde.sh -x
2828
```
2929

30+
Additionally, installation is covered in [this blog post](https://blog.tilde.pro/simple-ab-initio-materials-data-mining-tutorial-6127c777dabc).
31+
3032
## Usage
3133

3234
```shell
@@ -39,10 +41,10 @@ For example, to scan folder(s) recursively (-r), with terse print (-t), showing
3941
./utils/tilde.sh /home/user/work1 /home/work2 -r -t -v -a
4042
```
4143

42-
Other example: for the perovskite structures, extract the distortion of the MO6-octahedra wrt cubic phase (in Euler angles) and detailed calculation info:
44+
Other example: for the perovskite structures (shipped with Tilde), extract the distortion of the MO6-octahedra wrt cubic phase (in Euler angles) and detailed calculation info:
4345

4446
```shell
45-
./utils/tilde.sh tilde/apps/perovskite_tilting/tests/outputs -m perovskite_tilting -i
47+
./utils/tilde.sh tilde/tests/apps/perovskite_tilting/outputs -m perovskite_tilting -i
4648
```
4749

4850
## GUI
@@ -70,25 +72,26 @@ sh tests/run_tests.sh
7072
Other known similar initiatives are listed below:
7173

7274
- Accelrys (BIOVIA) Pipeline Pilot and Materials Studio, http://accelrys.com/products
73-
- ADMIRAL framework: Advanced Data-Mining for Improved Research And Learning, Trinity College, Dublin
7475
- AFLOW framework and Aflowlib repository, http://www.aflowlib.org
7576
- AiiDA: Automated Infrastructure and Database for Ab-initio design, Bosch LLC (**Python**), http://aiida.net
7677
- Automated Topology Builder (ATB), http://compbio.biosci.uq.edu.au/atb
7778
- Blue Obelisk Data Repository (**XSLT, XML**), http://bodr.sourceforge.net
7879
- Catapp, http://www.slac.stanford.edu/~strabo/catapp
7980
- CCLib (**Python**), http://cclib.sf.net
80-
- CDF (**Python**), http://kitchingroup.cheme.cmu.edu/cdf
81+
- cctbx: Computational Crystallography Toolbox, http://cctbx.sourceforge.net
8182
- CEPDB: Harvard Clean Energy Project and distributed volunteer computing, http://cepdb.molecularspace.org
8283
- CMR (**Python**), https://wiki.fysik.dtu.dk/cmr
8384
- Computational Chemistry Comparison and Benchmark Database, http://cccbdb.nist.gov
84-
- cctbx: Computational Crystallography Toolbox, http://cctbx.sourceforge.net
85+
- Crystallography Open Database (including Theoretical Database
8586
- Delta project: Comparing Solid State DFT Codes, http://molmod.ugent.be/deltacodesdft
8687
- Electronic Structure Project, http://gurka.fysik.uu.se/ESP
8788
- ESTEST (**Python, XQuery**), http://estest.ucdavis.edu
89+
- Exabyte.io, Materials Discover Cloud, http://exabyte.io
8890
- J-ICE (based on **Jmol, Java**), http://j-ice.sourceforge.net
8991
- ioChem-BD (**Java**), http://www.iochem-bd.org
9092
- Materials Project (**Python**), http://www.materialsproject.org
91-
- MatNavi Materials Database, Materials Information Station, Tsukuba, http://caldb.nims.go.jp/CALDB/
93+
- MatNavi and AtomWork Materials Databases, Materials Information Station, Tsukuba, http://mits.nims.go.jp/matnavi/
94+
- MedeA Computational environment, http://www.materialsdesign.com/medea
9295
- MSE: Test Set for Materials Science and Engineering, http://mse.fhi-berlin.mpg.de
9396
- NoMaD: Novel Materials Discovery, http://nomad-repository.eu
9497
- NREL MatDB, http://materials.nrel.gov
@@ -99,7 +102,6 @@ Other known similar initiatives are listed below:
99102
- pyCMW (**Python**), a framework of Max Planck Institute for Iron Research GmbH
100103
- QMForge (**Python**), http://qmforge.sourceforge.net
101104
- Quixote, http://quixote.wikispot.org
102-
- Scipio (**Java**), currently inactive, https://scipio.iciq.es
103105
- WebMO: Web-based interface to computational chemistry packages (Java, Perl), http://webmo.net
104106
- WURM: database of computed physical properties of minerals, http://wurm.info
105107

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ bcrypt
33
nose
44
importlib
55
pg8000
6-
sqlalchemy
6+
sqlalchemy==1.0.12
77
argparse
8-
ase
8+
ase==3.10.0
99
-e "git+https://github.com/atztogo/spglib.git@91e8a317ab7e2da8e0d8546b31f40277e697b153#egg=spglib&subdirectory=python"
10-
tornado
10+
tornado==4.3.0
1111
sockjs-tornado
1212
websocket-client
1313
futures
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
'''
2+
An example of using Tilting module with ASE
3+
'''
4+
5+
import unittest
6+
7+
from ase.lattice.spacegroup import crystal
8+
9+
import set_path
10+
from tilde.core.settings import settings
11+
from tilde.core.api import API
12+
from tilde.parsers import Output
13+
14+
15+
crystal_obj = crystal(
16+
('Sr', 'Ti', 'O', 'O'),
17+
basis=[(0, 0.5, 0.25), (0, 0, 0), (0, 0, 0.25), (0.255, 0.755, 0)],
18+
spacegroup=140, cellpar=[5.511, 5.511, 7.796, 90, 90, 90],
19+
primitive_cell=True
20+
)
21+
22+
settings['skip_unfinished'], settings['skip_notenergy'] = False, False
23+
work = API(settings)
24+
25+
virtual_calc = Output() # we always consider "calculation" while using tilde
26+
virtual_calc.structures = [ crystal_obj ]
27+
virtual_calc, error = work.classify(virtual_calc)
28+
if error:
29+
raise RuntimeError(error)
30+
31+
virtual_calc = work.postprocess(virtual_calc)
32+
target_category_num = 4 # perovskite category, pre-defined in /init-data.sql
33+
is_perovskite = target_category_num in virtual_calc.info['tags']
34+
35+
36+
class ASE_Perovskite_Tilting_Test(unittest.TestCase):
37+
def test_if_perovskite(self):
38+
self.assertTrue(is_perovskite)
39+
40+
def test_tilting(self):
41+
self.assertEqual(
42+
virtual_calc.apps['perovskite_tilting']['data'],
43+
{4: [0.0, 0.0, 1.15]}
44+
)
45+
46+
def test_errors(self):
47+
self.assertFalse(virtual_calc.apps['perovskite_tilting']['error'])
48+
49+
50+
if __name__ == "__main__":
51+
print "Object:", virtual_calc.info['standard']
52+
print "Is perovskite?", is_perovskite
53+
54+
assert is_perovskite
55+
56+
print virtual_calc.apps['perovskite_tilting']['data']
57+
58+
assert virtual_calc.apps['perovskite_tilting']['data'] == {4: [0.0, 0.0, 1.15]}

tilde/apps/perovskite_tilting/tests/outputs/5ti_d_x2_scanned_freqs.cryst.out renamed to tests/apps/perovskite_tilting/outputs/5ti_d_x2_scanned_freqs.cryst.out

File renamed without changes.

tilde/apps/perovskite_tilting/tests/outputs/check_last_point.cryst.out renamed to tests/apps/perovskite_tilting/outputs/check_last_point.cryst.out

File renamed without changes.

tilde/apps/perovskite_tilting/tests/outputs/srhfo3_62_pbe0_110_9sr_go.cryst.out renamed to tests/apps/perovskite_tilting/outputs/srhfo3_62_pbe0_110_9sr_go.cryst.out

File renamed without changes.

tilde/apps/perovskite_tilting/tests/outputs/sto140afd_f3.cryst.out renamed to tests/apps/perovskite_tilting/outputs/sto140afd_f3.cryst.out

File renamed without changes.

tilde/apps/perovskite_tilting/tests/outputs/y4h4srhfo3_62_pbe0_9hf_cis_go.cryst.out renamed to tests/apps/perovskite_tilting/outputs/y4h4srhfo3_62_pbe0_9hf_cis_go.cryst.out

File renamed without changes.

tilde/apps/perovskite_tilting/tests/set_path.py renamed to tests/apps/perovskite_tilting/set_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
base_path = os.path.realpath(os.path.normpath(os.path.join(
44
os.path.dirname(os.path.abspath(__file__)),
5-
"../../../../")))
5+
"../../../")))
66

77
if not base_path in sys.path:
88
sys.path.insert(0, base_path)

tilde/apps/perovskite_tilting/tests/tilt_data.py renamed to tests/apps/perovskite_tilting/tilt_data.py

Lines changed: 54 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
[4] PRB88, 241407 (2013), http://dx.doi.org/10.1103/PhysRevB.88.241407
1111
"""
1212

13-
import os, sys
13+
import os
14+
import unittest
1415

1516
import set_path
1617
from tilde.core.api import API
@@ -54,26 +55,59 @@
5455
}
5556
}
5657

57-
58-
work = API()
59-
print 'Perovskite tilting module test:'
6058
for k, v in test_data.iteritems():
6159
if not os.path.exists(data_dir + os.sep + k):
6260
raise RuntimeError(k + ': missed file for test!')
63-
for calc, error in work.parse(data_dir + os.sep + k):
64-
if error:
65-
raise RuntimeError(k + ': ' + error)
66-
calc, error = work.classify(calc)
67-
if error:
68-
raise RuntimeError(k + ': ' + error)
69-
calc = work.postprocess(calc)
70-
if not 'perovskite_tilting' in calc.apps:
71-
raise RuntimeError(k + ': invalid result!')
72-
print "\nSource", v['comment'], "(" + k + ")"
73-
for corner in v['data'].keys():
74-
if not corner in calc.apps['perovskite_tilting']['data']:
61+
62+
work = API()
63+
64+
class Data_Perovskite_Tilting_Test(unittest.TestCase):
65+
@classmethod
66+
def setUpClass(cls):
67+
68+
cls.results = {}
69+
70+
for k, v in test_data.iteritems():
71+
cls.results[k] = {}
72+
for calc, error in work.parse(data_dir + os.sep + k):
73+
if error:
74+
raise RuntimeError(k + ': ' + error)
75+
76+
calc, error = work.classify(calc)
77+
if error:
78+
raise RuntimeError(k + ': ' + error)
79+
80+
calc = work.postprocess(calc)
81+
82+
cls.results[k] = [ v['data'], calc.apps['perovskite_tilting']['data'] ]
83+
84+
def test_all(self):
85+
for k, v in self.results.iteritems():
86+
centers = v[0].keys()
87+
for center in centers:
88+
self.assertEqual(v[0][center], v[1][center])
89+
90+
91+
if __name__ == "__main__":
92+
for k, v in test_data.iteritems():
93+
for calc, error in work.parse(data_dir + os.sep + k):
94+
if error:
95+
raise RuntimeError(k + ': ' + error)
96+
97+
calc, error = work.classify(calc)
98+
if error:
99+
raise RuntimeError(k + ': ' + error)
100+
101+
calc = work.postprocess(calc)
102+
if not 'perovskite_tilting' in calc.apps:
75103
raise RuntimeError(k + ': invalid result!')
76-
print 'Octahedron N', corner
77-
print 'expected:', v['data'][corner]
78-
print 'got :', calc.apps['perovskite_tilting']['data'][corner]
79-
print __doc__
104+
print "\nSource", v['comment'], "(" + k + ")"
105+
106+
for center in v['data'].keys():
107+
if not center in calc.apps['perovskite_tilting']['data']:
108+
raise RuntimeError(k + ': invalid result!')
109+
print 'Octahedron N', center
110+
print 'expected:', v['data'][center]
111+
print 'got :', calc.apps['perovskite_tilting']['data'][center]
112+
113+
print __doc__

0 commit comments

Comments
 (0)