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

Stop loading data when copying unloaded image #982

Merged
merged 3 commits into from
Oct 11, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Add assertions after loading as well
  • Loading branch information
fepegar committed Oct 9, 2022
commit 89aedd8dbbb1cf4c906bab99c4b8838f249e6019
8 changes: 7 additions & 1 deletion tests/data/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,5 +253,11 @@ def test_copy_no_data(self):
path = self.get_image_path('im_copy')
my_image = tio.LabelMap(path)
assert not my_image._loaded
_ = copy.copy(my_image)
new_image = copy.copy(my_image)
assert not my_image._loaded
assert not new_image._loaded

my_image.load()
new_image = copy.copy(my_image)
assert my_image._loaded
assert new_image._loaded