Skip to content

Commit f664af4

Browse files
committed
Remove support for dsl1 multi into
Signed-off-by: Paolo Di Tommaso <[email protected]>
1 parent 4af2b1f commit f664af4

File tree

6 files changed

+34
-59
lines changed

6 files changed

+34
-59
lines changed

modules/nextflow/src/main/groovy/nextflow/dag/DAG.groovy

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,11 @@ class DAG {
253253

254254
def result = []
255255
for(OutParam p :outputs) {
256-
if( p instanceof DefaultOutParam ) break
257-
for(Object it : p.outChannels) {
256+
if( p instanceof DefaultOutParam )
257+
break
258+
final it = p.getOutChannel()
259+
if( it!=null )
258260
result << new ChannelHandler(channel: it, label: p instanceof TupleOutParam ? null : p.name)
259-
}
260261
}
261262

262263
return result

modules/nextflow/src/main/groovy/nextflow/processor/TaskProcessor.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,8 +1397,8 @@ class TaskProcessor {
13971397

13981398
protected void bindOutParam( OutParam param, List values ) {
13991399
log.trace "<$name> Binding param $param with $values"
1400-
def x = values.size() == 1 ? values[0] : values
1401-
for( def it : param.getOutChannels() ) { it.bind(x) }
1400+
final x = values.size() == 1 ? values[0] : values
1401+
param.getOutChannel()?.bind(x)
14021402
}
14031403

14041404
protected void collectOutputs( TaskRun task ) {

modules/nextflow/src/main/groovy/nextflow/script/params/OutParam.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ interface OutParam extends Cloneable {
5050
*/
5151
DataflowWriteChannel getOutChannel()
5252

53-
@Deprecated List<DataflowWriteChannel> getOutChannels()
54-
5553
short getIndex()
5654

5755
@Deprecated Mode getMode()

modules/nextflow/src/main/groovy/nextflow/script/params/OutputsList.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class OutputsList implements List<OutParam>, Cloneable {
4141

4242
List<DataflowWriteChannel> getChannels() {
4343
final List<DataflowWriteChannel> result = new ArrayList<>(target.size())
44-
for(OutParam param : target) { result.addAll(param.getOutChannels()) }
44+
for(OutParam param : target) { result.add(param.getOutChannel()) }
4545
return result
4646
}
4747

modules/nextflow/src/test/groovy/nextflow/dag/DAGTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ class DAGTest extends Specification {
296296
pInList.add( ip1 )
297297

298298
def pOutList = new OutputsList()
299-
def op1 = Mock(OutParam) { getOutChannels() >> [chE] }
299+
def op1 = Mock(OutParam) { getOutChannel() >> chE }
300300
pOutList.add( op1 )
301301

302302
when:

modules/nextflow/src/test/groovy/nextflow/script/params/ParamsOutTest.groovy

Lines changed: 26 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ class ParamsOutTest extends Specification {
130130
process foo {
131131
output:
132132
val one into a
133-
val two into p, q
134-
file 'three' into b
135-
file 'four' into x,y,z
133+
file 'two' into b
136134
return ''
137135
}
138136
'''
@@ -142,31 +140,17 @@ class ParamsOutTest extends Specification {
142140
when:
143141
def process = parseAndReturnProcess(text, binding)
144142
def out0 = (ValueOutParam)process.config.getOutputs().get(0)
145-
def out1 = (ValueOutParam)process.config.getOutputs().get(1)
146-
def out2 = (FileOutParam)process.config.getOutputs().get(2)
147-
def out3 = (FileOutParam)process.config.getOutputs().get(3)
143+
def out1 = (FileOutParam)process.config.getOutputs().get(1)
148144

149145
then:
150-
process.config.getOutputs().size() == 4
146+
process.config.getOutputs().size() == 2
151147

152148
out0.name == 'one'
153-
out0.getOutChannels().size()==1
154-
out0.getOutChannels().get(0) instanceof DataflowQueue
155-
156-
out1.name == 'two'
157-
out1.getOutChannels().size()==2
158-
out1.getOutChannels().get(0) instanceof DataflowQueue
159-
out1.getOutChannels().get(1) instanceof DataflowQueue
149+
out0.getOutChannel() instanceof DataflowQueue
160150

161-
out2.name == null
162-
out2.getOutChannels().size()==1
163-
out2.getOutChannels().get(0) instanceof DataflowQueue
151+
out1.name == null
152+
out1.getOutChannel() instanceof DataflowQueue
164153

165-
out3.name == null
166-
out3.getOutChannels().size()==3
167-
out3.getOutChannels().get(0) instanceof DataflowQueue
168-
out3.getOutChannels().get(1) instanceof DataflowQueue
169-
out3.getOutChannels().get(2) instanceof DataflowQueue
170154
}
171155

172156
def testFileOutParams() {
@@ -366,30 +350,30 @@ class ParamsOutTest extends Specification {
366350
then:
367351
out0.name == 'x'
368352
out0.getFilePatterns(binding,null) == ['hola']
369-
out0.getOutChannels().get(0) instanceof DataflowQueue
370-
out0.getOutChannels().get(0) == binding.x
353+
out0.getOutChannel() instanceof DataflowQueue
354+
out0.getOutChannel() == binding.x
371355

372356
out1.name == null
373357
out1.getFilePatterns(binding,null) == ['hola_2']
374-
out1.getOutChannels().get(0) instanceof DataflowQueue
375-
out1.getOutChannels().get(0) == binding.q
358+
out1.getOutChannel() instanceof DataflowQueue
359+
out1.getOutChannel() == binding.q
376360

377361
out2.inner[0] instanceof FileOutParam
378362
(out2.inner[0] as FileOutParam).name == 'z'
379363
(out2.inner[0] as FileOutParam).getFilePatterns(binding,null) == ['hola_z']
380364

381365
out3.name == 'u'
382366
out3.getFilePatterns(binding,null) == ['u']
383-
out3.getOutChannels().get(0) instanceof DataflowQueue
384-
out3.getOutChannels().get(0) == binding.u
367+
out3.getOutChannel() instanceof DataflowQueue
368+
out3.getOutChannel() == binding.u
385369

386370
out4.name == null
387371
out4.getFilePatterns(binding,null) == ['file_v']
388-
out4.getOutChannels().size()==0
372+
out4.getOutChannel() == null
389373

390374
out5.name == null
391375
out5.getFilePatterns(binding,null) == ['w']
392-
out4.getOutChannels().size()==0
376+
out4.getOutChannel() == null
393377
}
394378

395379

@@ -523,17 +507,17 @@ class ParamsOutTest extends Specification {
523507
then:
524508
out0.name == null
525509
out0.getFilePatterns(binding,null) == ['x']
526-
out0.getOutChannels().size()==0
510+
!out0.getOutChannel()
527511

528512
out1.name == 'y'
529513
out1.getFilePatterns(binding,null) == ['y']
530-
out1.getOutChannels().get(0) instanceof DataflowQueue
531-
out1.getOutChannels().get(0) == binding.y
514+
out1.getOutChannel() instanceof DataflowQueue
515+
out1.getOutChannel() == binding.y
532516

533517
out2.name == null
534518
out2.getFilePatterns(binding,null) == ['z']
535-
out2.getOutChannels().get(0) instanceof DataflowQueue
536-
out2.getOutChannels().get(0) == binding.channel_z
519+
out2.getOutChannel() instanceof DataflowQueue
520+
out2.getOutChannel() == binding.channel_z
537521
}
538522

539523

@@ -753,7 +737,7 @@ class ParamsOutTest extends Specification {
753737
process.config.getOutputs().size() == 1
754738

755739
// first set
756-
out0.getOutChannels().size()==0
740+
out0.getOutChannel() == null
757741

758742
out0.inner[0] instanceof ValueOutParam
759743
out0.inner[0].name == 'X'
@@ -776,7 +760,6 @@ class ParamsOutTest extends Specification {
776760
output:
777761
stdout into p
778762
stdout into (q)
779-
stdout into (x,y,z)
780763
781764
return ''
782765
}
@@ -788,16 +771,12 @@ class ParamsOutTest extends Specification {
788771
when:
789772
def out0 = (StdOutParam)process.config.getOutputs().get(0)
790773
def out1 = (StdOutParam)process.config.getOutputs().get(1)
791-
def out2 = (StdOutParam)process.config.getOutputs().get(2)
792774

793775
then:
794-
process.config.getOutputs().size() == 3
776+
process.config.getOutputs().size() == 2
795777

796-
out0.getOutChannels()[0].is binding.p
797-
out1.getOutChannels()[0].is binding.q
798-
out2.getOutChannels()[0].is binding.x
799-
out2.getOutChannels()[1].is binding.y
800-
out2.getOutChannels()[2].is binding.z
778+
out0.getOutChannel().is binding.p
779+
out1.getOutChannel().is binding.q
801780

802781
}
803782

@@ -948,20 +927,17 @@ class ParamsOutTest extends Specification {
948927

949928
out0.getName() == 'x'
950929
out0.getFilePattern() == null
951-
out0.getOutChannels().size()==1
952-
out0.getOutChannels().get(0) instanceof DataflowQueue
930+
out0.getOutChannel() instanceof DataflowQueue
953931
out0.isPathQualifier()
954932

955933
out1.getName() == null
956934
out1.getFilePattern() == 'hello.*'
957-
out1.getOutChannels().size()==1
958-
out1.getOutChannels().get(0) instanceof DataflowQueue
935+
out1.getOutChannel() instanceof DataflowQueue
959936
out1.isPathQualifier()
960937

961938
out2.getName() == null
962939
out2.getFilePattern() == 'hello.txt'
963-
out2.getOutChannels().size()==1
964-
out2.getOutChannels().get(0) instanceof DataflowQueue
940+
out2.getOutChannel() instanceof DataflowQueue
965941
out2.isPathQualifier()
966942

967943
}

0 commit comments

Comments
 (0)