From 49d68fa6ebdc320d382c5cd4982aa39f2eb21c1b Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 5 Jan 2022 16:04:43 -0500 Subject: [PATCH] Use tmpdir for memmaps. (#599) --- nimare/utils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nimare/utils.py b/nimare/utils.py index a09d3da21..aeebbd73d 100755 --- a/nimare/utils.py +++ b/nimare/utils.py @@ -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) @@ -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)