-
Notifications
You must be signed in to change notification settings - Fork 529
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
[ENH] update for networkx dev version (should fix #2159) #2171
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2171 +/- ##
==========================================
- Coverage 72.28% 72.24% -0.05%
==========================================
Files 1171 1171
Lines 58622 58626 +4
Branches 8433 8434 +1
==========================================
- Hits 42377 42352 -25
- Misses 14887 14918 +31
+ Partials 1358 1356 -2
Continue to review full report at Codecov.
|
At a glance, this looks reasonable to me, but I'm not as conversant with networkx as I'd like to be to sign off on this. We're starting to run up against this issue in our tests, so hopefully this can go in soon. |
@djarecka could you merge master? I can set fmriprep to running with this branch, which should at least smoke test most of these changes (and get our tests working agaiin). |
…(*) in a few places (nodes_iter, in_edges_iter, etc., dont exist in ver 2, but nodes, in_edges, etc., are iterators); had to add .copy to .subgraph for ver 2 (otherwise its a view), but had to keep original code for ver 1
…more (so changed to **dict); some updates related to changes in .nodes method (its not a list anymore)
…ve no tests, so no idea if changes work
…they have no tests, so no idea if changes work
@effigies - i'm trying quickly to check the error. It works fine on a few environments on my OSX and i noticed that python complains about |
Need to switch Edit: Actually, here are all the instances of pydotplus: https://github.com/nipy/nipype/search?utf8=%E2%9C%93&q=pydotplus&type= |
@effigies thanks, i indeed installed |
Realizing that switching from pydotplus to pydot is going to break compatibility with networkx < 2. @satra is this okay (in which case we should update the minimum networkx), or should we have both Also, we should set the minimum version on |
@effigies : I tried to write my PR in a way that it works with |
That's reasonable. It just assumes that we care enough about supporting multiple versions of networkx. |
Can you sync the networkx min versions, while you're at it? (rtd_)requirements says 1.7, info says 1.9. I'm assuming info is correct. |
changed it. regarding multiple versions support, the 2.0 is brand new (I was using dev version for my PR), so @satra wanted to support them both. Not sure for how long we want to do it, but my point was that in this PR I did try to check my changes with both versions, so we can just keep |
Sounds good. If this passes (and nipreps/niworkflows#196, nipreps/fmriprep#723), I'm 👍 for merging as is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Downstream tests are passing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested this with both networkx 1.x and 2.x and worked. Great job @djarecka !
On your branch: $ git grep "package_check('networkx"
examples/dmri_dtk_dti.py:package_check('networkx', '1.0', 'tutorial1')
examples/dmri_dtk_odf.py:package_check('networkx', '1.0', 'tutorial1')
examples/dmri_fsl_dti.py:package_check('networkx', '1.0', 'tutorial1')
examples/fmri_slicer_coregistration.py:package_check('networkx', '1.0', 'tutorial1')
nipype/pipeline/engine/utils.py:package_check('networkx', '1.3')
nipype/pipeline/engine/workflows.py:package_check('networkx', '1.3')
nipype/utils/misc.py: package_check('networkx', '1.0', 'tutorial1') We probably don't need any of those. |
I don't understand what's changed to cause afni.preprocess.Hist to repeatedly stall. |
@effigies - i have restarted the build several times yesterday with the same result, and it's only happening on 3.6. i'll build a neurodocker environment locally to test. |
The new code should work with both versions -- ver 1.x and 2.x (dev).
summary of changes:
*_iter
has been removed, changingnodes_iter
tonodes
, etc.nodes
gives dict-likeNodeView
(iterate or change to list first to access a specific element).node
has been removed, changing tonodes[node]
add_node
andadd_edge
don't haveattr_dict
anymore, have to change**dict
subgraph
gives a view and.copy()
has different depth, created two versions of this part . Suggestions how to simplify are welcome, don't understand all details of those various copies.Note, I changed also
interfaces.cmtk
, but don't have any tests, so don't know if it works.Edit (by @effigies):
Closes #2159
Closes #2194