Hello all,
I’ve written a custom parser a long time ago that has worked flawlessly on our Oasis in the past. Last week I made some very small changes (which passed local testing) and now uploads to our Oasis fail with this message:
"root":{
"errors": string"parser failed with exception"
"event": string"process failed"
"proc": string"Entry"
"process": string"process_entry"
"process_worker_id": string"YO986CwbS16Ivr5XkZyg0A"
"parser": string"parsers/lightforge"
"error": string"There is no subsection to hold a nomad.datamodel.metainfo.simulation.run.Run:Section in nomad.datamodel.datamodel.EntryArchive:Section."
"step": string"parsers/lightforge"
"logger": string"nomad.processing"
"exception": string"Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/nomad/processing/data.py", line 1499, in parsing parser.parse( File "/usr/local/lib/python3.9/site-packages/nomad/parsing/parser.py", line 463, in parse self.mainfile_parser.parse(mainfile, archive, logger) File "/app/plugins/lightforge_parser/parser.py", line 1007, in parse DetailedParser(mainfile, archive) File "/app/plugins/lightforge_parser/parser.py", line 44, in DetailedParser sec_run = archive.m_create(Run) File "/usr/local/lib/python3.9/site-packages/nomad/metainfo/metainfo.py", line 2054, in m_create raise TypeError( TypeError: There is no subsection to hold a nomad.datamodel.metainfo.simulation.run.Run:Section in nomad.datamodel.datamodel.EntryArchive:Section."
"timestamp": string"2024-07-10 14:48.44"
"level": string"ERROR"
}
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/nomad/processing/data.py", line 1499, in parsing
parser.parse(
File "/usr/local/lib/python3.9/site-packages/nomad/parsing/parser.py", line 463, in parse
self.mainfile_parser.parse(mainfile, archive, logger)
File "/app/plugins/lightforge_parser/parser.py", line 1007, in parse
DetailedParser(mainfile, archive)
File "/app/plugins/lightforge_parser/parser.py", line 44, in DetailedParser
sec_run = archive.m_create(Run)
File "/usr/local/lib/python3.9/site-packages/nomad/metainfo/metainfo.py", line 2054, in m_create
raise TypeError(
TypeError: There is no subsection to hold a nomad.datamodel.metainfo.simulation.run.Run:Section in nomad.datamodel.datamodel.EntryArchive:Section.
My parser basically looks like this:
from nomad.datamodel import EntryArchive # unused import
from nomad.datamodel.metainfo.simulation.run import Run, Program
from nomad.datamodel.metainfo.simulation.calculation import Calculation
class LightforgeParser():
def parse(self, filepath, archive, logger):
sec_run = archive.m_create(Run)
sec_calc = sec_run.m_create(Calculation)
etc....
I don’t see any mistakes with this, and the parser has been structured like this all the time and it worked in the past. Could someone explain the error? I can provide parser repo if needed.
Thanks in advance and best regards
Fabian