Skip to content

Commit

Permalink
Use cached getter for reader.
Browse files Browse the repository at this point in the history
Will squash.
  • Loading branch information
TallJimbo committed May 3, 2021
1 parent 9e7db03 commit 8707879
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions python/lsst/obs/base/formatters/fitsExposure.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,18 @@ def __init__(self, *args, **kwargs):
"""Support all parameters."""

@property
@cached_getter
def reader(self):
"""The reader object that backs this Formatter's read operations.
This is constructed on first use and then cached.
"""
if self._reader is None:
self._reader = self._readerClass(self.fileDescriptor.location.path)
return self._reader
return self._readerClass(self.fileDescriptor.location.path)

@property
@cached_getter
def checked_parameters(self):
"""Tthe parameters passed by the butler user, after checking them
"""The parameters passed by the butler user, after checking them
against the storage class and transforming `None` into an empty `dict`
(`dict`).
"""
Expand Down

0 comments on commit 8707879

Please sign in to comment.