GWeindel / hmp

Repository for the hmp python package
BSD 3-Clause "New" or "Revised" License
32 stars 8 forks source link

Error on plot_topo_timecourse() following PR #88 #89

Closed GWeindel closed 1 year ago

GWeindel commented 1 year ago

The new way of integrating conditions in the plot_topo_timecourse() function breaks previous workflow.

When calling

hmp.visu.plot_bootstrap_results(bootstrapped, info, init_accuracy,
                               epoch_data = accuracy_epoch)

It results in an error

File ~/owncloud/projects/RUGUU/hsmm-mvpy/src/hsmm_mvpy/visu.py:197, in plot_topo_timecourse(channels, estimated, channel_position, init, conds, time_step, ydim, figsize, dpi, magnify, times_to_display, cmap, ylabels, xlabel, max_time, vmin, vmax, title, ax, sensors, skip_channels_computation, contours, event_lines, colorbar, topo_size_scaling)
    195 for iteration in np.arange(n_iter):
    196     times_iteration = times[iteration]*time_step
--> 197     channels_ = channels[iteration,:,:] if not cond_plot else channels[iteration]
    198     n_event = int(sum(np.isfinite(channels_[:,0])))
    199     channels_ = channels_[:n_event,:]

IndexError: too many indices for array: array is 2-dimensional, but 3 were indexed

The fix shouldn't be too complex and I will take a look soon but @jelmerborst you might see where that comes from more easily?

jelmerborst commented 1 year ago

You're not working with the latest code, though I'm not sure that's the problem.

GWeindel commented 1 year ago

OK I'll update and will check whether your latest commit happens to fix that

On Tue, 5 Sept 2023 at 11:38, Jelmer Borst @.***> wrote:

You're not working with the latest code, though I'm not sure that's the problem.

— Reply to this email directly, view it on GitHub https://github.com/GWeindel/hsmm_mvpy/issues/89#issuecomment-1706280771, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3LE57RCEBZOLAFHSGL4QTXY3XILANCNFSM6AAAAAA4LPMNC4 . You are receiving this because you authored the thread.Message ID: @.***>