# 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
import scipy.signal as spsig
from ...Common import errors


def xcorr_mag(data, fs, tau):
    """
    The xcorr_mag function implements a cross-correlation similarity function
    for computing functional connectivity -- maximum magnitude cross-correlation

    This function implements an FFT-based cross-correlation (using convolution).

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

        fs: int
            Sampling frequency

        tau: float
            The max lag limits of cross-correlation in seconds

    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(fs, int)

# 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/correlation.py
import numpy as np
import scipy.signal as spsig
from ...Common import errors



def xcorr_mag(data, fs, tau):
    """
    The xcorr_mag function implements a cross-correlation similarity function
    for computing functional connectivity -- maximum magnitude cross-correlation

    This function implements an FFT-based cross-correlation (using convolution).

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

        fs: int
            Sampling frequency

        tau: float
            The max lag limits of cross-correlation in seconds

    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(fs, int)

    errors.check_type(tau, float)