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

FIX: Close files in case of reader failure #445

Merged
merged 2 commits into from
Apr 21, 2023

Conversation

nkeim
Copy link
Contributor

@nkeim nkeim commented Apr 7, 2023

This fixes #416 by ensuring that files opened by the NorPix and cine readers are closed promptly if there's a problem during initialization (e.g. invalid file format).

@codecov-commenter
Copy link

codecov-commenter commented Apr 7, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.04 🎉

Comparison is base (85b1adc) 78.07% compared to head (2806b51) 78.12%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #445      +/-   ##
==========================================
+ Coverage   78.07%   78.12%   +0.04%     
==========================================
  Files          31       31              
  Lines        4516     4525       +9     
==========================================
+ Hits         3526     3535       +9     
  Misses        990      990              
Impacted Files Coverage Δ
pims/cine.py 64.73% <100.00%> (+0.30%) ⬆️
pims/imageio_reader.py 85.00% <100.00%> (+0.46%) ⬆️
pims/norpix_reader.py 87.50% <100.00%> (+0.28%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@nkeim
Copy link
Contributor Author

nkeim commented Apr 8, 2023

The problem in #416 was quite reproducible and really is fixed by this PR, but I've also seen similar sporadic failures with TestVideo_ImageIO.test_simple_negative_index. The second commit didn't seem to help.

@GenevieveBuckley
Copy link
Contributor

The problem in #416 was quite reproducible and really is fixed by this PR

This is great!

but I've also seen similar sporadic failures with TestVideo_ImageIO.test_simple_negative_index. The second commit didn't seem to help.

Perhaps it is worth opening an issue specifically for this? This PR already fixes one thing, I don't want to see it blocked because it doesn't fix everything.

@nkeim nkeim merged commit 3183c49 into soft-matter:main Apr 21, 2023
@nkeim nkeim deleted the fix-bioformats-seq branch April 21, 2023 19:18
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.

Failing tests in test_bioformats.py
3 participants