api_with_archive_query.py 647 Bytes
Newer Older
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
'''
A simple example used in the NOMAD webinar API tutorial
'''

from nomad.client import ArchiveQuery

query = ArchiveQuery(
    url='http://labdev-nomad.esc.rzg.mpg.de/fairdi/nomad/reprocess/api',
    query={
        'dft.code_name': 'VASP',
        'atoms': ['Ti', 'O']
    },
    required={
        'section_run': {
            'section_single_configuration_calculation[-1]': {
                'energy_total': '*',
                'section_dos': '*'
            }
        }
    },
    parallel=1,
    max=10)

print(query)
result = query[0]
print(result.section_run[0].section_single_configuration_calculation[-1].section_dos[0].dos_energies)