Skip to content

Commit

Permalink
chore: update download_cb type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Aug 7, 2024
1 parent d1df792 commit 0d69c26
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/wags_tails/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@
example.
"""
from pathlib import Path
from typing import Callable, Optional
from typing import Callable, Optional, Protocol

from .base_source import DataSource


class _DownloadCallbackType(Protocol):
"""Define type for CustomData ``download_cb`` arg"""

def __call__(self, version: str, outfile: Path) -> None:
...


class CustomData(DataSource):
"""Data acquisition class using custom, user-provided acquisition methods."""

Expand All @@ -23,7 +30,7 @@ def __init__(
src_name: str,
filetype: str,
latest_version_cb: Callable[[], str],
download_cb: Callable[[str, Path], None],
download_cb: _DownloadCallbackType,
data_dir: Optional[Path] = None,
file_name: Optional[str] = None,
versioned: bool = True,
Expand Down

0 comments on commit 0d69c26

Please sign in to comment.