From a615363eba1c88755f579405b1376b5adb216191 Mon Sep 17 00:00:00 2001 From: JosePizarro3 Date: Mon, 23 Sep 2024 13:28:32 +0200 Subject: [PATCH] Fix mypy --- src/nomad_parser_wannier90/parsers/__init__.py | 1 - src/nomad_parser_wannier90/parsers/parser.py | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nomad_parser_wannier90/parsers/__init__.py b/src/nomad_parser_wannier90/parsers/__init__.py index fe52b12..f9e2db5 100644 --- a/src/nomad_parser_wannier90/parsers/__init__.py +++ b/src/nomad_parser_wannier90/parsers/__init__.py @@ -28,7 +28,6 @@ def load(self): description='Entry point for the Wannier90 parser.', python_package='nomad_parser_wannier90.parsers', parser_class_name='nomad_parser_wannier90.parsers.parser.Wannier90Parser', - # parser_as_interface=False, # in order to use `child_archives` and auto workflows level=1, mainfile_contents_re=r'\|\s*WANNIER90\s*\|', ) diff --git a/src/nomad_parser_wannier90/parsers/parser.py b/src/nomad_parser_wannier90/parsers/parser.py index 8c5fcc6..4915f5f 100644 --- a/src/nomad_parser_wannier90/parsers/parser.py +++ b/src/nomad_parser_wannier90/parsers/parser.py @@ -189,6 +189,8 @@ def __init__(self, *args, **kwargs): 'Nband': 'n_bloch_bands', } + self._child_archives = {} + def init_parser(self, logger: 'BoundLogger') -> None: """ Initialize the `WOutParser` with the mainfile and logger. @@ -530,7 +532,7 @@ def parse( dft_files = self.workflow_dft_files(filename=self.mainfile) if len(dft_files) == 1: dft_path = dft_files[-1].split('raw/')[-1] - filepath_stripped = self.filepath.split('raw/')[-1] + filepath_stripped = self.mainfile.split('raw/')[-1] try: # For automatic workflows from nomad.app.v1.models import MetadataRequired