Commit e42f03ae authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Merged.

parents 17541e25 e893fbff
Pipeline #77853 passed with stages
in 28 minutes and 43 seconds
RewriteRule "^/fairdi/stat/stat.js$" "http://<the ip address>:8001/piwik.js" [p]
RewriteRule "^/fairdi/stat/stat.php$" "http://<the ip address>:8001/piwik.php" [p]
RewriteRule "^/fairdi/stat/stat$" "http://<the ip address>:8001/piwik.php" [p]
ProxyPass /fairdi/stat http://<the ip address>:8001
ProxyPassReverse /fairdi/stat http://<the ip address>:8001
<Proxy http://<the ip address>:8001/app>
......
location /fairdi/stat {
rewrite ^(.*)/stat.js$ $1/piwik.js;
rewrite ^(.*)/stat.php$ $1/piwik.php;
rewrite ^(.*)/stat$ $1/piwik.php;
rewrite ^/fairdi/stat/(.*)$ /$1 break;
proxy_set_header X-Forwarded-Uri /fairdi/stat;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
......
......@@ -92,8 +92,14 @@ data:
"keycloakClientId": "{{ .Values.keycloak.guiClientId }}",
"matomoSiteId": {{ .Values.gui.matomoSiteId }},
"matomoUrl": "{{ .Values.gui.matomoUrl }}",
"sendTrackingData": {{ .Values.gui.sendTrackingData }},
"debug": {{ .Values.gui.debug }}
"matomoEnabled": {{ .Values.gui.matomoEnabled }},
"debug": {{ .Values.gui.debug }},
"version": {
"label": "{{ .Values.version.label }}",
"isBeta": {{ .Values.version.isBeta }},
"usesBetaData": {{ .Values.version.usesBetaData }},
"officialUrl": "{{ .Values.version.officialUrl }}"
}
};
---
apiVersion: v1
......
......@@ -9,6 +9,7 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
nomad.yaml: |
meta:
release: "{{ .Release.Name }}"
reprocess_unmatched: {{ .Values.reprocess_unmatched }}
fs:
......
## Default values for nomad@FAIRDI
version:
label: "0.8.1"
isBeta: false
usesBetaData: false
officialUrl: "https://repository.nomad-coe.eu/app/gui"
## Everything concerning the container images to be used
image:
......@@ -68,11 +73,11 @@ gui:
## This variable is used in the GUI to show or hide additional information
debug: false
## URL for matomo(piwik) user tracking
matomoUrl: 'http://nowhere.no'
matomoUrl: 'https://repository.nomad-coe.eu/fairdi/stat'
## site id for matomo(piwik) user tracking
matomoSiteId: 1
## send matomo(piwik) user tracking data
sendTrackingData: false
matomoEnabled: false
## Everything concerning the nginx that serves the gui, proxies the api
# It is run via NodePort service
......
......@@ -35,6 +35,7 @@ parmed==3.0.0
mdtraj
mdanalysis
nomadcore
nomadDOSfingerprints
# [infrastructure]
optimade
......
......@@ -25,7 +25,7 @@ import fastentrypoints # pylint: disable=unused-import
'''
This setup.py works differently for creating a distribution than installing for
development. The idea is that for distributions, we compile the requirements, packages, and
data files from all dependencies and install everything under one package called 'nomad'.
data files from all dependencies and install everything under one package called 'nomad-lab'.
For development we install each dependency as its own project. This is mainly due to
pip's limitation of not being able to install from multiple source folders in develop
mode.
......@@ -43,6 +43,7 @@ requirements.txt where specific comments are used to assign an extra to requirem
ignore_extra_requires = ['optimade']
''' Dependencies where the extra_requires should not be added '''
def parse_requirements():
'''
Parses the requirements.txt file to extras install and extra requirements.
......@@ -179,7 +180,7 @@ def compile_dependency_setup_kwargs(paths, **kwargs):
# 3. requires
local_install_requires = set()
if not name in ignore_extra_requires:
if name not in ignore_extra_requires:
for extra_require in local_kwargs.get('extras_require', {}).values():
for require in extra_require:
local_install_requires.add(require)
......@@ -234,17 +235,26 @@ def setup_kwargs():
from nomad import config
install_requires, extras_require = parse_requirements()
with open("README.md", "r") as fh:
long_description = fh.read()
return dict(
name='nomad-lab',
author='NOMAD Laboratory',
author_email='markus.scheidgen@physik.hu-berlin.de',
url='https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR',
version=config.meta.version,
license='APACHE 2.0',
description='The NOvel MAterials Discovery (NOMAD) Python package',
long_description=long_description,
long_description_content_type="text/markdown",
package_dir={'': './'},
packages=['nomad.%s' % pkg for pkg in find_packages('./nomad')] + ['nomad'],
setup_requires=['pip', 'setuptools', 'wheel', 'fastentrypoints', 'numpy', 'pyyaml'],
install_requires=install_requires,
extras_require=extras_require,
include_package_data=True,
python_requires='>=3.6',
entry_points='''
[console_scripts]
nomad=nomad.cli:run_cli
......
......@@ -3,7 +3,6 @@
set -e
git submodule sync
git submodule update --init
pip install -r requirements.txt
git submodule update --init --jobs=4
./dependencies.sh -e
pip install -e .
\ No newline at end of file
pip install -e .[all]
\ No newline at end of file
......@@ -224,13 +224,17 @@ def test_base_info_endpoint(api):
assert data['data']['id'] == '/'
def test_calculation_info_endpoint(api):
rv = api.get('/info/calculations')
@pytest.mark.parametrize('entry_type', ['calculations', 'structures'])
def test_entry_info_endpoint(api, entry_type):
rv = api.get('/info/%s' % entry_type)
assert rv.status_code == 200
data = json.loads(rv.data)
for key in ['description', 'properties', 'formats', 'output_fields_by_format']:
assert key in data['data']
assert '_nmd_atoms' in data['data']['properties']
assert '_nmd_dft_system' in data['data']['properties']
# TODO the implementation should be fixed to return actual references first
# def test_references_endpoint(api, example_structures):
......@@ -277,3 +281,15 @@ def test_structure_endpoint(api, example_structures):
assert attr is not None
assert attr.get('elements') == ['H', 'O']
assert len(attr.get('dimension_types')) == 3
def test_nmd_properties(api, example_structures):
rv = api.get('/structures/%s' % 'test_calc_id_1?request_fields=_nmd_atoms,_nmd_dft_system,_nmd_doesnotexist')
assert rv.status_code == 200
data = json.loads(rv.data)
assert data.get('data') is not None
attr = data['data'].get('attributes')
assert attr is not None
assert attr.get('_nmd_atoms') == ['H', 'O']
assert '_nmd_dft_system' in attr
assert '_nmd_doesnotexist' not in attr
......@@ -17,6 +17,8 @@ import numpy as np
from tests.test_parsing import parse_file
from tests.normalizing.conftest import run_normalize
from nomad_dos_fingerprints import DOSFingerprint, tanimoto_similarity
vasp_parser_dos = (
'parsers/vasp', 'tests/data/parsers/vasp/vasp_dos.xml')
......@@ -36,3 +38,14 @@ def test_dos_normalizer():
expected = 1.7362195274239454e+47
# Compare floats properly with numpy (delta tolerance involved)
assert np.allclose(last_value, expected)
# Check if DOS fingerprint was created
backend_dos_fingerprint = backend['section_dos_fingerprint'][0]
dos_fingerprint = DOSFingerprint().from_dict(dict(
bins=backend_dos_fingerprint.bins,
indices=backend_dos_fingerprint.indices,
grid_id=backend_dos_fingerprint.grid_id,
stepsize=backend_dos_fingerprint.stepsize,
filling_factor=backend_dos_fingerprint.filling_factor))
assert tanimoto_similarity(dos_fingerprint, dos_fingerprint) == 1
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