<commit_before>"""
Class for reading data from Neuralynx files.
This IO supports NCS, NEV and NSE file formats.

Depends on: numpy

Supported: Read

Author: <NAME>, <NAME>
"""

from neo.io.basefromrawio import BaseFromRaw
from neo.rawio.neuralynxrawio.neuralynxrawio import NeuralynxRawIO


class NeuralynxIO(NeuralynxRawIO, BaseFromRaw):
    """
    Class for reading data from Neuralynx files.
    This IO supports NCS, NEV, NSE and NTT file formats.

    NCS contains signals for one channel
    NEV contains events
    NSE contains spikes and waveforms for mono electrodes
    NTT contains spikes and waveforms for tetrodes
    """
    _prefered_signal_group_mode = 'group-by-same-units'
    mode = 'dir'

    def __init__(self, dirname='', filename='', use_cache=False, cache_path='same_as_resource',
                 exclude_filename=None, keep_original_times=False):
        """
        Initialise IO instance

        Parameters
        ----------
        dirname : str
            Directory containing data files
        use_cache : bool, optional
            Cache results of initial file scans for faster loading in subsequent runs.
            Default: False
        cache_path : str, optional
            Folder path to use for cache files.
            Default: 'same_as_resource'
        exclude_filename: str or list<commit_msg>[neuralynx] add missing docstring parameter<commit_after>"""
Class for reading data from Neuralynx files.
This IO supports NCS, NEV and NSE file formats.

Depends on: numpy

Supported: Read

Author: <NAME>, <NAME>
"""

from neo.io.basefromrawio import BaseFromRaw
from neo.rawio.neuralynxrawio.neuralynxrawio import NeuralynxRawIO


class NeuralynxIO(NeuralynxRawIO, BaseFromRaw):
    """
    Class for reading data from Neuralynx files.
    This IO supports NCS, NEV, NSE and NTT file formats.

    NCS contains signals for one channel
    NEV contains events
    NSE contains spikes and waveforms for mono electrodes
    NTT contains spikes and waveforms for tetrodes
    """
    _prefered_signal_group_mode = 'group-by-same-units'
    mode = 'dir'

    def __init__(self, dirname='', filename='', use_cache=False, cache_path='same_as_resource',
                 exclude_filename=None, keep_original_times=False):
        """
        Initialise IO instance

        Parameters
        ----------
        dirname : str
            Directory containing data files
        filename : str
            Name of a single ncs, nse, nev, or ntt file to include in dataset. Will be ignored,
            if dirname is provided.
        use_cache : bool, optional
            Cache results of initial file scans for faster loading in subsequent runs.
            Default: False
        cache_path : str, optional
            Folder path to use for cache files.
            Default: 'same_as_resource'
        exclude_filename: str or list
{'fraction_non_alphanumeric': 0.06861720654824104, 'fraction_numerical': 0.0, 'mean_word_length': 2.677336747759283, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3060639', 'n_tokens_mistral': 822, 'n_tokens_neox': 780, 'n_words': 290}