Skip to content

Commit

Permalink
added .info. to stdoutVasp
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Papior <[email protected]>
  • Loading branch information
zerothi committed Oct 31, 2023
1 parent c0b85d6 commit a6a29c6
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions src/sisl/io/vasp/stdout.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,22 @@
__all__ = ["stdoutSileVASP", "outSileVASP"]


_A = SileVASP.InfoAttr


@set_module("sisl.io.vasp")
class stdoutSileVASP(SileVASP):
""" Output file from VASP """

def _setup(self, *args, **kwargs):
""" Ensure the class has a _completed tag """
super()._setup(*args, **kwargs)
self._completed = None
_info_attributes_ = [
_A("completed", r".*General timing and accounting",
lambda attr, match: lambda : True, default=lambda : False),
]

def readline(self, *args, **kwargs):
line = super().readline(*args, **kwargs)
if "General timing and accounting" in line:
self._completed = True
return line

@sile_fh_open()
@deprecation("stdoutSileVASP.completed is deprecated in favor of stdoutSileVASP.info.completed", "0.16.0")
def completed(self):
""" True if the line "General timing and accounting" was found. """
if self._completed is not True:
self._completed = self.step_to("General timing and accounting")[0]
return self._completed
return self.info.completed()

@sile_fh_open()
def cpu_time(self, flag="General timing and accounting"):
Expand Down

0 comments on commit a6a29c6

Please sign in to comment.