Skip to content

Commit

Permalink
API: Change default to _cache (#778)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Aug 14, 2023
1 parent a931cae commit 918cc3b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/source/settings/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- random_state
- shortest_event
- memory_location
- memory_subdir
- memory_file_method
- memory_verbose
- config_validation
Expand Down
2 changes: 2 additions & 0 deletions docs/source/v1.5.md.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion mne_bids_pipeline/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions mne_bids_pipeline/_config_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def _import_config(
"interactive",
# Caching
"memory_location",
"memory_subdir",
"memory_verbose",
"memory_file_method",
# Misc
Expand Down
2 changes: 1 addition & 1 deletion mne_bids_pipeline/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 918cc3b

Please sign in to comment.