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

Implement with context for pymzml.run.Reader #185

Closed MKoesters closed 4 years ago

MKoesters commented 4 years ago

the Reader class can now be used as the following:

with pymzml.run.Reader(file) as mzml_reader:
    for spec in mzml_reader:
         # do your processing

this ensures that the underlying file handlers are properly closed

codecov[bot] commented 4 years ago

Codecov Report

Merging #185 into dev will increase coverage by 0.06%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #185      +/-   ##
==========================================
+ Coverage   80.07%   80.13%   +0.06%     
==========================================
  Files          33       33              
  Lines        3789     3796       +7     
==========================================
+ Hits         3034     3042       +8     
+ Misses        755      754       -1
Impacted Files Coverage Δ
pymzml/run.py 86.9% <100%> (+0.92%) :arrow_up:
tests/main_reader_test.py 99.33% <100%> (+0.01%) :arrow_up:

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 beb46b6...fec9f54. Read the comment docs.