Repository: pymzml/pymzML

Issue:
Method pymzml.run.Reader.get_chromatogram_count() does not return chromatogram count
**Describe the bug**

[pymzml.run.Reader.get_chromatogram_count()](https://pymzml.readthedocs.io/en/latest/pymzml_run.html#pymzml.run.Reader.get_chromatogram_count) throws a `KeyError KeyError: 'chromatogram_count'` when I try to get the chromatogram count for the exemplary data [tests/data/example.mzML](https://github.com/pymzml/pymzML/blob/master/tests/data/example.mzML).

**To Reproduce**

With the data file data example.mzML in the same directory as a Jupyter notebook with following cell:

````
import pymzml
import os

current_dir = os.getcwd()
mzml_file_path = current_dir + '/example.mzML'
reader = pymzml.run.Reader( mzml_file_path )
reader.get_chromatogram_count()
````

throws

````
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-36-46dfe74fa1c6> in <module>
----> 1 reader.get_chromatogram_count()

/usr/local/lib/python3.6/dist-packages/pymzml/run.py in get_chromatogram_count(self)
    405             chromatogram count (int): Number of chromatograms in file.
    406         """
--> 407         return self.info["chromatogram_count"]
    408 
    409 

KeyError: 'chromatogram_count'
````

**Expected behavior**

Either (a) count of chromatograms or (b) human readable exception message about API miss-use.

**Screenshots**

n.a.

**Desktop (please complete the following information):**
 - OS: Ubuntu, Docker CE, Docker Container created from [Docker image tensorflow/tensorflow](https://hub.docker.com/r/tensorflow/tensorflow/) with tag `latest-py3-jupyter`
 - Version: `pymzml==2.4.0`

**Additional context**

n.a.


Discussion:

Patch:
diff --git a/pymzml/run.py b/pymzml/run.py
index 1dfddf0..0f35075 100755
--- a/pymzml/run.py
+++ b/pymzml/run.py
@@ -336,6 +336,8 @@ class Reader(object):
             ElementTree.iterparse(self.info["file_object"], events=("end", "start"))
         )  # NOTE: end might be sufficient
         _, self.root = next(mzml_iter)
+        self.info["chromatogram_count"] = None
+        self.info["spectrum_count"] = None
         while True:
             event, element = next(mzml_iter, ("END", "END"))
             if element.tag.endswith("}mzML"):
@@ -365,9 +367,7 @@ class Reader(object):
                 break
             elif element.tag.endswith("}chromatogramList"):
                 chrom_cnt = element.attrib.get("count", None)
-                if chrom_cnt is None:
-                    self.info["chromatogram_count"] = None
-                else:
+                if chrom_cnt:
                     self.info["chromatogram_count"] = int(chrom_cnt)
                 break
             elif element.tag.endswith("}run"):


Test patch:
diff --git a/tests/main_reader_test.py b/tests/main_reader_test.py
index 0d163f2..eabe7a4 100755
--- a/tests/main_reader_test.py
+++ b/tests/main_reader_test.py
@@ -187,13 +187,17 @@ class runTest(unittest.TestCase):
 
     def test_get_spec_count(self):
         self.assertEqual(self.reader_compressed_indexed.get_spectrum_count(), 2918)
-        # self.assertEqual(self.reader_compressed_indexed.getChromatogramCount(), 1) # Failing
         self.assertEqual(self.reader_compressed_unindexed.get_spectrum_count(), 2918)
-        # self.assertEqual(self.reader_compressed_unindexed.getChromatogramCount, 1) # Failing
         self.assertEqual(self.reader_uncompressed_unindexed.get_spectrum_count(), 2918)
-        # self.assertEqual(self.reader_uncompressed_unindexed.getChromatogramCount(), 1) # Failing
         self.assertEqual(self.reader_uncompressed_unindexed.get_spectrum_count(), 2918)
-        # self.assertEqual(self.reader_uncompressed_ununindexed.getChromatogramCount(), 1) # Failing
+
+    def test_chrom_count_chrom_file(self):
+        reader = run.Reader(self.paths[3])
+        self.assertEqual(reader.get_chromatogram_count(), 3)
+
+    def test_chrom_count_spec_file(self):
+        reader = run.Reader(self.paths[0])
+        self.assertEqual(reader.get_chromatogram_count(), None)
 
     def test_readers_remeber_spawned_spectra(self):
         """