# Path: pymzml/spec.py
# PROTON = 1.00727646677


import sys
import os
import unittest
import pymzml
import pymzml.run as run
import test_file_paths
import numpy as np
from pymzml.spec import PROTON
        self.assertIsNotNone(scan_time)
        self.assertIsInstance(scan_time, float)
        self.assertEqual(round(scan_time, 4), round(28.96722412109367, 4))
        self.assertEqual(scan_time, scan_time2)

    def test_select_precursors(self):
        selected_precursor = self.spec.selected_precursors
        self.assertIsInstance(selected_precursor[0], dict)
        self.assertIsInstance(selected_precursor[0]["mz"], float)
        self.assertIsInstance(selected_precursor[0]["i"], float)
        self.assertIsInstance(selected_precursor[0]["charge"], int)
        self.assertEqual(
            selected_precursor, [{"mz": 443.711242675781, "i": 0.0, "charge": 2, 'precursor id': None}]
        )

    def test_ion_mode(self):
        assert self.spec['positive scan'] is True

    def test_ion_mode_non_existent(self):
        assert self.spec['negative scan'] is None

    @unittest.skipIf(pymzml.spec.DECON_DEP is False, "ms_deisotope was not installed")
    def test_deconvolute_peaks(self):
        charge = 3
        test_mz = 430.313
        arr = np.array([(test_mz, 100), (test_mz + PROTON / charge, 49)])
        spec = self.Run[2548]
        spec.set_peaks(arr, "centroided")
        decon = spec.peaks("deconvoluted")
        self.assertEqual(len(decon), 1)

# Path: pymzml/spec.py
# PROTON = 1.00727646677


# Path: tests/ms2_spec_test.py
import sys
import os
import unittest
import pymzml
import pymzml.run as run
import test_file_paths
import numpy as np
from pymzml.spec import PROTON

        self.assertIsNotNone(scan_time)
        self.assertIsInstance(scan_time, float)
        self.assertEqual(round(scan_time, 4), round(28.96722412109367, 4))
        self.assertEqual(scan_time, scan_time2)

    def test_select_precursors(self):
        selected_precursor = self.spec.selected_precursors
        self.assertIsInstance(selected_precursor[0], dict)
        self.assertIsInstance(selected_precursor[0]["mz"], float)
        self.assertIsInstance(selected_precursor[0]["i"], float)
        self.assertIsInstance(selected_precursor[0]["charge"], int)
        self.assertEqual(
            selected_precursor, [{"mz": 443.711242675781, "i": 0.0, "charge": 2, 'precursor id': None}]
        )

    def test_ion_mode(self):
        assert self.spec['positive scan'] is True

    def test_ion_mode_non_existent(self):
        assert self.spec['negative scan'] is None

    @unittest.skipIf(pymzml.spec.DECON_DEP is False, "ms_deisotope was not installed")
    def test_deconvolute_peaks(self):
        charge = 3
        test_mz = 430.313
        arr = np.array([(test_mz, 100), (test_mz + PROTON / charge, 49)])
        spec = self.Run[2548]
        spec.set_peaks(arr, "centroided")
        decon = spec.peaks("deconvoluted")
        self.assertEqual(len(decon), 1)

        decon_mz = (test_mz * charge) - charge * PROTON