Skip to content

FIX: Check against full node name when reconnecting JoinNodes #2479

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

Merged
merged 6 commits into from
Mar 7, 2018

Conversation

effigies
Copy link
Member

@effigies effigies commented Mar 1, 2018

Fixes #2257.

Changes proposed in this pull request

@effigies effigies added this to the 1.0.2 milestone Mar 1, 2018
@satra
Copy link
Member

satra commented Mar 1, 2018

@effigies - this is same as https://github.com/nipy/nipype/pull/1708/files - i'll have to recall all the scenarios where it would break. but hopefully the tests will catch some of them.

i think it has to do with the fact that nipype node id's are hierarchical. a.b.c. ..., so just checking by adding . is insufficient i believe.

@effigies
Copy link
Member Author

effigies commented Mar 1, 2018

Ah, missed that. Was also counting on the tests to verify.

@effigies
Copy link
Member Author

effigies commented Mar 2, 2018

Yes, a valid match either is exactly the node, or has a .aN (through .zN). I pushed a fix that uses a full regular expression src_id + r'([a-z]\d+)?$'. I think this should exhaust the cases that can actually happen. If you can think of a good corner case that might trip us up if we fail, I can add another test.

@effigies
Copy link
Member Author

effigies commented Mar 2, 2018

Okay. I printed out the node type and the names being compared every time we hit that case. It turns out that having IdentityInterfaces as either the iterable Node or the JoinNode had different consequences on the names, so there are a few cases to consider. I think I covered them all. Certainly all of the ones provided by the test suite, though I'll note that the test I added is the first one not to use IdentityInterface as the joinsource.

@satra
Copy link
Member

satra commented Mar 2, 2018

@effigies - the matching looks clean. thanks for pushing this along.

@satra satra merged commit 6dc492d into nipy:master Mar 7, 2018
@effigies effigies deleted the fix/joinnode_connection branch March 7, 2018 15:05
@tclose
Copy link
Contributor

tclose commented Mar 19, 2018

The change

if hasattr(node, 'joinfield'):
    continue

has broken my my pipeline generation code but I don't understand the logic well enough to isolate the problem (my code is quite complex due to it being a general framework). What is the rationale behind this check?

My first thought was that it could be due to the fact that the iterable that the join node joins can be of length one, but when I tried that in the unittest you added I couldn't reproduce it.

@effigies
Copy link
Member Author

effigies commented Apr 2, 2018

Hi @tclose, sorry about that. Could you open an issue referencing this PR? I completely forgot about your comment here, since closed PRs don't show up as active issues.

@tclose
Copy link
Contributor

tclose commented May 15, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with node name that starts with another node's name
3 participants