From 918cc3bb1ed69d12cf23e3295eb9b512fc914523 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 14 Aug 2023 16:40:30 -0400 Subject: [PATCH] API: Change default to _cache (#778) --- docs/source/settings/general.md | 1 + docs/source/v1.5.md.inc | 2 ++ mne_bids_pipeline/_config.py | 9 ++++++++- mne_bids_pipeline/_config_import.py | 1 + mne_bids_pipeline/_run.py | 2 +- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/source/settings/general.md b/docs/source/settings/general.md index d0814cce6..2640f5f2b 100644 --- a/docs/source/settings/general.md +++ b/docs/source/settings/general.md @@ -39,6 +39,7 @@ - random_state - shortest_event - memory_location + - memory_subdir - memory_file_method - memory_verbose - config_validation diff --git a/docs/source/v1.5.md.inc b/docs/source/v1.5.md.inc index 14da9b83a..7434586ad 100644 --- a/docs/source/v1.5.md.inc +++ b/docs/source/v1.5.md.inc @@ -12,6 +12,8 @@ [//]: # (### :warning: Behavior changes) +- The default cache directory is now `_cache` within the derivatives folder when using `memory_location=True`, set [`memory_subdir="joblib"`][mne_bids_pipeline._config.memory_subdir] to get the behavior from v1.4 (#778 by @larsoner) + [//]: # (- Whatever (#000 by @whoever)) ### :medical_symbol: Code health diff --git a/mne_bids_pipeline/_config.py b/mne_bids_pipeline/_config.py index 85b0335e1..0ca130754 100644 --- a/mne_bids_pipeline/_config.py +++ b/mne_bids_pipeline/_config.py @@ -2107,7 +2107,14 @@ def noise_cov(bids_path): """ If not None (or False), caching will be enabled and the cache files will be stored in the given directory. The default (True) will use a -`'joblib'` subdirectory in the BIDS derivative root of the dataset. +`"_cache"` subdirectory (name configurable via the +[`memory_subdir`][mne_bids_pipeline._config.memory_subdir] +variable) in the BIDS derivative root of the dataset. +""" + +memory_subdir: str = "_cache" +""" +The caching directory name to use if `memory_location` is `True`. """ memory_file_method: Literal["mtime", "hash"] = "mtime" diff --git a/mne_bids_pipeline/_config_import.py b/mne_bids_pipeline/_config_import.py index 36568b1f2..43f0c3725 100644 --- a/mne_bids_pipeline/_config_import.py +++ b/mne_bids_pipeline/_config_import.py @@ -75,6 +75,7 @@ def _import_config( "interactive", # Caching "memory_location", + "memory_subdir", "memory_verbose", "memory_file_method", # Misc diff --git a/mne_bids_pipeline/_run.py b/mne_bids_pipeline/_run.py index 5908e4b0c..c76126ea2 100644 --- a/mne_bids_pipeline/_run.py +++ b/mne_bids_pipeline/_run.py @@ -123,7 +123,7 @@ class ConditionalStepMemory: def __init__(self, *, exec_params, get_input_fnames, get_output_fnames): memory_location = exec_params.memory_location if memory_location is True: - use_location = exec_params.deriv_root / "joblib" + use_location = exec_params.deriv_root / exec_params.memory_subdir elif not memory_location: use_location = None else: