Skip to content

Commit

Permalink
Add docstring for bind method
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Dec 5, 2024
1 parent 85c3545 commit 970e68b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions python/lsst/daf/butler/_labeled_butler_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ def __init__(self, repositories: Mapping[str, str] | None = None) -> None:
self._preload_direct_butler_cache = True

def bind(self, access_token: str | None) -> LabeledButlerFactoryProtocol:
"""Create a callable factory function for generating Butler instances
with out needing to specify access tokans again.
Parameters
----------
access_token : `str` or `None`
An optional access token to use for authentication with the Butler.
Returns
-------
bound : `LabeledButlerFactoryProtocol`
A callable that takes a label as input and returns a Butler
instance.
"""

def create(label: str) -> Butler:
return self.create_butler(label=label, access_token=access_token)

Expand Down

0 comments on commit 970e68b

Please sign in to comment.