spectral_connectivity.connectivity.DirectedOrientationWarning#
- exception DirectedOrientationWarning[source]#
A directed measure’s orientation differs from spectral_connectivity 2.x.
Emitted by the
Connectivitymethods that returned[..., target, source]in 2.x and now return[..., source, target], and bymultitaper_connectivity()andconnectivity_to_xarray()when they compute pairwise or subset spectral Granger prediction, whosesel(source=a, target=b)wasb -> ain 2.x (the 2.x wrapper rejected the transfer-function measures). Code written for 2.x keeps running but reads the opposite direction. This warning is temporary. It appears once per Python session for each measure: once for calls through the wrappers (aboutsel(source, target)) and once for calls to theConnectivitymethod (about the array’s axes).warnings.simplefilter("always", DirectedOrientationWarning)shows it at every call; a call made while it is ignored does not count as shown. Silence it, without hiding other warnings, withwarnings.filterwarnings("ignore", category=DirectedOrientationWarning).By design, a bare
warnings.catch_warnings(record=True)with no filter records nothing once the notice has been shown; addwarnings.simplefilter("always", DirectedOrientationWarning)inside it (pytest.warnsdoes the equivalent).