-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_viz.py failure with "ValueError: Masked arrays must be 1-D" #207
Comments
This is a regression and the offending commit is ace0167. The function used is not a drop in replacement, as it renders a
Probably adding a ".A" after /cc: @effigies |
It looks like networkx changed behavior at 3.0, as |
I think it would be feasible to use the to_numpy_array function.
Trying to apply that to the source code with the below patch --- nitime.orig/nitime/viz.py
+++ nitime/nitime/viz.py
@@ -680,7 +680,7 @@
# Build a 'weighted degree' array obtained by adding the (absolute value)
# of the weights for all edges pointing to each node:
- amat = nx.adjacency_matrix(G).todense() # get a normal array out of it
+ amat = nx.to_numpy_array(G) # get a normal array out of it
degarr = abs(amat).sum(0) # weights are sums across rows
# Map the degree to the 0-1 range so we can use it for sizing the nodes. Note that I have not checked the typing actually needed, so Thank you both for your help! |
Excellent! Would you care to submit your patch as a PR? |
As seen in nitime github issue nipy#207, fixing the deprecation of adj_matrix with adjacency_matrix in networkx 3.0 caused a regression in test_viz.py when running with the slightly older networkx 2.8.8. Per Chris' suggestion, this patch abandons the approach of using adjacent matrix methods for the more generic to_numpy_array, which works unchanged for both networks 2.8.8 and 3.0 onwards. Thanks: Nilesh Patra and Chris Markiewicz Signed-off-by: Étienne Mollier <emollier@debian.org>
Here you go. :) |
Closed by #208 |
Good day,
I'm trying to upgrade nitime on Debian unstable to the version
tagged 0.10.1, but when I run the test suite, I'm getting the
following failure:
My test bed runs the following software versions:
In case that matters, I see the skips when running in continuous
integration context in test_viz.py, and it is quite possible my
test bed shares some similarities with such context. What was
the rationale, if that matters?
Have a nice day, :)
Étienne.
The text was updated successfully, but these errors were encountered: