From 598c19a195f3a57b3e1a470dc2001110654aac4d Mon Sep 17 00:00:00 2001 From: xuefei-wang Date: Thu, 30 Jul 2026 08:09:40 -0700 Subject: [PATCH] Return the downloaded path from the deepcell-types download helpers `download_deepcell_types_baseline` (added in this PR) returns the list of local paths, but `download_deepcell_types_model` / `_data` dropped `fetch_data`'s return value, so callers had no supported way to locate the file they just downloaded. deepcell-types' public `download_model()` / `download_training_data()` are documented to return a `pathlib.Path`; without this they must guess the filename by globbing `~/.deepcell`, which does not work for version keys that differ from the asset filename (e.g. `2026-06-23-ptft` -> `deepcell-types_2026-06-23_resmlp_ptft.pt`). Returning a value where `None` was returned before is backwards compatible. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Sy8eiMVmmQHXRAccKwzAyz --- deepcell_auth/_download.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/deepcell_auth/_download.py b/deepcell_auth/_download.py index f180f0f..62274ee 100644 --- a/deepcell_auth/_download.py +++ b/deepcell_auth/_download.py @@ -79,6 +79,11 @@ def download_deepcell_types_model(version=None): - '2026-06-23-ptft' - '2025-06-09' (legacy; use with matching historical commit) - '2025-06-09_public-data-only' (legacy) + + Returns + ------- + pathlib.Path + Local path to the downloaded checkpoint. """ from ._auth import load_manifest, fetch_data @@ -93,7 +98,7 @@ def download_deepcell_types_model(version=None): f"Version {version} not found. Available versions: {list(dct_models)}" ) - fetch_data( + return fetch_data( record["asset_key"], cache_subdir="models", file_hash=record["asset_hash"] ) @@ -150,6 +155,11 @@ def download_deepcell_types_data(version=None): published version will be downloaded. Available versions: - 1.1 (latest) + + Returns + ------- + pathlib.Path + Local path to the downloaded archive. """ from ._auth import load_manifest, fetch_data @@ -164,7 +174,7 @@ def download_deepcell_types_data(version=None): f"Version {version} not found. Available versions: {list(dct_datasets)}" ) - fetch_data(record["asset_key"], cache_subdir="data") + return fetch_data(record["asset_key"], cache_subdir="data") def download_cellsam_evaluation_dataset(version=None): """Download the evaluation data for the CellSAM model.