# Path: pymzml/decoder.py
# def _decode(data, comp, d_array_length, f_type, d_type):
#     def __init__(self, nb_workers=2):
#     def pool_decode(self, data, callback):
#     def _error_callback(self, result):
# class Decoder:
#         ZE_POOL = Pool(processes=2)


import math
import re
import sys
import warnings
import xml.etree.ElementTree as ElementTree
import zlib
import numpy as np
from base64 import b64decode as b64dec
from collections import defaultdict as ddict
from functools import lru_cache
from operator import itemgetter as itemgetter
from struct import unpack
    from ms_deisotope.deconvolution import deconvolute_peaks
    from ms_peak_picker import simple_peak
from . import regex_patterns
from .decoder import MSDecoder
                f_type = "f"
            elif float_type == "64-bit float":
                f_type = "d"
            fmt = "{endian}{array_length}{float_type}".format(
                endian="<", array_length=d_array_length, float_type=f_type
            )
            ret_data = unpack(fmt, dec_data)
        else:
            ret_data = []
        return ret_data

    def _decodeNumpress_to_array(self, data, compression):
        """
        Decode golomb-rice encoded data (aka numpress encoded data).

        Arguments:
            data (str)        : Encoded data string
            compression (str) : Decompression algorithm to be used
                (valid are 'ms-np-linear', 'ms-np-pic', 'ms-np-slof')

        Returns:
            array (list): Returns the unpacked data as an array of floats.

        """
        result = []
        comp_ms_tags = [self.calling_instance.OT[comp]["id"] for comp in compression]
        data = np.frombuffer(data, dtype=np.uint8)
        if "MS:1002312" in comp_ms_tags:
            result = MSDecoder.decode_linear(data)
        elif "MS:1002313" in comp_ms_tags:

# Path: pymzml/decoder.py
# def _decode(data, comp, d_array_length, f_type, d_type):
#     def __init__(self, nb_workers=2):
#     def pool_decode(self, data, callback):
#     def _error_callback(self, result):
# class Decoder:
#         ZE_POOL = Pool(processes=2)


# Path: pymzml/spec.py
import math
import re
import sys
import warnings
import xml.etree.ElementTree as ElementTree
import zlib
import numpy as np
from base64 import b64decode as b64dec
from collections import defaultdict as ddict
from functools import lru_cache
from operator import itemgetter as itemgetter
from struct import unpack
    from ms_deisotope.deconvolution import deconvolute_peaks
    from ms_peak_picker import simple_peak
from . import regex_patterns
from .decoder import MSDecoder

                f_type = "f"
            elif float_type == "64-bit float":
                f_type = "d"
            fmt = "{endian}{array_length}{float_type}".format(
                endian="<", array_length=d_array_length, float_type=f_type
            )
            ret_data = unpack(fmt, dec_data)
        else:
            ret_data = []
        return ret_data

    def _decodeNumpress_to_array(self, data, compression):
        """
        Decode golomb-rice encoded data (aka numpress encoded data).

        Arguments:
            data (str)        : Encoded data string
            compression (str) : Decompression algorithm to be used
                (valid are 'ms-np-linear', 'ms-np-pic', 'ms-np-slof')

        Returns:
            array (list): Returns the unpacked data as an array of floats.

        """
        result = []
        comp_ms_tags = [self.calling_instance.OT[comp]["id"] for comp in compression]
        data = np.frombuffer(data, dtype=np.uint8)
        if "MS:1002312" in comp_ms_tags:
            result = MSDecoder.decode_linear(data)
        elif "MS:1002313" in comp_ms_tags:

            result = MSDecoder.decode_pic(data)