diff --git a/sisl/io/bigdft/ascii.py b/sisl/io/bigdft/ascii.py index cfbe41f39..832e949a8 100644 --- a/sisl/io/bigdft/ascii.py +++ b/sisl/io/bigdft/ascii.py @@ -27,6 +27,7 @@ class asciiSileBigDFT(SileBigDFT): def _setup(self, *args, **kwargs): """ Initialize for `asciiSileBigDFT` """ + super()._setup(*args, **kwargs) self._comment = ['#', '!'] @sile_fh_open() diff --git a/sisl/io/gulp/got.py b/sisl/io/gulp/got.py index 0c7bebdba..1729a9489 100644 --- a/sisl/io/gulp/got.py +++ b/sisl/io/gulp/got.py @@ -35,6 +35,7 @@ class gotSileGULP(SileGULP): def _setup(self, *args, **kwargs): """ Setup `gotSileGULP` after initialization """ + super()._setup(*args, **kwargs) self._keys = dict() self.set_supercell_key('Cartesian lattice vectors') self.set_geometry_key('Final fractional coordinates') diff --git a/sisl/io/openmx/omx.py b/sisl/io/openmx/omx.py index cc1b97db1..ec4149ee3 100644 --- a/sisl/io/openmx/omx.py +++ b/sisl/io/openmx/omx.py @@ -58,6 +58,7 @@ def file(self): def _setup(self, *args, **kwargs): """ Setup the `omxSileOpenMX` after initialization """ + super()._setup(*args, **kwargs) # These are the comments self._comment = ['#'] diff --git a/sisl/io/pdb.py b/sisl/io/pdb.py index 5caf882bd..86b942be5 100644 --- a/sisl/io/pdb.py +++ b/sisl/io/pdb.py @@ -23,6 +23,7 @@ class pdbSile(Sile): def _setup(self, *args, **kwargs): """ Instantiate counters """ + super()._setup(*args, **kwargs) self._model = 1 self._serial = 1 self._wrote_header = False diff --git a/sisl/io/siesta/fdf.py b/sisl/io/siesta/fdf.py index bdf5d839d..22438839e 100644 --- a/sisl/io/siesta/fdf.py +++ b/sisl/io/siesta/fdf.py @@ -96,6 +96,7 @@ class fdfSileSiesta(SileSiesta): def _setup(self, *args, **kwargs): """ Setup the `fdfSileSiesta` after initialization """ + super()._setup(*args, **kwargs) self._comment = ['#', '!', ';'] # List of parent file-handles used while reading diff --git a/sisl/io/siesta/out.py b/sisl/io/siesta/out.py index 3a418c426..14d5a076c 100644 --- a/sisl/io/siesta/out.py +++ b/sisl/io/siesta/out.py @@ -38,10 +38,14 @@ class outSileSiesta(SileSiesta): This enables reading the output quantities from the Siesta output. """ - _completed = None - def readline(self): - line = super().readline() + def _setup(self, *args, **kwargs): + """ Ensure the class has a _completed tag """ + super()._setup(*args, **kwargs) + self._completed = None + + def readline(self, *args, **kwargs): + line = super().readline(*args, **kwargs) if 'Job completed' in line: self._completed = True return line diff --git a/sisl/io/sile.py b/sisl/io/sile.py index 36cc58d57..6f00cbba1 100644 --- a/sisl/io/sile.py +++ b/sisl/io/sile.py @@ -628,8 +628,11 @@ def line_has_keys(line, keys, case=True): return found def __iter__(self): - r""" Iterator for file """ - yield from self.fh + """ Reading the entire content, without regarding comments """ + l = self.readline(comment=True) + while l: + yield l + l = self.readline(comment=True) def readline(self, comment=False): r""" Reads the next line of the file """ diff --git a/sisl/io/table.py b/sisl/io/table.py index ba7435096..11b94324a 100644 --- a/sisl/io/table.py +++ b/sisl/io/table.py @@ -71,6 +71,7 @@ class tableSile(Sile): def _setup(self, *args, **kwargs): """ Setup the `tableSile` after initialization """ + super()._setup(*args, **kwargs) self._comment = ['#'] @sile_fh_open() diff --git a/sisl/io/tbtrans/sile.py b/sisl/io/tbtrans/sile.py index 4996c341a..a0deb2b64 100644 --- a/sisl/io/tbtrans/sile.py +++ b/sisl/io/tbtrans/sile.py @@ -17,6 +17,7 @@ class SileCDFTBtrans(SileCDF): # all netcdf output should not be masked def _setup(self, *args, **kwargs): + super()._setup(*args, **kwargs) # all NetCDF routines actually returns masked arrays # this is to prevent TBtrans CDF files from doing this. if hasattr(self, "fh"): diff --git a/sisl/io/vasp/car.py b/sisl/io/vasp/car.py index 73b79c737..5a90600e8 100644 --- a/sisl/io/vasp/car.py +++ b/sisl/io/vasp/car.py @@ -25,6 +25,7 @@ class carSileVASP(SileVASP): def _setup(self, *args, **kwargs): """ Setup the `carSile` after initialization """ + super()._setup(*args, **kwargs) self._scale = 1. @sile_fh_open() diff --git a/sisl/io/vasp/out.py b/sisl/io/vasp/out.py index de1f628f8..60f53b1c6 100644 --- a/sisl/io/vasp/out.py +++ b/sisl/io/vasp/out.py @@ -14,10 +14,14 @@ @set_module("sisl.io.vasp") class outSileVASP(SileVASP): """ Output file from VASP """ - _completed = None - def readline(self): - line = super().readline() + def _setup(self, *args, **kwargs): + """ Ensure the class has a _completed tag """ + super()._setup(*args, **kwargs) + self._completed = None + + def readline(self, *args, **kwargs): + line = super().readline(*args, **kwargs) if "General timing and accounting" in line: self._completed = True return line diff --git a/sisl/io/wannier90/seedname.py b/sisl/io/wannier90/seedname.py index dad9449cf..02a7f77ee 100644 --- a/sisl/io/wannier90/seedname.py +++ b/sisl/io/wannier90/seedname.py @@ -58,6 +58,7 @@ class winSileWannier90(SileWannier90): def _setup(self, *args, **kwargs): """ Setup `winSileWannier90` after initialization """ + super()._setup(*args, **kwargs) self._comment = ['!', '#'] self._seed = str(self.file).replace('.win', '') diff --git a/sisl/io/xsf.py b/sisl/io/xsf.py index 7ba780bc5..5eb110c7b 100644 --- a/sisl/io/xsf.py +++ b/sisl/io/xsf.py @@ -32,6 +32,7 @@ class xsfSile(Sile): def _setup(self, *args, **kwargs): """ Setup the `xsfSile` after initialization """ + super()._setup(*args, **kwargs) self._comment = ['#'] def _write_key(self, key):