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
Switch from using nibabel InTemporaryDirectory to standard library tmpfile module #2589
Switch from using nibabel InTemporaryDirectory to standard library tmpfile module #2589
Conversation
Thanks for doing this. And thanks for pinging the nibabel GitHub about this as well. I am curious to see if there's some reason I don't know that they implemented it this way. |
Codecov Report
@@ Coverage Diff @@
## master #2589 +/- ##
==========================================
- Coverage 85.04% 84.68% -0.36%
==========================================
Files 129 130 +1
Lines 17613 17752 +139
Branches 2999 3015 +16
==========================================
+ Hits 14979 15034 +55
- Misses 1934 2013 +79
- Partials 700 705 +5
|
Well - as @effigies says in nipy/nibabel#1102 (comment) - once you've accepted the premise in the class name - that the code context involves changing to temporary directory - I don't think there's any other way to implement it. But maybe there is - happy to hear if so. Or you might ask - why write tests that involve changing the directory? I guess there are various reasons - just to save some code for prefixing the path to lots of temporary files, and testing a process that creates something in the working directory, were two things I thought of. |
…or on windows. Switch to using SpooledTemporaryFile to avoid writing to disk if possible as a performance optimization
Hello @jacobdr, Thank you for updating ! Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated at 2022-05-25 17:14:36 UTC |
@skoudoro sorry to take so long to get back to this. Just expanded the test coverage in my most recent commits and we'll see how the tests fare now. I was trying to find a way to not have to write back out to disk for performance reasons but I think that is outside the scope of this ticket... so I kept it pretty low-risk and faithful to the OG implementation |
@matthew-brett @skoudoro can I request a re-review given the changes I made to expand the test coverage please? (also need an approval on the pending GH actions workflow for CI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jacobdr, This PR is almost done, it would be great if you could rebase this PR and address the last comment. |
@skoudoro recent commits:
|
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Thanks @jacobdr for doing this! Thanks @matthew-brett @effigies @arokem for the review. merging |
Closes #2587