# Path: Echobase/Common/errors.py
# def check_dims(arr, nd):
# def check_type(obj, typ):
# def check_function(obj):
# def check_path(path):
# def make_path(path):
# def check_path_overwrite(path):
# def check_has_key(dictionary, key_ref):


import numpy as np
from mtspec import mt_coherence, mtspec
from scipy.signal import coherence
from ...Common import errors
    functions and then computes coherence between windowed signals.

    Parameters
    ----------
        data: ndarray, shape (T, N)
            Input signal with T samples over N variates

        fs: int
            Sampling frequency

        time_band: float
            The time half bandwidth resolution of the estimate [-NW, NW];
            such that resolution is 2*NW

        n_taper: int
            Number of Slepian sequences to use (Usually < 2*NW-1)

        cf: list
            Frequency range over which to compute coherence [-NW+C, C+NW]

    Returns
    -------
        adj: ndarray, shape (N, N)
            Adjacency matrix for N variates
    """

    # Standard param checks
    errors.check_type(data, np.ndarray)
    errors.check_dims(data, 2)
    errors.check_type(time_band, float)

# Path: Echobase/Common/errors.py
# def check_dims(arr, nd):
# def check_type(obj, typ):
# def check_function(obj):
# def check_path(path):
# def make_path(path):
# def check_path_overwrite(path):
# def check_has_key(dictionary, key_ref):


# Path: Echobase/Network/Functional/coherence.py
import numpy as np
from mtspec import mt_coherence, mtspec
from scipy.signal import coherence
from ...Common import errors

    functions and then computes coherence between windowed signals.

    Parameters
    ----------
        data: ndarray, shape (T, N)
            Input signal with T samples over N variates

        fs: int
            Sampling frequency

        time_band: float
            The time half bandwidth resolution of the estimate [-NW, NW];
            such that resolution is 2*NW

        n_taper: int
            Number of Slepian sequences to use (Usually < 2*NW-1)

        cf: list
            Frequency range over which to compute coherence [-NW+C, C+NW]

    Returns
    -------
        adj: ndarray, shape (N, N)
            Adjacency matrix for N variates
    """

    # Standard param checks
    errors.check_type(data, np.ndarray)
    errors.check_dims(data, 2)
    errors.check_type(time_band, float)

    errors.check_type(n_taper, int)