File covariance.py
has 673 lines of code (exceeds 250 allowed). Consider refactoring. Open
import warnings
from functools import wraps
import numpy as np
from scipy.linalg import block_diag
Function cross_spectrum
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def cross_spectrum(X, window=128, overlap=0.75, fmin=None, fmax=None, fs=None):
"""Compute the complex cross-spectral matrices of a real signal X.
Parameters
----------
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function covariance_mest
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def covariance_mest(X, m_estimator, *, init=None, tol=10e-3, n_iter_max=50,
assume_centered=False, q=0.9, nu=5, norm="trace"):
r"""Robust M-estimators.
Robust M-estimator based covariance matrix [1]_, computed by fixed point
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function coherence
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def coherence(X, window=128, overlap=0.75, fmin=None, fmax=None, fs=None,
coh='ordinary'):
"""Compute squared coherence.
Parameters
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function covariance_mest
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def covariance_mest(X, m_estimator, *, init=None, tol=10e-3, n_iter_max=50,
Function coherence
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def coherence(X, window=128, overlap=0.75, fmin=None, fmax=None, fs=None,
Function cospectrum
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def cospectrum(X, window=128, overlap=0.75, fmin=None, fmax=None, fs=None):
Function cross_spectrum
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def cross_spectrum(X, window=128, overlap=0.75, fmin=None, fmax=None, fs=None):
Function eegtocov
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def eegtocov(sig, window=128, overlapp=0.5, padding=True, estimator="cov"):
Function normalize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def normalize(X, norm):
"""Normalize a set of square matrices, using corr, trace or determinant.
Parameters
----------
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"