File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/nomad_simulation_parsers/parsers/octopus Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 44from nomad .parsing .file_parser import ArchiveWriter
55from nomad .parsing .file_parser .mapping_parser import MetainfoParser , TextParser
66from nomad .parsing .parser import MatchingParser
7+ from nomad .utils import get_logger
78from nomad_simulations .schema_packages .general import Program , Simulation
89from structlog .stdlib import BoundLogger
910
1011from nomad_simulation_parsers .schema_packages import octopus
1112
1213from .file_parsers import OutParser
1314
15+ LOGGER = get_logger (__name__ )
16+
1417
1518class OctopusMainfileParser (TextParser ):
19+ # TODO temporary fix for structlog unable to propagate logger
20+ @property
21+ def logger (self ):
22+ return LOGGER
23+
1624 def get_header (self , header : list [list [str ]]) -> dict [str , str ]:
1725 return {key : val for key , val in header .get ('options' , [])}
1826
1927
28+ class OctopusMetainfoParser (MetainfoParser ):
29+ # TODO temporary fix for structlog unable to propagate logger
30+ @property
31+ def logger (self ):
32+ return LOGGER
33+
34+
2035class OctopusArchiveWriter (ArchiveWriter ):
2136 mainfile_parser = OctopusMainfileParser (text_parser = OutParser ())
22- archive_parser = MetainfoParser ()
37+ archive_parser = OctopusMetainfoParser ()
2338
2439 def write_to_archive (self ) -> None :
2540 # Reload the octopus package to update the mapping annotations
You can’t perform that action at this time.
0 commit comments