Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Change default to _cache #778

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading