Skip to content

Commit

Permalink
Fixing confusing docstring in hdf5writer method
Browse files Browse the repository at this point in the history
  • Loading branch information
stammler committed Jul 21, 2023
1 parent 064d30f commit 99fbcc2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions simframe/io/writers/hdf5writer.py
Expand Up @@ -156,26 +156,26 @@ def __init__(self, writer):
Writer object to which the reaer belongs."""
super().__init__(writer)

def output(self, filename):
def output(self, output):
"""Reads a single output file.
Parameters
----------
filename : str
Path to filename to be read
output : str or int
Path to filename to be read or number of output
Returns
-------
data : SimpleNamespace
Namespace of data in file."""

if not isinstance(filename, str):
filename = self._writer._getfilename(filename)
if not isinstance(output, str):
output = self._writer._getfilename(output)

if not os.path.isfile(filename):
if not os.path.isfile(output):
raise RuntimeError("File does not exist.")

with h5py.File(filename, "r") as hdf5file:
with h5py.File(output, "r") as hdf5file:
return self._readgroup(hdf5file)

def sequence(self, field):
Expand Down

0 comments on commit 99fbcc2

Please sign in to comment.