braindynamicslab / dyneusr-notebooks

DyNeuSR notebooks and tutorials
https://braindynamicslab.github.io/dyneusr/
4 stars 4 forks source link

Issue about Haxby_fMRI Example #1

Closed garynanxu closed 5 years ago

garynanxu commented 5 years ago

When I try to run the example of 02_haxby_fMRI, there is an error on running "dG = ds.DyNeuGraph(...)". The given error is "'method' object is not subscriptable" from "G=graph", 'self.fit(params)' and 'G = tools.process_graph(G, meta=y, kwargs)' to 'G.edges[(n,nbr)]['distance'] = 100. * (1. / min([G.degree(n), G.degree(nbr)]))'. Current version of dyneusr == 0.3.0 and kmapper==1.2.

calebgeniesse commented 5 years ago

Sorry for the delayed response, but thanks for reporting the issue!

Could you find out what version of networkx you are running? I have a feeling this is a compatibility issue with more recent versions of networkx.

e.g., I think the following line (in dyneusr):

G.edges[(n,nbr)][‘distance’] = ...

needs to be rewritten as

G.edge[n][nbr][‘distance’] = ...

For now, you could just try installing networkx==2.2. But either way, I will try to resolve the issue ASAP and open up a pull request in the dyneusr repo.

Let me know if you have any questions or any other issues in the meantime.

garynanxu commented 5 years ago

Thanks for your response,\ I had networkx == 2.3,\ then I reinstalled networkx == 2.2 and it works,\ Thank you very much!

calebgeniesse commented 5 years ago

No problem, thanks for reporting the issue.

calebgeniesse commented 5 years ago

Btw, I just merged several changes into the master branch of dyneusr (see PR #7) that should help ensure backwards compatibility with older versions (and hopefully, future releases) of networkx.

If you don't mind using networkx==2.2, then feel free to ignore this.

calebgeniesse commented 5 years ago

I am going to close this for now, but feel free to re-open if you have any other related issues.

Thanks again for reporting this, @garynanxu!