From 667f73af66df8496f923629dc06771fc607f1790 Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Wed, 5 Feb 2025 16:58:11 +0000 Subject: [PATCH] Update from review --- mne_connectivity/utils/docs.py | 7 ++++--- mne_connectivity/utils/utils.py | 27 ++++++++++++++++++--------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/mne_connectivity/utils/docs.py b/mne_connectivity/utils/docs.py index 31760c4d..a10c7804 100644 --- a/mne_connectivity/utils/docs.py +++ b/mne_connectivity/utils/docs.py @@ -201,9 +201,10 @@ docdict["indices_decoding"] = """ indices : tuple of array_like - A tuple of two arrays, containing the indices of the seed and target channels in the - input data, respectively. The indices of only a single connection (i.e. between one - group of seeds and one group of targets) is supported. + A tuple of two array-likes, containing the indices of the seed and target channels + in the input data, respectively. The indices of only a single connection (i.e. + between one group of seeds and one group of targets) is supported, such that the + array-likes have shape ``(n_seed_channels,)`` and ``(n_target_channels,)``. """ docdict["n_components"] = """ diff --git a/mne_connectivity/utils/utils.py b/mne_connectivity/utils/utils.py index f1765358..875b523a 100644 --- a/mne_connectivity/utils/utils.py +++ b/mne_connectivity/utils/utils.py @@ -91,15 +91,18 @@ def _check_multivariate_indices(indices, n_chans): Parameters ---------- - indices : tuple of array_like of array_like, shape (2, n_cons, variable) - Tuple containing index sets. + indices : tuple of length 2 of array_like + A tuple of two array-likes containing the seed and target indices, respectively, + to use for connectivity computation. Each array-like has ``n_cons`` array-like + entries containing the channel indices for each connection. The number of + channels within each connection can vary. n_chans : int The number of channels in the data. Used when converting negative indices to positive indices. Returns ------- - indices : array of array, shape of (2, n_cons, max_n_chans) + indices : array, shape (2, n_cons, max_n_chans) The padded indices as a masked array. Notes @@ -242,16 +245,22 @@ def seed_target_multivariate_indices(seeds, targets): Parameters ---------- - seeds : array_like, shape (n_unique_seeds, variable) - Indices of signals for which to compute connectivity from. - targets : array_like, shape (n_unique_targets, variable) - Indices of signals for which to compute connectivity to. + seeds : array_like + Indices of signals for which to compute connectivity from. Has + ``n_unique_seeds`` array-like entries containing the channel indices for each + seed. The number of channels within each seed can vary. + targets : array_like + Indices of signals for which to compute connectivity to. Has + ``n_unique_targets`` array-like entries containing the channel indices for each + target. The number of channels within each target can vary. Returns ------- - indices : tuple of length 2 of array, shape (n_cons, variable) + indices : tuple of length 2 of array A tuple of two numpy object arrays containing the seed and target indices, - respectively, to use for connectivity computation. The number of channels within + respectively, to use for connectivity computation. Each array has ``n_cons`` + array entries containing the channel indices for each connection, where + ``n_cons = n_unique_seeds * n_unique_targets``. The number of channels within each connection can vary. Notes