Skip to content

Commit

Permalink
mnt: cleaned str handling in fdf
Browse files Browse the repository at this point in the history
  • Loading branch information
zerothi committed May 2, 2022
1 parent fbe65bf commit 16a5a1c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sisl/io/siesta/fdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def _pushfile(self, f):
if self.dir_file(f).is_file():
self._parent_fh.append(self.fh)
self.fh = self.dir_file(f).open(self._mode)
elif self.dir_file(f + '.gz').is_file():
elif self.dir_file(f + ".gz").is_file():
self._parent_fh.append(self.fh)
self.fh = gzip.open(self.dir_file(f + '.gz'), mode='rt')
self.fh = gzip.open(self.dir_file(f + ".gz"), mode="rt")
else:
warn(str(self) + f' is trying to include file: {f} but the file seems not to exist? Will disregard file!')
warn(f"{self!s} is trying to include file: {f} but the file seems not to exist? Will disregard file!")

def _popfile(self):
if len(self._parent_fh) > 0:
Expand Down Expand Up @@ -610,8 +610,8 @@ def read_supercell_nsc(self, *args, **kwargs):
if v is not None:
_track(self.read_supercell_nsc, f"found file {f}")
return v
warn('number of supercells could not be read from output files. Assuming molecule cell '
'(no supercell connections)')
warn("number of supercells could not be read from output files. Assuming molecule cell "
"(no supercell connections)")
return _a.onesi(3)

def _r_supercell_nsc_nc(self, *args, **kwargs):
Expand Down Expand Up @@ -1876,7 +1876,7 @@ def _r_add_overlap(self, parent_call, M):
else:
raise ValueError
except Exception:
warn(str(self) + f" could not succesfully read the overlap matrix in {parent_call}.")
warn(f"{self!s} could not succesfully read the overlap matrix in {parent_call}.")

def read_density_matrix(self, *args, **kwargs):
""" Try and read density matrix by reading the <>.nc, <>.TSDE files, <>.DM (in that order)
Expand Down

0 comments on commit 16a5a1c

Please sign in to comment.