Skip to content

Commit

Permalink
Use tmpdir for memmaps. (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo authored Jan 5, 2022
1 parent 46e4e50 commit 49d68fa
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions nimare/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,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 @@ -684,10 +683,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

0 comments on commit 49d68fa

Please sign in to comment.