Commit b73fd75a authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'v0.9.2' into 'master'

V0.9.2

See merge request !192
parents dee70bee 2b9b683d
Pipeline #83567 passed with stages
in 48 seconds
Subproject commit 342f391804c7fa7de28ddea5eb80ee9402758fab
Subproject commit 748673f1fcd370cb998178653b745e69da8b906c
Subproject commit d9091e62f3180d0d01abdcc75c552b185c6cc8fb
Subproject commit 6fcf51ac6088192c166b5d80571edce06dded232
......@@ -9,33 +9,22 @@ from nomad.metainfo import units
query = ArchiveQuery(
# url='http://nomad-lab.eu/prod/rae/beta/api',
query={
'$and': [
{'dft.code_name': 'VASP'},
{'$gte': {'n_atoms': 3}},
{'$lte': {'dft.workflow.section_relaxation.final_energy_difference': 1e-24}}
]
'dft.code_name': 'VASP'
},
required={
'section_workflow': {
'section_relaxation': {
'final_calculation_ref': {
'energy_total': '*',
'single_configuration_calculation_to_system_ref': {
'chemical_composition_reduced': '*'
}
}
}
'section_run': {
'section_single_configuration_calculation': '*',
'section_system': '*'
}
},
parallel=10,
per_page=1000,
max=10000)
per_page=10,
max=100)
print(query)
for i, result in enumerate(query):
if i < 10:
calc = result.section_workflow.section_relaxation.final_calculation_ref
calc = result.section_run[0].section_single_configuration_calculation[-1]
energy = calc.energy_total
formula = calc.single_configuration_calculation_to_system_ref.chemical_composition_reduced
print('%s: energy %s' % (formula, energy.to(units.hartree)))
print(query)
'''
A simple example that uses the NOMAD client library to access the archive.
'''
from nomad.client import ArchiveQuery
from nomad.metainfo import units
query = ArchiveQuery(
query={
'$and': [
{'dft.code_name': 'VASP'},
{'$gte': {'n_atoms': 3}},
{'$lte': {'dft.workflow.section_geometry_optimization.final_energy_difference': 1e-24}}
]
},
required={
'section_workflow': {
'calculation_result_ref': {
'energy_total': '*',
'single_configuration_calculation_to_system_ref': {
'chemical_composition_reduced': '*'
}
}
}
},
parallel=10,
per_page=10,
max=100)
for i, result in enumerate(query):
if i < 10:
calc = result.section_workflow.calculation_result_ref
energy = calc.energy_total
formula = calc.single_configuration_calculation_to_system_ref.chemical_composition_reduced
print('%s: energy %s' % (formula, energy.to(units.hartree)))
print(query)
{
"name": "nomad-fair-gui",
"version": "0.9.1",
"version": "0.9.2",
"commit": "e98694e",
"private": true,
"dependencies": {
......
......@@ -9,7 +9,7 @@ window.nomadEnv = {
'matomoUrl': 'https://nomad-lab.eu/fairdi/stat',
'matomoSiteId': '2',
'version': {
'label': '0.9.1',
'label': '0.9.2',
'isBeta': false,
'isTest': true,
'usesBetaData': true,
......
......@@ -300,13 +300,19 @@ class ArchiveQueryResource(Resource):
per_page=per_page, page=page, order_by='upload_id')
except KeyError as e:
abort(400, str(e))
abort(400, 'The query part contained an unknown quantity or section: %s' % str(e))
try:
required_with_references = compute_required_with_referenced(required)
except KeyError as e:
abort(
400,
message='The required part contained an unknown quantity or section: %s' % str(e))
data = []
calcs = results['results']
upload_files = None
current_upload_id = None
required_with_references = compute_required_with_referenced(required)
archive_is_complete = False
if required_with_references is not None:
archive_is_complete = True
......
......@@ -35,7 +35,7 @@ source distribution
First example
_____________
.. literalinclude:: ../examples/client.py
.. literalinclude:: ../examples/archive/client.py
:language: python
This script should yield a result like this:
......
......@@ -270,7 +270,7 @@ datacite = NomadConfig(
)
meta = NomadConfig(
version='0.9.1',
version='0.9.2',
commit=gitinfo.commit,
release='devel',
default_domain='dft',
......
apiVersion: v1
appVersion: "0.9.1"
appVersion: "0.9.2"
description: A Helm chart for Kubernetes that only runs nomad services and uses externally hosted databases.
name: nomad
version: 0.9.1
version: 0.9.2
## Default values for nomad@FAIRDI
version:
label: "0.9.1"
label: "0.9.2"
isTest: false
isBeta: false
usesBetaData: false
......
import requests
import time
from ase.data import chemical_symbols
import random
from datetime import datetime
base_url = 'https://nomad-lab.eu/prod/rae/api'
while True:
try:
start = time.time()
atoms = '&atoms=%s&atoms%s' % (random.choice(chemical_symbols), random.choice(chemical_symbols))
response = requests.get('%s%s%s%s' % (
base_url,
'/repo/',
'?page=1&per_page=10&order_by=upload_time&order=-1&domain=dft&owner=public&statistics=atoms&exclude=atoms,only_atoms,dft.files,dft.quantities,dft.optimade,dft.labels,dft.geometries',
atoms))
end = time.time()
print('PING – %s – %f - %s' % (response.status_code, end - start, datetime.now()))
time.sleep(1)
except Exception as e:
print('ERROR – %s' % e)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment