pymzml / pymzML

pymzML - an interface between Python and mzML Mass spectrometry Files
https://pymzml.readthedocs.io/en/latest/
MIT License
162 stars 92 forks source link

Add 'close' function to reader class #170

Closed RJMW closed 4 years ago

RJMW commented 4 years ago

This makes it easier to close the file_object handle https://github.com/pymzml/pymzML/blob/7f01356d409b77c809eb751431064ff5c5ba64bc/pymzml/run.py#L114 and avoids ResourceWarning:unclosed file errors when you loop through a list of mzml files or when you 'reload' the reader object.

codecov[bot] commented 4 years ago

Codecov Report

Merging #170 into dev will increase coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##              dev    #170      +/-   ##
=========================================
+ Coverage   83.19%   83.2%   +0.01%     
=========================================
  Files          32      32              
  Lines        3505    3543      +38     
=========================================
+ Hits         2916    2948      +32     
- Misses        589     595       +6
Impacted Files Coverage Δ
pymzml/run.py 86.06% <100%> (-0.44%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c88f557...b4def9d. Read the comment docs.

MKoesters commented 4 years ago

Perfect, thank you :)