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

Make sure cooler::File::close() does not attempt to finalize files twice #291

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

robomics
Copy link
Contributor

Finalizing .cool files more than once does not do any harm, however it can result in "scary" warnings such as

The following error occurred while closing file /tmp/4DNFIYECESRC.50000.cool: Unable to create the attribute "assembly": (Attribute) Object already exists
File is likely corrupted or incomplete

So it is best if once finalize() has been called, the _finalize flag is set to false before the file handle is closed for real.

@robomics robomics added the enhancement New feature or request label Oct 15, 2024
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.25%. Comparing base (cda8f37) to head (76384dd).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
...ctk/cooler/include/hictk/cooler/impl/file_impl.hpp 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
- Coverage   79.33%   79.25%   -0.08%     
==========================================
  Files         173      173              
  Lines       17003    17012       +9     
  Branches     2309     2309              
==========================================
- Hits        13489    13483       -6     
- Misses       2513     2522       +9     
- Partials     1001     1007       +6     
Flag Coverage Δ
[tests integration](https://app.codecov.io/gh/paulsengroup/hictk/pull/291/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=paulsengroup) 69.71% <90.90%> (-0.06%)
[tests unittests](https://app.codecov.io/gh/paulsengroup/hictk/pull/291/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=paulsengroup) 77.25% <90.90%> (-0.16%)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@robomics robomics merged commit 069ef5f into main Oct 15, 2024
125 of 126 checks passed
@robomics robomics deleted the fix/remove-warning branch October 15, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant