From 2bbada57c61b45641862a3d042df82dc7d838bf1 Mon Sep 17 00:00:00 2001 From: Markus Scheidgen <markus.scheidgen@gmail.com> Date: Thu, 28 Mar 2019 09:22:16 +0100 Subject: [PATCH] Fixed broken variable name. --- nomad/datamodel/dft.py | 4 ++-- nomad/normalizing/system.py | 2 +- tests/test_normalizing.py | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nomad/datamodel/dft.py b/nomad/datamodel/dft.py index 6cc5eb5583..bb26a224b6 100644 --- a/nomad/datamodel/dft.py +++ b/nomad/datamodel/dft.py @@ -46,7 +46,7 @@ version_re = re.compile(r'(\d+(\.\d+(\.\d+)?)?)') def map_functional_name_to_xc_treatment(name): - if name == config.services.unavailable_label: + if name == config.services.unavailable_value: return name return xc_treatments.get(name[:3].lower(), name) @@ -114,7 +114,7 @@ class DFTCalcWithMetadata(CalcWithMetadata): if val is None: logger.warning( 'The values for %s where not available in any %s' % (key, section)) - return unavailable_value if unavailable_value is not None else config.services.unavailable_label + return unavailable_value if unavailable_value is not None else config.services.unavailable_value else: return val diff --git a/nomad/normalizing/system.py b/nomad/normalizing/system.py index 64b6b6f173..b195141f79 100644 --- a/nomad/normalizing/system.py +++ b/nomad/normalizing/system.py @@ -184,7 +184,7 @@ class SystemNormalizer(SystemBasedNormalizer): Determine the dimensioality and hence the system type of the system with Matid. Write the system type to the backend. """ - system_type = 'unavailable' + system_type = config.services.unavailable_value try: dimensionality = get_dimensionality( atoms, cluster_threshold=3.1, return_clusters=False) diff --git a/tests/test_normalizing.py b/tests/test_normalizing.py index 7b5f7f2718..497cfec462 100644 --- a/tests/test_normalizing.py +++ b/tests/test_normalizing.py @@ -68,11 +68,11 @@ def assert_normalized(backend: LocalBackend): assert len(metadata.atoms) > 0 assert metadata.spacegroup is not None - assert metadata.code_name is not config.services.unavailable_label - assert metadata.code_version is not config.services.unavailable_label - assert metadata.basis_set is not config.services.unavailable_label - assert metadata.xc_functional is not config.services.unavailable_label - assert metadata.system is not config.services.unavailable_label + assert metadata.code_name != config.services.unavailable_value + assert metadata.code_version != config.services.unavailable_value + assert metadata.basis_set != config.services.unavailable_value + assert metadata.xc_functional != config.services.unavailable_value + assert metadata.system != config.services.unavailable_value # TODO check symmetry where we know it should be there -- GitLab