Skip to content

Commit

Permalink
Improve docs for mirror session
Browse files Browse the repository at this point in the history
  • Loading branch information
clbarnes committed Jan 3, 2024
1 parent ab06d4a commit 9dfcaab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pymaid/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ class TileStore5(ImageIoStore):
source_client_types = {k: (requests.Session,) for k in tile_stores}
source_client_types[11] = (aiohttp.ClientSession,)

Client = Union[requests.Session, aiohttp.ClientSession]


def select_stack(remote_instance=None) -> Optional[int]:
""""""
Expand Down Expand Up @@ -311,7 +313,7 @@ def __init__(
self.set_mirror(mirror)

def set_mirror_session(
self, mirror: Union[int, str, None], session,
self, mirror: Union[int, str, None], session: Client,
):
"""Set functions which construct the session for fetching image data, per mirror.
Expand All @@ -327,7 +329,7 @@ def set_mirror_session(
----------
mirror : Union[int, str, None]
Mirror, as integer ID, string name, or None to use the one defined on the class.
session : Callable[[], Any]
session : Union[requests.Session, aiohttp.ClientSession]
HTTP session of the appropriate type.
For example, to re-use the ``requests.Session`` from the
global ``CatmaidInstance`` for mirror with ID 1, use
Expand Down

0 comments on commit 9dfcaab

Please sign in to comment.