Source code for ase2sprkkr.outputs.readers.bsf

"""The Bloch spectral functions (BSF) reader and result."""

from ..task_result import TaskResult, KkrOutputReader
from .default import DefaultOutputParser
from ...common.decorators import cached_property


[docs] class BsfResult(TaskResult): """BSF result provides access to the computed Bloch spectral functions in the BSF output file using the :py:attr:`~bsf` property."""
[docs] @cached_property def bsf_filename(self): """Bloch spectral functions file name""" return self.path_to("Bloch-SF")
[docs] @cached_property def bsf(self): """The computed Bloch spectral functions.""" return self._bsf_file.parsed_file()
[docs] @cached_property def _bsf_file(self): try: return self.files.set_file_type("Bloch-SF", "bsf") except KeyError as exc: raise FileNotFoundError("BSF result file is not listed in the SPR-KKR output.") from exc
@property def output_values(self): # Missing BSF outputs should not suppress the other parsed results. if "Bloch-SF" in self.files: self._bsf_file return super().output_values
[docs] class BsfOutputReader(KkrOutputReader): """BSF task has no special parser, it just has a special result, that allow easy acces to BSF output file""" result_class = BsfResult parser_class = DefaultOutputParser