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

Conversation

fepegar
Copy link
Owner

@fepegar fepegar commented Oct 9, 2022

Fixes #974.

@dmus, can you please take a look?

@codecov
Copy link

codecov bot commented Oct 9, 2022

Codecov Report

Merging #982 (89aedd8) into main (aab9f14) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #982      +/-   ##
==========================================
+ Coverage   86.13%   86.15%   +0.01%     
==========================================
  Files          92       92              
  Lines        5793     5798       +5     
==========================================
+ Hits         4990     4995       +5     
  Misses        803      803              
Impacted Files Coverage Δ
src/torchio/constants.py 100.00% <100.00%> (ø)
src/torchio/data/image.py 88.91% <100.00%> (+0.10%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dmus
Copy link
Contributor

dmus commented Oct 11, 2022

@fepegar changes look good.

only minor comment is access to the private attribute _loaded outside the class, but not really part of this merge request

@fepegar
Copy link
Owner Author

fepegar commented Oct 11, 2022

Do you mean in the tests? I think that's fine, right?

@dmus
Copy link
Contributor

dmus commented Oct 11, 2022

yes, in the test. If python would have real support for private/protected attribute it is not even possible to access it in the test. See also comment here for example: https://stackoverflow.com/questions/1093020/unit-testing-and-checking-private-variable-value

But minor detail, not really important here I think

@fepegar
Copy link
Owner Author

fepegar commented Oct 11, 2022

Alright, thanks for reviewing and for sharing the link. I'll leave it like this as it still is an attribute that shouldn't be needed in the API, and we're just checking that the internals of the class look as they should.

I'll merge in a minute.

@fepegar fepegar merged commit 134fa4a into main Oct 11, 2022
@fepegar fepegar deleted the 974-image-data-loaded-copy branch October 11, 2022 21:42
@fepegar
Copy link
Owner Author

fepegar commented Oct 11, 2022

Thanks for your contribution, @dmus!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image get loading when __copy__ is called
2 participants