From 3846e44b93aa1e4eca4a4781b3071a49e33c917b Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Sat, 8 Feb 2025 08:37:20 +0000 Subject: [PATCH] Add an option to force re-download sample files --- dkist/data/sample.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dkist/data/sample.py b/dkist/data/sample.py index 06060a60..b230a43f 100644 --- a/dkist/data/sample.py +++ b/dkist/data/sample.py @@ -20,8 +20,13 @@ def __getattr__(name): raise AttributeError(f"module '{__name__}' has no attribute '{name}'") -def download_all_sample_data(): +def download_all_sample_data(overwrite=False): """ Download all sample data at once that has not already been downloaded. + + Parameters + ---------- + overwrite : `bool` + Re-download and overwrite any existing files. """ - return _get_sample_datasets(_SAMPLE_DATASETS.keys()) + return _get_sample_datasets(_SAMPLE_DATASETS.keys(), force_download=not overwrite)