Skip to content

Commit

Permalink
Add docs for CachingLimitedButler
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisherlevine committed Mar 15, 2024
1 parent 4a6ea8e commit cc117d1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions python/lsst/pipe/base/caching_limited_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,32 @@


class CachingLimitedButler(LimitedButler):

Check warning on line 47 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#L47

Added line #L47 was not covered by tests
"""A `LimitedButler` that caches datasets.
A `CachingLimitedButler` caches on both `.put()` and `.get()`, and holds a
single instance of the most recently used dataset type for that put/get.
The dataset types which will be cached on put/get are controlled via the
`cache_on_put` and `cache_on_get` attributes, respectively.
By default, copies of the cached items are returned on `get`, so that code
is free to operate on data in-place. A `no_copy_on_cache` attribute also
exists to tell the `CachingLimitedButler` not to return copies when it is
known that the calling code can be trusted not to change values, e.g. when
passing calibs to `isrTask`.
Parameters
----------
wrapped : `LimitedButler`
The butler to wrap.
cache_on_put : `set` [`str`], optional
The dataset types to cache on put.
cache_on_get : `set` [`str`], optional
The dataset types to cache on get.
no_copy_on_cache : `set` [`str`], optional
The dataset types for which to not return copies when cached.
"""

def __init__(

Check warning on line 74 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#L74

Added line #L74 was not covered by tests
self,
wrapped: LimitedButler,
Expand Down

0 comments on commit cc117d1

Please sign in to comment.