Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
erikogabrielsson committed Jul 1, 2024
1 parent 9615186 commit f2c7232
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions opentile/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,22 @@ def __init__(

@property
def tiff(self) -> TiffFile:
"""Return the TiffFile object."""
return self._tiff_file

@property
def pages(self) -> TiffPages:
"""Return the pages in the TiffFile."""
return self._tiff_file.pages

@property
def series(self) -> List[TiffPageSeries]:
"""Return the series in the TiffFile."""
return self._tiff_file.series

@property
def filepath(self) -> Path:
"""Return the path to the file."""
return Path(self._tiff_file.filehandle.path)

def read(self, offset: int, bytecount: int) -> bytes:
Expand Down Expand Up @@ -128,6 +132,7 @@ def _read(self, offset: int, bytecount: int):
return self._tiff_file.filehandle.read(bytecount)

def close(self):
"""Close the TiffFile."""
self._tiff_file.close()

def __enter__(self):
Expand Down

0 comments on commit f2c7232

Please sign in to comment.