Skip to content

Commit

Permalink
Add debug logs for caching behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisherlevine committed Mar 15, 2024
1 parent 28c18cb commit 39b2f74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/lsst/pipe/base/caching_limited_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def get(
if cached := self._cache.get(ref.datasetType.name):
dataset_id, handle = cached

Check warning on line 104 in python/lsst/pipe/base/caching_limited_butler.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/caching_limited_butler.py#L104

Added line #L104 was not covered by tests
if dataset_id == ref.id: # if we do, check it's the right object
self.log.debug("Returning cached dataset %s", ref)
return handle.get(parameters=parameters, storageClass=storageClass)

Check warning on line 107 in python/lsst/pipe/base/caching_limited_butler.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/caching_limited_butler.py#L106-L107

Added lines #L106 - L107 were not covered by tests

obj = self._wrapped.get(ref, parameters=parameters, storageClass=storageClass)

Check warning on line 109 in python/lsst/pipe/base/caching_limited_butler.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/caching_limited_butler.py#L109

Added line #L109 was not covered by tests
Expand All @@ -117,6 +118,7 @@ def get(
copy=ref.datasetType.name not in self._no_copy_on_cache,
),
)
self.log.debug("Cached dataset %s", ref)
return obj

Check warning on line 122 in python/lsst/pipe/base/caching_limited_butler.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/caching_limited_butler.py#L121-L122

Added lines #L121 - L122 were not covered by tests

def getDeferred(

Check warning on line 124 in python/lsst/pipe/base/caching_limited_butler.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/caching_limited_butler.py#L124

Added line #L124 was not covered by tests
Expand Down Expand Up @@ -161,6 +163,7 @@ def put(self, obj: Any, ref: DatasetRef) -> DatasetRef:
copy=ref.datasetType.name not in self._no_copy_on_cache,
),
)
self.log.debug("Cached dataset %s on put", ref)
return self._wrapped.put(obj, ref)

Check warning on line 167 in python/lsst/pipe/base/caching_limited_butler.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/caching_limited_butler.py#L166-L167

Added lines #L166 - L167 were not covered by tests

def pruneDatasets(

Check warning on line 169 in python/lsst/pipe/base/caching_limited_butler.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/caching_limited_butler.py#L169

Added line #L169 was not covered by tests
Expand Down

0 comments on commit 39b2f74

Please sign in to comment.