Commit 5a0ed654 authored by Alvin Noe Ladines's avatar Alvin Noe Ladines
Browse files

Implemented new octopus parser

parent 8b67394f
Pipeline #95429 passed with stages
in 24 minutes and 33 seconds
Subproject commit 400ccf334212382aac2b1b424e5834dc979cf5af
Subproject commit 3a9893ac1167b0a9ad4a7dd7e0f53c184f1e33ac
......@@ -147,7 +147,7 @@ class OptimadeNormalizer(SystemBasedNormalizer):
if numpy and unit is not None:
if isinstance(value, pint.quantity._Quantity):
value = value.to(unit)
else:
elif value is not None:
value = value * unit
return value
......@@ -157,6 +157,7 @@ class OptimadeNormalizer(SystemBasedNormalizer):
from nomad.normalizing.system import normalized_atom_labels
nomad_species = get_value(section_system.atom_labels)
nomad_species = [] if nomad_species is None else nomad_species
# elements
atoms = normalized_atom_labels(nomad_species)
......@@ -196,7 +197,7 @@ class OptimadeNormalizer(SystemBasedNormalizer):
for species_label in set(nomad_species):
match = re.match(species_re, species_label)
element_label = match.group(1)
element_label = match.group(1) if match else species_label
species = optimade.m_create(Species)
species.name = species_label
......
......@@ -36,6 +36,7 @@ from crystalparser import CrystalParser
from fhiaimsparser import FHIAimsParser
from excitingparser import ExcitingParser
from abinitparser import AbinitParser
from octopusparser import OctopusParser
try:
# these packages are not available without parsing extra, which is ok, if the
......@@ -254,13 +255,7 @@ parsers = [
parser_class_name='libatomsparser.LibAtomsParserWrapper',
mainfile_contents_re=(r'\s*<GAP_params\s')
),
LegacyParser(
name='parsers/octopus', code_name='Octopus', code_homepage='https://octopus-code.org/',
parser_class_name='octopusparser.OctopusParserWrapper',
mainfile_contents_re=(r'\|0\) ~ \(0\) \|')
# We decided to use the octopus eyes instead of
# r'\*{32} Grid \*{32}Simulation Box:' since it was so far down in the file.
),
OctopusParser(),
# match gpaw2 first, other .gpw files are then considered to be "gpaw1"
LegacyParser(
name='parsers/gpaw2', code_name='GPAW', code_homepage='https://wiki.fysik.dtu.dk/gpaw/',
......
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