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

Use tmpdir for memmap files instead of the NiMARE data directory #599

Merged
merged 1 commit into from
Jan 5, 2022
Merged
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
6 changes: 1 addition & 5 deletions nimare/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ def use_memmap(logger, n_files=1):
Files generated by this function will be stored in the NiMARE data directory and will be
removed after the wrapped method finishes.
"""
from .extract.utils import _get_dataset_dir

def inner_function(function):
@wraps(function)
Expand All @@ -466,10 +465,7 @@ def memmap_context(self, *args, **kwargs):
self.memmap_filenames, filenames = [], []
for i_file in range(n_files):
start_time = datetime.datetime.now().strftime("%Y%m%dT%H%M%S")
dataset_dir = _get_dataset_dir("temporary_files", data_dir=None)
_, filename = mkstemp(
prefix=self.__class__.__name__, suffix=start_time, dir=dataset_dir
)
_, filename = mkstemp(prefix=self.__class__.__name__, suffix=start_time)
logger.debug(f"Temporary file written to {filename}")
self.memmap_filenames.append(filename)
filenames.append(filename)
Expand Down