numpy.dtype size changed - problems with mne_connectivity.viz & plot_connectivity_circle

Hi I’m using MAc OS 14.6.1, python 3.9, and MNE 2.0.2

I’m using code from about a year ago to visualise connectivity from the brain stem to the cortices, subcortical nodes and cerebellum, and a year ago everything was working sweet.

I put new data in to the code ( see below) and I get a weird numpy.dtype error - how can I correct this?

from mne_connectivity.viz import plot_connectivity_circle
import numpy as np

N = 50 # number of nodes
node_names = np.array([f"POST_R_ROI",“CO”,“ENT”,“PHG”,“SCA”,“FO”,“AORG”,“FRP”,“GRE”,“LORG”,“MFC”,“MFG”,“MORG”,“MSFG”,“OPIFG”,“ORIFG”,“PORG”,“SFG”,“TRIFG”,“SMC”,“ANG”,“MPOG”,“PCU”,“PO”,“POG”,“SMG”,“SPL”,“CALC”,“CUN”,“IOG”,“LIG”,“MOG”,“OCP”,“OFUG”,“SOG”,“FUG”,“ITG”,“MTG”,“PP”,“PT”,“STG”,“TMP”,“TTG”,“ACGG”,“MCGG”,“PCGG”,“AINS”,“PINS”,“MPRG”,“PRG”])
data = [0,0.00755, 0.22082, 0.06695, 0.00643, 0.0152, 0.1995, 0.44726, 0.03444, 0.25205, 0.00856, 0.13468, 0.04431, 0.12279, 0.12097, 0.145, 0.00162, 0.34934, 0.19399, 0.22501, 0.05337, 0.24029, 0.12513, 0.0065, 0.11859, 0.02853, 0.12773, 0.08722, 0.08507, 0.04618, 0.04967, 0.1102, 0.20067, 0.03488, 0.24447, 0.02584, 0.0438, 0.03683, 0.03711, 0.01083, 0.02147, 0.13914, 0.00823, 0.01888, 0.03706, 0.0525, 0.03285, 0.05341, 0.10767, 0.22075]
data = np.array(data)

edges = (np.array([0]*N),np.array(range(N))+1)
fig, axes = plot_connectivity_circle(data, node_names, indices=edges, linewidth = 2.0, node_edgecolor = [‘white’], colorbar=True, colormap = ‘bwr’, facecolor=‘white’, textcolor =‘black’, node_linewidth= 2, node_width= 20, vmin=-0.25, vmax=0.25, title = ‘Right_Post_to_Whole_Cortex’)

fig.savefig(“TOTAL_Oct_24_Posterior_Right_ROI_Whole_Cortex.pdf”)

Many thanks

Hi,

I don’t get an error like this on up-to-date MNE and MNE-Connectivity versions. Please could you provide some more info on your package versions so we can try to replicate this:

  • MNE (you listed 2.0.2, but the most recent is 1.8)
  • MNE-Connectivity
  • NumPy

The exact error message would also help a lot.

Best,
Thomas