Skip to content

3631 update temp window tests #3633

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

Merged
merged 1 commit into from
Jan 11, 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: 5 additions & 1 deletion monai/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ def _cachecheck(self, item_transformed):
raise e

_item_transformed = self._pre_transform(deepcopy(item_transformed)) # keep the original hashed
if hashfile is not None:
if hashfile is None:
return _item_transformed
try:
# NOTE: Writing to a temporary directory and then using a nearly atomic rename operation
# to make the cache more robust to manual killing of parent process
# which may leave partially written cache files in an incomplete state
Expand All @@ -354,6 +356,8 @@ def _cachecheck(self, item_transformed):
shutil.move(temp_hash_file, hashfile)
except FileExistsError:
pass
except PermissionError: # project-monai/monai issue #3613
pass
return _item_transformed

def _transform(self, index: int):
Expand Down