Commit 50ab2622 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'v0.9.0' into 'master'

V0.9.0

See merge request !188
parents 239a3bce 4031b61e
Pipeline #83349 passed with stages
in 10 seconds
......@@ -121,9 +121,13 @@ The NOMAD GUI requires static artifacts that are generated from the NOMAD Python
```
nomad dev metainfo > gui/src/metainfo.json
nomad dev searchQuantities > gui/src/searchQuantities.json
nomad dev units > gui/src/units.js
./gitinfo.sh
```
In additional, you have to do some more steps to prepare your working copy to run all
the tests. See below.
## Build and run the infrastructure with docker
### Docker and nomad
......@@ -218,6 +222,33 @@ yarn start
```
## Run the tests
### additional settings and artifacts
To run the tests some additional settings and files are necessary that are not part
of the code base.
First you need to create a `nomad.yaml` with the admin password for the user management
system:
```
keycloak:
password: <the-password>
```
Secondly, you need to provide the `springer.msg` Springer materials database. It can
be copied from `/nomad/fairdi/db/data/springer.msg` on our servers and should
be placed at `nomad/normalizing/data/springer.msg`.
Thirdly, you have to provide static files to serve the docs and NOMAD distribution:
```
cd docs
make html
cd ..
python setup.py compile
python setup.py sdist
cp dist/nomad-lab-*.tar.gz dist/nomad-lab.tar.gz
```
### run the necessary infrastructure
You need to have the infrastructure partially running: elastic, rabbitmq.
The rest should be mocked or provided by the tests. Make sure that you do no run any
worker, as they will fight for tasks in the queue.
......@@ -266,7 +297,7 @@ line size ruler, etc.
"git.enableSmartCommit": true,
"eslint.autoFixOnSave": true,
"python.linting.pylintArgs": [
"--load-plugins=pylint_mongoengine",
"--load-plugins=pylint_mongoengine,nomad/metainfo/pylint_plugin",
],
"python.linting.pep8Path": "pycodestyle",
"python.linting.pep8Enabled": true,
......
......@@ -2,33 +2,40 @@
A simple example that uses the NOMAD client library to access the archive.
'''
from nomad import config
from nomad.client import ArchiveQuery
from nomad.metainfo import units
query = ArchiveQuery(
# url='http://nomad-lab.eu/prod/rae/beta/api',
query={
'dft.compound_type': 'binary',
'dft.crystal_system': 'cubic',
'dft.code_name': 'FHI-aims',
'atoms': ['O']
'$and': [
{'dft.code_name': 'VASP'},
{'$gte': {'n_atoms': 3}},
{'$lte': {'dft.workflow.section_relaxation.final_energy_difference': 1e-24}}
]
},
required={
'section_run[0]': {
'section_single_configuration_calculation[-2]': {
'energy_total': '*'
},
'section_system[-2]': '*'
'section_workflow': {
'section_relaxation': {
'final_calculation_ref': {
'energy_total': '*',
'single_configuration_calculation_to_system_ref': {
'chemical_composition_reduced': '*'
}
}
}
}
},
per_page=10,
max=1000)
parallel=10,
per_page=1000,
max=10000)
print(query)
for i, result in enumerate(query):
if i < 10:
calc = result.section_workflow.section_relaxation.final_calculation_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)))
for result in query[0:10]:
run = result.section_run[0]
energy = run.section_single_configuration_calculation[0].energy_total
formula = run.section_system[0].chemical_composition_reduced
print('%s: energy %s' % (formula, energy.to(units.hartree)))
print(query)
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,12 +2,12 @@ import sys
from nomad.cli.parse import parse, normalize_all
# match and run the parser
backend = parse(sys.argv[1])
archive = parse(sys.argv[1])
# run all normalizers
normalize_all(backend)
normalize_all(archive)
# get the 'main section' section_run as a metainfo object
section_run = backend.resource.contents[0].section_run[0]
section_run = archive.section_run[0]
# get the same data as JSON serializable Python dict
python_dict = section_run.m_to_dict()
'''
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)
# type: ignore
'''
A simple example used in the NOMAD webinar API tutorial
'''
import requests
import json
base_url = 'http://nomad-lab.eu/prod/rae/api'
# response = requests.get(base_url + '/repo?datasets.name=NOMAD%20webinar')
response = requests.get(
base_url + '/repo',
params={'datasets.name': 'NOMAD webinar', 'per_page': 1})
data = response.json()
upload_id = data['results'][0]['upload_id']
calc_id = data['results'][0]['calc_id']
response = requests.get(
base_url + '/archive/%s/%s' % (upload_id, calc_id))
print(json.dumps(response.json(), indent=2))
print(
response.json()['section_run'][0]['section_single_configuration_calculation'][-1]['section_dos'][0]['dos_energies'])
{
"name": "nomad-fair-gui",
"version": "0.8.9",
"version": "0.9.0",
"commit": "e98694e",
"private": true,
"dependencies": {
"@lauri-codes/materia": "0.0.6",
"@material-ui/core": "^4.0.0",
"@material-ui/icons": "^4.0.0",
"@material-ui/lab": "^4.0.0-alpha.49",
......@@ -23,10 +24,12 @@
"lodash": "^4.17.15",
"material-ui-chip-input": "^1.0.0-beta.14",
"material-ui-flat-pagination": "^4.0.0",
"mathjs": "^7.1.0",
"object-hash": "^2.0.3",
"pace": "^0.0.4",
"pace-js": "^1.0.2",
"piwik-react-router": "^0.12.1",
"plotly.js-cartesian-dist-min": "^1.54.7",
"qs": "^6.8.0",
"react": "^16.13.1",
"react-app-polyfill": "^1.0.1",
......@@ -51,7 +54,6 @@
"remark": "^12.0.1",
"remark-math": "^2.0.1",
"swagger-client": "^3.8.22",
"three.js": "^0.77.1",
"url-parse": "^1.4.3",
"use-query-params": "^0.6.0"
},
......
......@@ -2,15 +2,17 @@ window.nomadEnv = {
'keycloakBase': 'https://nomad-lab.eu/fairdi/keycloak/auth/',
'keycloakRealm': 'fairdi_nomad_test',
'keycloakClientId': 'nomad_gui_dev',
'appBase': 'http://nomad-lab.eu/prod/rae/beta',
'appBase': 'http://localhost:8000/fairdi/nomad/latest',
'debug': false,
'matomoEnabled': false,
'matomoUrl': 'https://nomad-lab.eu/fairdi/stat',
'matomoSiteId': '2',
'version': {
'label': '0.8.8',
'label': '0.9.0',
'isBeta': false,
'usesBetaData': false,
'isTest': true,
'usesBetaData': true,
'officialUrl': 'https://nomad-lab.eu/prod/rae/gui'
},
'encyclopediaEnabled': true,
......
gui/public/favicon.ico

1.12 KB | W: | H:

gui/public/favicon.ico

1.12 KB | W: | H:

gui/public/favicon.ico
gui/public/favicon.ico
gui/public/favicon.ico
gui/public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
......@@ -5,6 +5,9 @@
window.paceOptions = {
restartOnPushState: true
}
// This needs to be defined for Plotly.js graphs, see
// https://github.com/plotly/plotly.js/blob/master/dist/README.md#partial-bundles
window.PlotlyConfig = {MathJaxConfig: 'local'}
</script>
<script src="https://unpkg.com/pace-js@1.0.2/pace.min.js"></script>
<link href="%PUBLIC_URL%/pace.css" rel="stylesheet" />
......@@ -38,7 +41,6 @@
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<title>NOMAD</title>
</head>
<body>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]>
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
x="0px" y="0px" width="425px" height="227px" viewBox="-36.073 -17.643 425 227" enable-background="new -36.073 -17.643 425 227"
xml:space="preserve">
<defs>
</defs>
<polygon fill="#17A5F7" points="109.873,49.391 98.234,37.752 93.973,53.652 105.613,65.293 "/>
<polygon fill="#17A5F7" points="89.711,69.549 78.072,57.91 73.811,73.811 85.451,85.451 "/>
<polygon fill="#17A5F7" points="137.412,56.77 125.773,45.131 121.512,61.031 133.152,72.67 "/>
<polygon fill="#17A5F7" points="117.25,76.928 105.611,65.289 101.35,81.189 112.99,92.828 "/>
<polygon fill="#17A5F7" points="164.951,64.146 153.313,52.508 149.051,68.408 160.691,80.049 "/>
<polygon fill="#17A5F7" points="144.789,84.305 133.15,72.666 128.889,88.566 140.529,100.207 "/>
<polygon fill="#17A5F7" points="192.491,71.525 180.852,59.887 176.59,75.787 188.231,87.426 "/>
<polygon fill="#17A5F7" points="172.328,91.684 160.689,80.045 156.428,95.945 168.068,107.584 "/>
<polygon fill="#17A5F7" points="220.03,78.902 208.392,67.264 204.13,83.164 215.771,94.805 "/>
<polygon fill="#17A5F7" points="199.868,99.061 188.229,87.422 183.968,103.322 195.608,114.963 "/>
<polygon fill="#17A5F7" points="247.569,86.281 235.931,74.643 231.669,90.543 243.31,102.182 "/>
<polygon fill="#17A5F7" points="227.407,106.439 215.769,94.801 211.507,110.701 223.147,122.341 "/>
<polygon fill="#17A5F7" points="97.09,97.09 85.451,85.451 81.189,101.352 92.83,112.99 "/>
<polygon fill="#17A5F7" points="124.629,104.467 112.99,92.828 108.729,108.729 120.369,120.37 "/>
<polygon fill="#17A5F7" points="152.168,111.846 140.529,100.207 136.268,116.108 147.908,127.747 "/>
<polygon fill="#17A5F7" points="179.707,119.224 168.068,107.584 163.807,123.485 175.447,135.126 "/>
<polygon fill="#17A5F7" points="207.247,126.603 195.608,114.963 191.347,130.864 202.987,142.503 "/>
<polygon fill="#17A5F7" points="226.837,136.11 221.017,130.292 218.886,138.241 224.706,144.062 "/>
<polygon fill="#17A5F7" points="254.382,143.499 248.562,137.679 246.431,145.63 252.251,151.448 "/>
<polygon fill="#17A5F7" points="342.405,90.396 336.585,84.576 334.454,92.527 340.274,98.346 "/>
<polygon fill="#17A5F7" points="300.106,27.936 294.288,22.115 292.157,30.066 297.978,35.885 "/>
<polygon fill="#17A5F7" points="275.108,93.658 263.47,82.02 259.208,97.92 270.849,109.561 "/>
<polygon fill="#17A5F7" points="254.946,113.816 243.308,102.178 239.046,118.079 250.687,129.72 "/>
<polygon fill="#17A5F7" points="302.647,101.037 291.009,89.398 286.747,105.299 298.388,116.938 "/>
<polygon fill="#17A5F7" points="282.485,121.196 270.847,109.557 266.585,125.458 278.226,137.097 "/>
<polygon fill="#17A5F7" points="169.785,18.58 163.965,12.762 161.834,20.711 167.654,26.531 "/>
<polygon fill="#17A5F7" points="122.084,31.359 116.266,25.541 114.135,33.49 119.955,39.311 "/>
<polygon fill="#17A5F7" points="138.271,12.266 135.361,9.355 134.295,13.33 137.205,16.24 "/>
<polygon fill="#17A5F7" points="90.57,25.047 87.66,22.137 86.596,26.111 89.506,29.021 "/>
<polygon fill="#17A5F7" points="63.031,17.67 60.121,14.76 59.055,18.734 61.965,21.645 "/>
<polygon fill="#17A5F7" points="7.951,2.91 5.041,0 3.977,3.975 6.887,6.885 "/>
<polygon fill="#17A5F7" points="15.328,30.449 12.418,27.539 11.354,31.514 14.264,34.424 "/>
<polygon fill="#17A5F7" points="30.086,85.525 27.176,82.615 26.111,86.59 29.021,89.5 "/>
<polygon fill="#17A5F7" points="37.465,113.064 34.555,110.154 33.49,114.129 36.4,117.04 "/>
<polygon fill="#17A5F7" points="65.006,120.448 62.096,117.538 61.029,121.513 63.939,124.423 "/>
<polygon fill="#17A5F7" points="92.545,127.669 89.635,124.759 88.57,128.733 91.48,131.644 "/>
<polygon fill="#17A5F7" points="120.086,135.208 117.176,132.298 116.109,136.272 119.02,139.183 "/>
<polygon fill="#17A5F7" points="202.704,157.345 199.794,154.435 198.729,158.409 201.64,161.319 "/>
<polygon fill="#17A5F7" points="241.052,14.242 238.142,11.332 237.077,15.307 239.987,18.217 "/>
<polygon fill="#17A5F7" points="268.593,21.623 265.683,18.713 264.618,22.688 267.528,25.598 "/>
<polygon fill="#17A5F7" points="331.052,63.922 328.142,61.012 327.077,64.986 329.987,67.896 "/>
<polygon fill="#17A5F7" points="318.269,111.621 315.358,108.711 314.294,112.686 317.204,115.597 "/>
<polygon fill="#17A5F7" points="46.842,36.762 41.023,30.943 38.893,38.893 44.713,44.713 "/>
<polygon fill="#17A5F7" points="74.383,43.986 68.564,38.168 66.434,46.117 72.254,51.938 "/>
<polygon fill="#17A5F7" points="34.061,58.9 28.242,53.08 26.111,61.031 31.932,66.85 "/>
<polygon fill="#17A5F7" points="54.221,64.299 48.402,58.48 46.271,66.43 52.092,72.25 "/>
<polygon fill="#17A5F7" points="151.6,141.521 145.779,135.7 143.648,143.651 149.469,149.47 "/>
<polygon fill="#17A5F7" points="61.6,91.84 55.781,86.021 53.65,93.971 59.471,99.791 "/>
<polygon fill="#17A5F7" points="157.572,36.607 145.934,24.969 141.672,40.869 153.313,52.51 "/>
<polygon fill="#17A5F7" points="197.325,25.959 191.505,20.139 189.374,28.09 195.194,33.908 "/>
<polygon fill="#17A5F7" points="185.112,43.986 173.473,32.348 169.211,48.248 180.852,59.887 "/>
<polygon fill="#17A5F7" points="224.864,33.336 219.044,27.518 216.913,35.467 222.733,41.287 "/>
<polygon fill="#17A5F7" points="212.651,51.363 201.013,39.725 196.751,55.625 208.392,67.266 "/>
<polygon fill="#17A5F7" points="260.353,38.584 248.714,26.945 244.452,42.846 256.093,54.484 "/>
<polygon fill="#17A5F7" points="240.19,58.742 228.552,47.104 224.29,63.004 235.931,74.643 "/>
<polygon fill="#17A5F7" points="287.892,45.961 276.253,34.322 271.991,50.223 283.632,61.863 "/>
<polygon fill="#17A5F7" points="267.729,66.119 256.091,54.48 251.829,70.381 263.47,82.021 "/>
<polygon fill="#17A5F7" points="315.431,53.34 303.792,41.701 299.53,57.602 311.171,69.24 "/>
<polygon fill="#17A5F7" points="295.269,73.498 283.63,61.859 279.368,77.76 291.009,89.398 "/>
<polygon fill="#17A5F7" points="322.808,80.875 311.169,69.236 306.907,85.137 318.548,96.777 "/>
<polygon fill="#00C8C9" points="137.412,56.77 153.313,52.508 149.051,68.408 133.15,72.668 "/>
<polygon fill="#00C8C9" points="117.25,76.928 133.15,72.666 128.889,88.566 112.988,92.826 "/>
<polygon fill="#00C8C9" points="164.951,64.146 180.852,59.887 176.59,75.787 160.689,80.045 "/>
<polygon fill="#00C8C9" points="144.789,84.305 160.689,80.045 156.428,95.945 140.527,100.203 "/>
<polygon fill="#00C8C9" points="192.491,71.525 208.392,67.264 204.13,83.164 188.229,87.424 "/>
<polygon fill="#00C8C9" points="172.328,91.684 188.229,87.422 183.968,103.322 168.066,107.582 "/>
<polygon fill="#00C8C9" points="220.03,78.902 235.931,74.643 231.669,90.543 215.769,94.801 "/>
<polygon fill="#00C8C9" points="247.569,86.281 263.47,82.02 259.208,97.92 243.308,102.18 "/>
<polygon fill="#00C8C9" points="240.19,58.742 256.091,54.48 251.829,70.381 235.929,74.641 "/>
<polygon fill="#527DE3" points="117.252,76.93 105.611,65.289 121.512,61.031 133.152,72.67 "/>
<polygon fill="#527DE3" points="97.09,97.088 85.449,85.447 101.35,81.189 112.99,92.828 "/>
<polygon fill="#527DE3" points="144.791,84.309 133.15,72.668 149.051,68.408 160.691,80.049 "/>
<polygon fill="#527DE3" points="124.629,104.467 112.988,92.826 128.889,88.566 140.529,100.207 "/>
<polygon fill="#527DE3" points="172.33,91.686 160.689,80.045 176.59,75.787 188.231,87.426 "/>
<polygon fill="#527DE3" points="199.87,99.064 188.229,87.424 204.13,83.164 215.771,94.805 "/>
<polygon fill="#527DE3" points="227.409,106.441 215.769,94.801 231.669,90.543 243.31,102.182 "/>
<polygon fill="#527DE3" points="254.948,113.82 243.308,102.18 259.208,97.92 270.849,109.561 "/>
<polygon fill="#527DE3" points="220.03,78.902 208.39,67.262 224.29,63.004 235.931,74.643 "/>
<polygon fill="#527DE3" points="247.569,86.281 235.929,74.641 251.829,70.381 263.47,82.021 "/>
<polygon fill="#527DE3" points="275.108,93.658 263.468,82.018 279.368,77.76 291.009,89.398 "/>
<polygon fill="#00DFE0" points="82.334,42.014 98.234,37.752 93.973,53.652 78.072,57.912 "/>
<polygon fill="#00DFE0" points="62.172,62.172 78.072,57.91 73.811,73.811 57.91,78.07 "/>
<polygon fill="#00DFE0" points="109.873,49.391 125.773,45.131 121.512,61.031 105.611,65.289 "/>
<polygon fill="#00DFE0" points="89.711,69.549 105.611,65.289 101.35,81.189 85.449,85.447 "/>
<polygon fill="#00DFE0" points="199.868,99.061 215.769,94.801 211.507,110.701 195.606,114.959 "/>
<polygon fill="#00DFE0" points="69.551,89.711 85.451,85.451 81.189,101.352 65.289,105.609 "/>
<polygon fill="#00DFE0" points="97.09,97.09 112.99,92.828 108.729,108.729 92.828,112.988 "/>
<polygon fill="#00DFE0" points="124.629,104.467 140.529,100.207 136.268,116.108 120.367,120.366 "/>
<polygon fill="#00DFE0" points="152.168,111.846 168.068,107.584 163.807,123.485 147.906,127.745 "/>
<polygon fill="#00DFE0" points="179.707,119.224 195.608,114.963 191.347,130.864 175.445,135.122 "/>
<polygon fill="#00DFE0" points="213.067,132.421 221.017,130.292 218.886,138.241 210.937,140.37 "/>
<polygon fill="#00DFE0" points="240.612,139.81 248.562,137.679 246.431,145.63 238.481,147.759 "/>
<polygon fill="#00DFE0" points="328.636,86.707 336.585,84.576 334.454,92.527 326.505,94.656 "/>
<polygon fill="#00DFE0" points="286.337,24.246 294.288,22.115 292.157,30.066 284.206,32.195 "/>
<polygon fill="#00DFE0" points="227.407,106.439 243.308,102.178 239.046,118.079 223.146,122.339 "/>
<polygon fill="#00DFE0" points="275.108,93.658 291.009,89.398 286.747,105.299 270.847,109.557 "/>
<polygon fill="#00DFE0" points="254.946,113.816 270.847,109.557 266.585,125.458 250.685,129.716 "/>
<polygon fill="#00DFE0" points="156.016,14.891 163.965,12.762 161.834,20.711 153.885,22.84 "/>
<polygon fill="#00DFE0" points="108.314,27.67 116.266,25.541 114.135,33.49 106.184,35.619 "/>
<polygon fill="#00DFE0" points="131.387,10.42 135.361,9.355 134.295,13.33 130.32,14.395 "/>
<polygon fill="#00DFE0" points="83.686,23.201 87.66,22.137 86.596,26.111 82.619,27.176 "/>
<polygon fill="#00DFE0" points="56.146,15.824 60.121,14.76 59.055,18.734 55.08,19.799 "/>
<polygon fill="#00DFE0" points="1.066,1.064 5.041,0 3.977,3.975 0,5.039 "/>
<polygon fill="#00DFE0" points="8.443,28.604 12.418,27.539 11.354,31.514 7.377,32.578 "/>
<polygon fill="#00DFE0" points="23.201,83.68 27.176,82.615 26.111,86.59 22.135,87.654 "/>
<polygon fill="#00DFE0" points="30.58,111.219 34.555,110.154 33.49,114.129 29.514,115.194 "/>
<polygon fill="#00DFE0" points="58.121,118.603 62.096,117.538 61.029,121.513 57.055,122.577 "/>
<polygon fill="#00DFE0" points="85.66,125.823 89.635,124.759 88.57,128.733 84.594,129.798 "/>
<polygon fill="#00DFE0" points="113.201,133.362 117.176,132.298 116.109,136.272 112.135,137.337 "/>
<polygon fill="#00DFE0" points="195.819,155.499 199.794,154.435 198.729,158.409 194.753,159.474 "/>
<polygon fill="#00DFE0" points="234.167,12.396 238.142,11.332 237.077,15.307 233.101,16.371 "/>
<polygon fill="#00DFE0" points="261.708,19.777 265.683,18.713 264.618,22.688 260.642,23.752 "/>
<polygon fill="#00DFE0" points="324.167,62.076 328.142,61.012 327.077,64.986 323.101,66.051 "/>
<polygon fill="#00DFE0" points="311.384,109.775 315.358,108.711 314.294,112.686 310.317,113.75 "/>
<polygon fill="#00DFE0" points="33.072,33.072 41.023,30.943 38.893,38.893 30.941,41.021 "/>
<polygon fill="#00DFE0" points="60.613,40.297 68.564,38.168 66.434,46.117 58.482,48.246 "/>
<polygon fill="#00DFE0" points="20.291,55.211 28.242,53.08 26.111,61.031 18.16,63.16 "/>
<polygon fill="#00DFE0" points="40.451,60.609 48.402,58.48 46.271,66.43 38.32,68.559 "/>
<polygon fill="#00DFE0" points="137.83,137.831 145.779,135.7 143.648,143.651 135.699,145.78 "/>
<polygon fill="#00DFE0" points="47.83,88.15 55.781,86.021 53.65,93.971 45.699,96.1 "/>
<polygon fill="#00DFE0" points="130.033,29.23 145.934,24.969 141.672,40.869 125.771,45.129 "/>
<polygon fill="#00DFE0" points="183.556,22.27 191.505,20.139 189.374,28.09 181.424,30.219 "/>
<polygon fill="#00DFE0" points="157.572,36.607 173.473,32.348 169.211,48.248 153.311,52.506 "/>
<polygon fill="#00DFE0" points="211.095,29.646 219.044,27.518 216.913,35.467 208.964,37.596 "/>
<polygon fill="#00DFE0" points="185.112,43.986 201.013,39.725 196.751,55.625 180.85,59.885 "/>
<polygon fill="#00DFE0" points="232.813,31.205 248.714,26.945 244.452,42.846 228.552,47.104 "/>
<polygon fill="#00DFE0" points="212.651,51.363 228.552,47.104 224.29,63.004 208.39,67.262 "/>
<polygon fill="#00DFE0" points="260.353,38.584 276.253,34.322 271.991,50.223 256.091,54.482 "/>
<polygon fill="#00DFE0" points="287.892,45.961 303.792,41.701 299.53,57.602 283.63,61.859 "/>
<polygon fill="#00DFE0" points="267.729,66.119 283.63,61.859 279.368,77.76 263.468,82.018 "/>
<polygon fill="#00DFE0" points="295.269,73.498 311.169,69.236 306.907,85.137 291.007,89.396 "/>
<polygon fill="#4472DB" points="89.713,69.553 78.072,57.912 93.973,53.652 105.613,65.293 "/>
<polygon fill="#4472DB" points="69.551,89.711 57.91,78.07 73.811,73.811 85.451,85.451 "/>
<polygon fill="#4472DB" points="152.168,111.844 140.527,100.203 156.428,95.945 168.068,107.584 "/>
<polygon fill="#4472DB" points="179.707,119.224 168.066,107.582 183.968,103.322 195.608,114.963 "/>
<polygon fill="#4472DB" points="207.247,126.601 195.606,114.959 211.507,110.701 223.147,122.341 "/>
<polygon fill="#4472DB" points="76.93,117.251 65.289,105.609 81.189,101.352 92.83,112.99 "/>
<polygon fill="#4472DB" points="104.469,124.63 92.828,112.988 108.729,108.729 120.369,120.37 "/>
<polygon fill="#4472DB" points="132.008,132.007 120.367,120.366 136.268,116.108 147.908,127.747 "/>
<polygon fill="#4472DB" points="159.547,139.386 147.906,127.745 163.807,123.485 175.447,135.126 "/>
<polygon fill="#4472DB" points="187.087,146.763 175.445,135.122 191.347,130.864 202.987,142.503 "/>
<polygon fill="#4472DB" points="216.757,146.19 210.937,140.37 218.886,138.241 224.706,144.062 "/>
<polygon fill="#4472DB" points="244.302,153.579 238.481,147.759 246.431,145.63 252.251,151.448 "/>
<polygon fill="#4472DB" points="332.325,100.477 326.505,94.656 334.454,92.527 340.274,98.346 "/>
<polygon fill="#4472DB" points="290.026,38.016 284.206,32.195 292.157,30.066 297.978,35.885 "/>
<polygon fill="#4472DB" points="234.786,133.979 223.146,122.339 239.046,118.079 250.687,129.72 "/>
<polygon fill="#4472DB" points="282.487,121.198 270.847,109.557 286.747,105.299 298.388,116.938 "/>
<polygon fill="#4472DB" points="262.325,141.356 250.685,129.716 266.585,125.458 278.226,137.097 "/>
<polygon fill="#4472DB" points="159.705,28.66 153.885,22.84 161.834,20.711 167.654,26.531 "/>
<polygon fill="#4472DB" points="112.004,41.439 106.184,35.619 114.135,33.49 119.955,39.311 "/>
<polygon fill="#4472DB" points="133.23,17.305 130.32,14.395 134.295,13.33 137.205,16.24 "/>
<polygon fill="#4472DB" points="85.529,30.086 82.619,27.176 86.596,26.111 89.506,29.021 "/>
<polygon fill="#4472DB" points="57.99,22.709 55.08,19.799 59.055,18.734 61.965,21.645 "/>
<polygon fill="#4472DB" points="2.91,7.949 0,5.039 3.977,3.975 6.887,6.885 "/>
<polygon fill="#4472DB" points="10.287,35.488 7.377,32.578 11.354,31.514 14.264,34.424 "/>
<polygon fill="#4472DB" points="25.045,90.564 22.135,87.654 26.111,86.59 29.021,89.5 "/>
<polygon fill="#4472DB" points="32.424,118.104 29.514,115.194 33.49,114.129 36.4,117.04 "/>
<polygon fill="#4472DB" points="59.965,125.487 57.055,122.577 61.029,121.513 63.939,124.423 "/>
<polygon fill="#4472DB" points="87.504,132.708 84.594,129.798 88.57,128.733 91.48,131.644 "/>
<polygon fill="#4472DB" points="115.045,140.247 112.135,137.337 116.109,136.272 119.02,139.183 "/>
<polygon fill="#4472DB" points="197.663,162.384 194.753,159.474 198.729,158.409 201.64,161.319 "/>
<polygon fill="#4472DB" points="236.011,19.281 233.101,16.371 237.077,15.307 239.987,18.217 "/>
<polygon fill="#4472DB" points="263.552,26.662 260.642,23.752 264.618,22.688 267.528,25.598 "/>
<polygon fill="#4472DB" points="326.011,68.961 323.101,66.051 327.077,64.986 329.987,67.896 "/>
<polygon fill="#4472DB" points="313.228,116.661 310.317,113.75 314.294,112.686 317.204,115.597 "/>
<polygon fill="#4472DB" points="36.762,46.842 30.941,41.021 38.893,38.893 44.713,44.713 "/>
<polygon fill="#4472DB" points="64.303,54.066 58.482,48.246 66.434,46.117 72.254,51.938 "/>
<polygon fill="#4472DB" points="23.98,68.98 18.16,63.16 26.111,61.031 31.932,66.85 "/>
<polygon fill="#4472DB" points="44.141,74.379 38.32,68.559 46.271,66.43 52.092,72.25 "/>
<polygon fill="#4472DB" points="141.52,151.601 135.699,145.78 143.648,143.651 149.469,149.47 "/>
<polygon fill="#4472DB" points="51.52,101.92 45.699,96.1 53.65,93.971 59.471,99.791 "/>
<polygon fill="#4472DB" points="137.412,56.77 125.771,45.129 141.672,40.869 153.313,52.51 "/>
<polygon fill="#4472DB" points="187.245,36.039 181.424,30.219 189.374,28.09 195.194,33.908 "/>
<polygon fill="#4472DB" points="164.951,64.146 153.311,52.506 169.211,48.248 180.852,59.887 "/>
<polygon fill="#4472DB" points="214.784,43.416 208.964,37.596 216.913,35.467 222.733,41.287 "/>
<polygon fill="#4472DB" points="192.491,71.525 180.85,59.885 196.751,55.625 208.392,67.266 "/>
<polygon fill="#4472DB" points="240.192,58.744 228.552,47.104 244.452,42.846 256.093,54.484 "/>
<polygon fill="#4472DB" points="267.731,66.123 256.091,54.482 271.991,50.223 283.632,61.863 "/>
<polygon fill="#4472DB" points="295.271,73.5 283.63,61.859 299.53,57.602 311.171,69.24 "/>
<polygon fill="#4472DB" points="302.647,101.037 291.007,89.396 306.907,85.137 318.548,96.777 "/>
<path fill="#4472DB" d="M1.465,191.705V174.12h1.055l9.918,11.02v-11.02h3.166v17.585h-1.161l-9.813-10.903v10.903H1.465z"/>
<path fill="#4472DB" d="M20.244,189.179c-1.513-1.684-2.269-3.773-2.269-6.266c0-2.502,0.756-4.592,2.269-6.272
c1.512-1.681,3.394-2.521,5.645-2.521s4.132,0.84,5.645,2.521c1.512,1.681,2.268,3.771,2.268,6.272c0,2.501-0.756,4.592-2.268,6.272
c-1.513,1.68-3.394,2.52-5.645,2.52S21.756,190.863,20.244,189.179z M25.9,188.423c1.399,0,2.539-0.527,3.418-1.582
c0.879-1.057,1.319-2.365,1.319-3.928c0-1.563-0.44-2.873-1.319-3.928c-0.879-1.055-2.026-1.583-3.439-1.583
c-1.4,0-2.54,0.528-3.419,1.583s-1.319,2.364-1.319,3.928c0,1.563,0.439,2.871,1.319,3.928
C23.339,187.896,24.486,188.423,25.9,188.423z"/>
<path fill="#4472DB" d="M37.049,174.12l4.495,12.883l4.579-12.883h3.376l-6.32,17.585h-3.165l-6.341-17.585H37.049z"/>
<path fill="#4472DB" d="M51.544,191.705v-17.574l11.627-0.011v3.282h-8.462v3.752h6.341v3.271h-6.341v3.998h8.441v3.282H51.544z"/>
<path fill="#4472DB" d="M69.879,174.12v14.303h8.441v3.282H66.714V174.12H69.879z"/>
<path fill="#4472DB" d="M88.853,191.705V174.12h1.055l6.859,8.675l6.869-8.675h1.055v17.585h-3.166l-0.011-10.199l-4.748,5.861
l-4.749-5.861v10.199H88.853z"/>
<path fill="#4472DB" d="M107.011,191.705l6.331-17.585h3.166l6.32,17.572l-3.366,0.013l-0.949-2.696h-7.175l-0.95,2.696H107.011z
M115.009,178.81l-2.405,6.682h4.748L115.009,178.81z"/>
<path fill="#4472DB" d="M134.864,174.12v3.282h-5.275v14.303h-3.166v-14.303h-5.275v-3.282H134.864z"/>
<path fill="#4472DB" d="M137.283,191.705v-17.574l11.627-0.011v3.282h-8.462v3.752h6.341v3.271h-6.341v3.998h8.441v3.282H137.283z"
/>
<path fill="#4472DB" d="M161.732,184.038l3.946,7.667h-3.629l-3.788-7.269h-2.891v7.269h-3.165V174.12h6.9
c3.693,0,5.54,1.688,5.54,5.064C164.645,181.725,163.674,183.342,161.732,184.038z M155.37,181.154h4.432
c1.273-0.023,1.928-0.668,1.962-1.936c-0.035-1.156-0.679-1.757-1.931-1.805h-4.463V181.154z"/>
<path fill="#4472DB" d="M168.19,174.108h3.155v17.597h-3.155V174.108z"/>
<path fill="#4472DB" d="M173.795,191.705l6.331-17.585h3.166l6.32,17.572l-3.366,0.013l-0.949-2.696h-7.176l-0.95,2.696H173.795z
M181.793,178.81l-2.405,6.682h4.749L181.793,178.81z"/>
<path fill="#4472DB" d="M194.956,174.12v14.303h8.441v3.282h-11.605V174.12H194.956z"/>
<path fill="#4472DB" d="M214.464,174.705c0.809,0.392,1.564,0.979,2.268,1.76l-2.11,2.345c-0.703-0.938-1.688-1.407-2.954-1.407
c-1.266,0-2.074,0.332-2.427,0.997c-0.352,0.664-0.352,1.23,0,1.7c0.353,0.469,1.161,0.82,2.427,1.055
c1.336,0.156,2.55,0.645,3.641,1.466c1.09,0.819,1.636,2.129,1.636,3.927c0,1.407-0.583,2.618-1.747,3.634
c-1.164,1.017-2.52,1.524-4.067,1.524c-1.471,0-2.697-0.234-3.683-0.703c-0.984-0.469-1.828-1.095-2.532-1.876l2.11-2.345
c0.703,0.938,1.899,1.485,3.588,1.642c1.406,0,2.283-0.332,2.632-0.996c0.349-0.665,0.349-1.329,0-1.993
c-0.349-0.665-1.226-1.075-2.632-1.231c-1.266-0.156-2.427-0.587-3.482-1.289c-1.055-0.704-1.583-1.916-1.583-3.635
c0-1.556,0.601-2.805,1.799-3.746c1.199-0.941,2.434-1.412,3.699-1.412C212.515,174.12,213.654,174.315,214.464,174.705z"/>
<path fill="#4472DB" d="M227.696,191.705v-17.597h6.1c4.924,0,7.385,2.935,7.385,8.805c0,5.86-2.461,8.792-7.385,8.792H227.696z
M233.796,188.199c2.806-0.007,4.213-1.771,4.221-5.286c-0.008-3.519-1.415-5.276-4.221-5.276h-2.934v10.563H233.796z"/>
<path fill="#4472DB" d="M244.362,174.108h3.155v17.597h-3.155V174.108z"/>
<path fill="#4472DB" d="M259.909,174.705c0.809,0.392,1.564,0.979,2.27,1.76l-2.11,2.345c-0.705-0.938-1.688-1.407-2.956-1.407
c-1.265,0-2.074,0.332-2.426,0.997c-0.352,0.664-0.352,1.23,0,1.7c0.352,0.469,1.161,0.82,2.426,1.055
c1.338,0.156,2.551,0.645,3.641,1.466c1.091,0.819,1.636,2.129,1.636,3.927c0,1.407-0.582,2.618-1.746,3.634
c-1.164,1.017-2.521,1.524-4.067,1.524c-1.471,0-2.698-0.234-3.682-0.703c-0.986-0.469-1.83-1.095-2.532-1.876l2.109-2.345
c0.703,0.938,1.899,1.485,3.587,1.642c1.407,0,2.285-0.332,2.633-0.996c0.349-0.665,0.349-1.329,0-1.993
c-0.348-0.665-1.226-1.075-2.633-1.231c-1.266-0.156-2.427-0.587-3.481-1.289c-1.056-0.704-1.583-1.916-1.583-3.635
c0-1.556,0.601-2.805,1.8-3.746s2.432-1.412,3.697-1.412C257.961,174.12,259.101,174.315,259.909,174.705z"/>
<path fill="#4472DB" d="M266.71,189.179c-1.516-1.676-2.274-3.777-2.274-6.302c0.007-2.47,0.767-4.546,2.279-6.23
s3.387-2.526,5.624-2.526c2.258,0,4.196,0.78,5.813,2.345l-2.11,2.566c-1.076-0.938-2.311-1.407-3.703-1.407
c-1.421,0.009-2.565,0.502-3.435,1.479s-1.304,2.228-1.304,3.751c0.008,1.634,0.447,2.931,1.32,3.894
c0.871,0.961,2.019,1.441,3.439,1.441c1.42,0,2.647-0.466,3.682-1.396l2.11,2.567c-1.611,1.563-3.549,2.345-5.813,2.345
C270.102,191.697,268.226,190.855,266.71,189.179z"/>
<path fill="#4472DB" d="M281.622,189.179c-1.512-1.684-2.268-3.773-2.268-6.266c0-2.502,0.756-4.592,2.268-6.272
c1.513-1.681,3.395-2.521,5.646-2.521s4.133,0.84,5.645,2.521c1.513,1.681,2.269,3.771,2.269,6.272c0,2.501-0.756,4.592-2.269,6.272
c-1.512,1.68-3.394,2.52-5.645,2.52S283.135,190.863,281.622,189.179z M287.278,188.423c1.399,0,2.539-0.527,3.419-1.582
c0.878-1.057,1.318-2.365,1.318-3.928c0-1.563-0.44-2.873-1.318-3.928c-0.88-1.055-2.026-1.583-3.44-1.583
c-1.399,0-2.539,0.528-3.418,1.583c-0.88,1.055-1.319,2.364-1.319,3.928c0,1.563,0.439,2.871,1.319,3.928
C284.718,187.896,285.864,188.423,287.278,188.423z"/>
<path fill="#4472DB" d="M298.535,174.12l4.495,12.883l4.579-12.883h3.377l-6.32,17.585H301.5l-6.342-17.585H298.535z"/>
<path fill="#4472DB" d="M313.139,191.705v-17.574l11.627-0.011v3.282h-8.463v3.752h6.342v3.271h-6.342v3.998h8.441v3.282H313.139z"
/>
<path fill="#4472DB" d="M337.913,184.038l3.945,7.667h-3.63l-3.788-7.269h-2.891v7.269h-3.165V174.12h6.9
c3.693,0,5.54,1.688,5.54,5.064C340.825,181.725,339.854,183.342,337.913,184.038z M331.55,181.154h4.432
c1.273-0.023,1.928-0.668,1.963-1.936c-0.035-1.156-0.68-1.757-1.931-1.805h-4.464V181.154z"/>
<path fill="#4472DB" d="M342.036,174.12h3.714l3.671,5.744l3.757-5.744h3.63l-5.804,8.793v8.792h-3.165v-8.792L342.036,174.12z"/>
<polygon fill="#4472DB" points="98.127,101.262 90.656,101.262 94.012,102.851 101.336,102.851 101.336,79.317 98.127,75.787 "/>
<polygon fill="#4472DB" points="124.025,60.173 124.025,101.262 121.286,101.262 124.042,102.851 126.727,102.851 126.727,62.999
"/>
<polygon fill="#4472DB" points="116.555,84.642 96.879,62.999 93.146,60.173 116.555,85.922 "/>
<polygon fill="#FFFFFF" points="124.025,60.173 116.555,60.173 116.555,84.642 116.555,85.922 93.146,60.173 90.656,60.173
90.656,101.262 98.127,101.262 98.127,75.787 101.336,79.317 121.286,101.262 124.025,101.262 "/>
<path fill="none" d="M142.09,74.569c-2.035,2.417-3.051,5.416-3.051,8.997c0,3.58,1.016,6.58,3.051,8.996
c0.207,0.246,0.425,0.471,0.645,0.692c1.544,0.914,3.319,1.375,5.33,1.375c3.238,0,5.875-1.209,7.91-3.625
c2.035-2.418,3.053-5.416,3.053-8.997s-1.018-6.579-3.053-8.997c-0.207-0.246-0.425-0.471-0.645-0.692
c-1.543-0.914-3.318-1.375-5.33-1.375C146.762,70.943,144.125,72.152,142.09,74.569z"/>
<path fill="#4472DB" d="M163.086,69.198c-1.014-1.115-2.108-2.049-3.265-2.841c0.438,0.401,0.866,0.826,1.281,1.281
c3.5,3.85,5.25,8.639,5.25,14.368s-1.75,10.519-5.25,14.368s-7.854,5.773-13.061,5.773c-3.695,0-6.951-0.991-9.786-2.933
c3.262,2.993,7.184,4.491,11.771,4.491c5.207,0,9.561-1.924,13.061-5.773s5.25-8.639,5.25-14.367
C168.336,77.837,166.586,73.048,163.086,69.198z"/>
<path fill="#4472DB" d="M142.09,92.563c-2.035-2.416-3.051-5.416-3.051-8.996c0-3.581,1.016-6.58,3.051-8.997
s4.672-3.626,7.91-3.626c2.011,0,3.786,0.461,5.33,1.375c-1.941-1.949-4.375-2.933-7.314-2.933c-3.238,0-5.875,1.209-7.91,3.625
c-2.035,2.418-3.051,5.416-3.051,8.997s1.016,6.579,3.051,8.997c0.784,0.931,1.662,1.678,2.629,2.25
C142.515,93.033,142.297,92.809,142.09,92.563z"/>
<path fill="#FFFFFF" d="M161.102,96.375c3.5-3.85,5.25-8.639,5.25-14.368s-1.75-10.519-5.25-14.368
c-0.415-0.456-0.843-0.88-1.281-1.281c-3.264-2.992-7.189-4.492-11.78-4.492c-5.209,0-9.563,1.925-13.063,5.773
c-3.5,3.85-5.248,8.639-5.248,14.368c0,5.712,1.748,10.497,5.248,14.354c1.017,1.121,2.115,2.06,3.276,2.854
c2.835,1.942,6.091,2.933,9.786,2.933C153.249,102.148,157.602,100.225,161.102,96.375z M140.106,91.004
c-2.035-2.418-3.051-5.416-3.051-8.997s1.016-6.579,3.051-8.997c2.035-2.416,4.672-3.625,7.91-3.625
c2.938,0,5.373,0.984,7.314,2.933c0.22,0.221,0.438,0.446,0.645,0.692c2.035,2.418,3.053,5.416,3.053,8.997
s-1.018,6.579-3.053,8.997c-2.035,2.416-4.672,3.625-7.91,3.625c-2.011,0-3.786-0.461-5.33-1.375
C141.768,92.682,140.89,91.935,140.106,91.004z"/>
<polygon fill="#4472DB" points="179.49,101.262 172.02,101.262 174.044,102.851 181.515,102.851 181.515,79.904 179.49,77.43 "/>
<polygon fill="#4472DB" points="190.696,91.127 192.721,92.717 201.906,81.489 201.902,77.43 "/>
<path fill="#4472DB" d="M209.399,60.145c0,0.028,0,41.117,0,41.117h-7.471l2.023,1.589h7.471V61.762L209.399,60.145z"/>
<polygon fill="#4472DB" points="191.291,79.699 176.968,61.762 174.51,60.173 190.696,80.443 "/>
<path fill="#FFFFFF" d="M209.399,60.173c-0.008,0-2.49,0-2.49,0l-15.618,19.526l-0.595,0.744L174.51,60.173h-2.49v41.089h7.471
V77.43l2.024,2.474l9.182,11.223l0.362-0.442l10.844-13.255l0.004,4.059l0.022,19.772h7.471V60.173z"/>
<polygon fill="none" points="237.677,86.745 233.432,74.755 229.072,86.745 "/>
<polygon fill="#4472DB" points="223.482,94.962 221.241,101.262 213.272,101.262 215.296,102.851 223.265,102.851 225.506,96.552
240.981,96.552 240.416,94.962 "/>
<polygon fill="#4472DB" points="252.624,102.851 237.708,61.762 235.685,60.173 250.6,101.234 242.79,101.261 244.681,102.851 "/>
<polygon fill="#4472DB" points="233.432,74.755 232.148,71.13 226.471,86.745 229.072,86.745 "/>
<path fill="#FFFFFF" d="M235.685,60.173h-7.471l-14.941,41.089h7.969l2.241-6.299h16.934l0.565,1.59l1.615,4.541
c0.002,0.007,0.061,0.168,0.061,0.168l0.133,0l7.81-0.027L235.685,60.173z M232.148,71.13l1.283,3.625l4.245,11.989h-8.604h-2.602
L232.148,71.13z"/>
<path fill="none" d="M263.963,69.98v23.092h4.899c6.624-0.018,9.944-4.136,9.961-12.354c-0.008-4.358-0.956-7.548-2.823-9.596
c-1.401-0.757-3.104-1.142-5.114-1.142H263.963z"/>
<path fill="#4472DB" d="M263.963,69.98h6.923c2.011,0,3.713,0.385,5.114,1.142c-1.653-1.813-4.026-2.731-7.138-2.731h-6.923v24.681
h2.023V69.98z"/>
<path fill="#4472DB" d="M281.001,64.315c3.521,3.394,5.293,8.853,5.293,16.402c0,13.697-5.812,20.544-17.432,20.544h-14.394
l2.023,1.589h14.394c11.621,0,17.432-6.847,17.432-20.543C288.317,73.433,285.868,67.447,281.001,64.315z"/>
<path fill="#FFFFFF" d="M286.294,80.717c0-7.549-1.771-13.008-5.293-16.402c-2.875-2.772-6.914-4.17-12.139-4.17h-14.394v41.117
h14.394C280.482,101.262,286.294,94.415,286.294,80.717z M261.939,68.391h6.923c3.111,0,5.484,0.918,7.138,2.731
c1.867,2.047,2.815,5.238,2.823,9.596c-0.017,8.219-3.337,12.336-9.961,12.354h-4.899h-2.023V68.391z"/>
</svg>
import React, { useContext, useLayoutEffect, useRef, useCallback, useEffect } from 'react'
import React, { useContext, useLayoutEffect, useRef, useCallback, useEffect, useState } from 'react'
import {ReactComponent as AboutSvg} from './about.svg'
import PropTypes from 'prop-types'
import Markdown from './Markdown'
import { appBase, optimadeBase, apiBase, debug, consent } from '../config'
import { appBase, optimadeBase, apiBase, debug, consent, aitoolkitEnabled, encyclopediaEnabled } from '../config'
import { apiContext } from './api'
import packageJson from '../../package.json'
import { domains } from './domains'
import { Grid, Card, CardContent, Typography, makeStyles, Link } from '@material-ui/core'
import { Grid, Card, CardContent, Typography, makeStyles, Link, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@material-ui/core'
import { Link as RouterLink, useHistory } from 'react-router-dom'
import tutorials from '../toolkitMetadata'
import parserMetadata from '../parserMetadata'
export const CodeList = () => {
const {info} = useContext(apiContext)
function CodeInfo({code, ...props}) {
if (!code) {
return ''
}