-
Notifications
You must be signed in to change notification settings - Fork 535
ENH: Make interfaces.utility.Merge(1) merge a list of lists #1390
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
Conversation
Slight amendment: |
2 similar comments
Changes Unknown when pulling 9c88205 on effigies:merge_all into * on nipy:master*. |
Changes Unknown when pulling 9ec3985 on effigies:merge_all into * on nipy:master*. |
Codecov Report
@@ Coverage Diff @@
## master #1390 +/- ##
==========================================
+ Coverage 70.91% 70.93% +0.02%
==========================================
Files 1057 1057
Lines 53363 53383 +20
Branches 7728 7736 +8
==========================================
+ Hits 37843 37868 +25
+ Misses 14139 14137 -2
+ Partials 1381 1378 -3
Continue to review full report at Codecov.
|
12be718
to
e933eb2
Compare
nipype/interfaces/utility/base.py
Outdated
input_names = ['in%d' % (i + 1) for i in range(numinputs)] | ||
elif numinputs == 0: | ||
input_names = ['in_lists'] | ||
else: |
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.
so the only question here is whether this should be for Merge(1)
instead of Merge(0)
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 can do Merge(1)
. The goal was to leave the interface unmodified for any existing uses, but I guess nobody would actually do Merge(1)
as it stands.
If we do, I'd suggest making numinputs
default to 1, so that Merge()
can be useful.
And I can update the doctests to be demonstrative.
sounds good. |
If accumulated list is empty, return as valid, rather than undefined
At present,
Merge()
does nothing, providing an undefinedoutputs.out
. This change allows it to merge a list of lists (inputs.in_lists
) into a single list, rather than enumerating them withinputs.in1 .. inputs.inN
.If no
inputs.in_lists
is set,Merge()
still provides an undefinedoutputs.out
, so we shouldn't break existing code.Merge(n)
forn < 0
is unchanged.