spectral_connectivity.connectivity.SidednessWarning#
- exception SidednessWarning[source]#
A result is one-sided now, unlike in spectral_connectivity 2.x.
Emitted by
Connectivity.power()when it is called withoutone_sidedon two-sided coefficients. Since 3.0 it returns the one-sided density, with the interior frequency bins doubled, where 2.x returned the two-sided density, so code written for 2.x keeps running and gets values twice as large away from 0 Hz and Nyquist. Passone_sided=Trueorone_sided=Falseto the call to silence it.Also emitted by
Connectivity.global_coherence()on two-sided coefficients: since 3.0 it returns only the non-negative frequencies, labelled byConnectivity.frequencies, where 2.x returned every bin of the two-sided transform, labelled byConnectivity.all_frequencies.This warning is temporary. Each of the two notices appears once per Python session;
warnings.simplefilter("always", SidednessWarning)shows them at every call, and a call made while it is ignored does not count as shown. Silence them withwarnings.filterwarnings("ignore", category=SidednessWarning).By design, a bare
warnings.catch_warnings(record=True)with no filter records nothing once the notice has been shown; addwarnings.simplefilter("always", SidednessWarning)inside it (pytest.warnsdoes the equivalent).