Skip to content

Commit

Permalink
bug fix results storage
Browse files Browse the repository at this point in the history
  • Loading branch information
tsbinns committed Jun 27, 2023
1 parent aa4598a commit 213e586
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions mne_connectivity/spectral/epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1990,8 +1990,7 @@ def spectral_connectivity_epochs(data, names=None, method='coh', indices=None,
freqs_used = freqs_bands
freqs_used = [[np.min(band), np.max(band)] for band in freqs_used]

if indices is None and not any(this_method in _multivariate_methods for
this_method in method):
if indices is None and not multivariate_con:
# return all-to-all connectivity matrices
# raveled into a 1D array
logger.info(' assembling connectivity matrix')
Expand All @@ -2008,7 +2007,7 @@ def spectral_connectivity_epochs(data, names=None, method='coh', indices=None,
this_con = this_con.reshape((n_signals ** 2,) +
this_con_flat.shape[1:])
con.append(this_con)
# number of nodes in the original data,
# number of nodes in the original data
n_nodes = n_signals

if multivariate_con:
Expand All @@ -2019,23 +2018,13 @@ def spectral_connectivity_epochs(data, names=None, method='coh', indices=None,
# create a list of connectivity containers
conn_list = []
for _con, _patterns, _method in zip(con, patterns, method):
kwargs = dict(data=_con,
patterns=_patterns,
names=names,
freqs=freqs,
method=_method,
n_nodes=n_nodes,
spec_method=mode,
indices=indices,
n_epochs_used=n_epochs,
freqs_used=freqs_used,
times_used=times,
n_tapers=n_tapers,
metadata=metadata,
events=events,
event_id=event_id,
rank=rank,
n_lags=gc_n_lags)
kwargs = dict(
data=_con, patterns=_patterns, names=names, freqs=freqs,
method=_method, n_nodes=n_nodes, spec_method=mode, indices=indices,
n_epochs_used=n_epochs, freqs_used=freqs_used, times_used=times,
n_tapers=n_tapers, metadata=metadata, events=events,
event_id=event_id, rank=rank,
n_lags=gc_n_lags if _method in _gc_methods else None)
# create the connectivity container
if mode in ['multitaper', 'fourier']:
klass = SpectralConnectivity
Expand Down

0 comments on commit 213e586

Please sign in to comment.