t2-server 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.rdoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = Changes log for the T2 Ruby Gem
2
2
 
3
+ == Version 0.5.3
4
+
5
+ * Fix an issue with singleton value/empty list confusion for output ports.
6
+
3
7
  == Version 0.5.2
4
8
 
5
9
  * Fix two issues with the retrieving of workflow outputs.
data/README.rdoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = Taverna[http://www.taverna.org.uk/] 2 Server Interaction Gem
2
2
 
3
3
  Authors:: Robert Haines
4
- Gem Version:: 0.5.2
4
+ Gem Version:: 0.5.3
5
5
  API Version:: 2.2a1
6
6
  Contact:: mailto:rhaines@manchester.ac.uk
7
7
  URL:: http://taverna.sourceforge.net/
data/lib/t2-server.rb CHANGED
@@ -43,7 +43,7 @@ require 't2-server/run'
43
43
  # Taverna 2 Server instance.
44
44
  module T2Server
45
45
  # The version of this library
46
- GEM_VERSION = "0.5.2"
46
+ GEM_VERSION = "0.5.3"
47
47
  # The version of the Taverna 2 Server API that this library can interface with
48
48
  API_VERSION = "2.2a1"
49
49
  end
data/lib/t2-server/run.rb CHANGED
@@ -452,22 +452,26 @@ module T2Server
452
452
  private
453
453
  def _get_output(output, refs=false, top=true)
454
454
  output.strip_path!
455
- result = []
456
-
457
- # look at the contents of the output port
458
- lists, items = ls("out/#{output}")
459
455
 
460
- # if lists and items are empty then it's an empty list
461
- # although it could be a single value if we're at the top level
462
- if top and lists == [] and items == []
463
- # as we are at the top level, just return the single value
464
- if refs
465
- return "#{@server.uri}/rest/runs/#{@uuid}/#{@links[:wdir]}/out/#{output}"
466
- else
467
- return @server.get_run_attribute(@uuid, "#{@links[:wdir]}/out/#{output}")
456
+ # if at the top level we need to check if the port represents a list
457
+ # or a singleton value
458
+ if top
459
+ lists, items = ls("out")
460
+ if items.include? output
461
+ if refs
462
+ return "#{@server.uri}/rest/runs/#{@uuid}/#{@links[:wdir]}/out/#{output}"
463
+ else
464
+ return @server.get_run_attribute(@uuid, "#{@links[:wdir]}/out/#{output}")
465
+ end
468
466
  end
469
467
  end
470
468
 
469
+ # we're not at the top level so look at the contents of the output port
470
+ lists, items = ls("out/#{output}")
471
+
472
+ # build up lists of results
473
+ result = []
474
+
471
475
  # for each list recurse into it and add the items to the result
472
476
  lists.each {|list| result << _get_output("#{output}/#{list}", refs, false)}
473
477
 
data/test/tc_run.rb CHANGED
@@ -90,8 +90,9 @@ class TestRun < Test::Unit::TestCase
90
90
  assert_nothing_raised(T2Server::RunStateError) do
91
91
  @run.wait
92
92
  end
93
- assert_equal(@run.get_output("OUT"), [[["boo"]], [["", "hello"]],
94
- [], [[], ["test"], []]])
93
+ assert_equal(@run.get_output("SINGLE"), [])
94
+ assert_equal(@run.get_output("MANY"), [[], [["Hello", ""]], [[], ["test"],
95
+ []], [["boo"]]])
95
96
 
96
97
  # run with baclava output
97
98
  @run = T2Server::Run.create($address, $wkf_hello)
@@ -1,12 +1,23 @@
1
- <workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="536f469a-fd80-4efa-8d76-6cb2514123ec" role="top"><name>Workflow1</name><inputPorts><port><name>IN</name><depth>2</depth><granularDepth>2</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>OUT</name><annotations /></port></outputPorts><processors /><conditions /><datalinks><datalink><sink type="dataflow"><port>OUT</port></sink><source type="dataflow"><port>IN</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
2
- <annotationAssertions>
3
- <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
4
- <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
5
- <identification>536f469a-fd80-4efa-8d76-6cb2514123ec</identification>
6
- </annotationBean>
7
- <date>2010-11-04 18:00:12.867 GMT</date>
8
- <creators />
9
- <curationEventList />
10
- </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
11
- </annotationAssertions>
1
+ <workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="373bb615-7dd3-46b4-9e3c-ee38e7460403" role="top"><name>Workflow1</name><inputPorts><port><name>MANY_IN</name><depth>3</depth><granularDepth>3</granularDepth><annotations /></port><port><name>SINGLE_IN</name><depth>1</depth><granularDepth>1</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>MANY</name><annotations /></port><port><name>SINGLE</name><annotations /></port></outputPorts><processors /><conditions /><datalinks><datalink><sink type="dataflow"><port>MANY</port></sink><source type="dataflow"><port>MANY_IN</port></source></datalink><datalink><sink type="dataflow"><port>SINGLE</port></sink><source type="dataflow"><port>SINGLE_IN</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
2
+ <annotationAssertions>
3
+ <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
4
+ <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
5
+ <identification>536f469a-fd80-4efa-8d76-6cb2514123ec</identification>
6
+ </annotationBean>
7
+ <date>2010-11-04 18:00:12.867 GMT</date>
8
+ <creators />
9
+ <curationEventList />
10
+ </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
11
+ </annotationAssertions>
12
+ </net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
13
+ <annotationAssertions>
14
+ <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
15
+ <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
16
+ <identification>373bb615-7dd3-46b4-9e3c-ee38e7460403</identification>
17
+ </annotationBean>
18
+ <date>2010-11-09 13:50:13.127 GMT</date>
19
+ <creators />
20
+ <curationEventList />
21
+ </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
22
+ </annotationAssertions>
12
23
  </net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
@@ -1,77 +1,86 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <b:dataThingMap xmlns:b="http://org.embl.ebi.escience/baclava/0.1alpha">
3
- <b:dataThing key="IN">
4
- <b:myGridDataDocument lsid="" syntactictype="l(l('null'))">
5
- <s:metadata xmlns:s="http://org.embl.ebi.escience/xscufl/0.1alpha" />
6
- <b:partialOrder lsid="" type="list">
7
- <b:relationList>
8
- <b:relation parent="0" child="1" />
9
- <b:relation parent="1" child="2" />
10
- <b:relation parent="2" child="3" />
11
- </b:relationList>
12
- <b:itemList>
13
- <b:partialOrder lsid="" type="list" index="0">
14
- <b:relationList>
15
- <b:relation parent="0" child="1" />
16
- <b:relation parent="1" child="2" />
17
- </b:relationList>
18
- <b:itemList>
19
- <b:partialOrder lsid="" type="list" index="0">
20
- <b:relationList />
21
- <b:itemList />
22
- </b:partialOrder>
23
- <b:partialOrder lsid="" type="list" index="1">
24
- <b:relationList />
25
- <b:itemList>
26
- <b:dataElement lsid="" index="0">
27
- <b:dataElementData>dGVzdA==</b:dataElementData>
28
- </b:dataElement>
29
- </b:itemList>
30
- </b:partialOrder>
31
- <b:partialOrder lsid="" type="list" index="2">
32
- <b:relationList />
33
- <b:itemList />
34
- </b:partialOrder>
35
- </b:itemList>
36
- </b:partialOrder>
37
- <b:partialOrder lsid="" type="list" index="1">
38
- <b:relationList />
39
- <b:itemList>
40
- <b:partialOrder lsid="" type="list" index="0">
41
- <b:relationList>
42
- <b:relation parent="0" child="1" />
43
- </b:relationList>
44
- <b:itemList>
45
- <b:dataElement lsid="" index="0">
46
- <b:dataElementData>aGVsbG8=</b:dataElementData>
47
- </b:dataElement>
48
- <b:dataElement lsid="" index="1">
49
- <b:dataElementData />
50
- </b:dataElement>
51
- </b:itemList>
52
- </b:partialOrder>
53
- </b:itemList>
54
- </b:partialOrder>
55
- <b:partialOrder lsid="" type="list" index="2">
56
- <b:relationList />
57
- <b:itemList>
58
- <b:partialOrder lsid="" type="list" index="0">
59
- <b:relationList />
60
- <b:itemList>
61
- <b:dataElement lsid="" index="0">
62
- <b:dataElementData>Ym9v</b:dataElementData>
63
- </b:dataElement>
64
- </b:itemList>
65
- </b:partialOrder>
66
- </b:itemList>
67
- </b:partialOrder>
68
- <b:partialOrder lsid="" type="list" index="3">
69
- <b:relationList />
70
- <b:itemList />
71
- </b:partialOrder>
72
- </b:itemList>
73
- </b:partialOrder>
74
- </b:myGridDataDocument>
75
- </b:dataThing>
76
- </b:dataThingMap>
77
-
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <b:dataThingMap xmlns:b="http://org.embl.ebi.escience/baclava/0.1alpha">
3
+ <b:dataThing key="MANY_IN">
4
+ <b:myGridDataDocument lsid="" syntactictype="l(l(l('null')))">
5
+ <s:metadata xmlns:s="http://org.embl.ebi.escience/xscufl/0.1alpha" />
6
+ <b:partialOrder lsid="" type="list">
7
+ <b:relationList>
8
+ <b:relation parent="0" child="1" />
9
+ <b:relation parent="1" child="2" />
10
+ <b:relation parent="2" child="3" />
11
+ </b:relationList>
12
+ <b:itemList>
13
+ <b:partialOrder lsid="" type="list" index="0">
14
+ <b:relationList />
15
+ <b:itemList>
16
+ <b:partialOrder lsid="" type="list" index="0">
17
+ <b:relationList />
18
+ <b:itemList>
19
+ <b:dataElement lsid="" index="0">
20
+ <b:dataElementData>Ym9v</b:dataElementData>
21
+ </b:dataElement>
22
+ </b:itemList>
23
+ </b:partialOrder>
24
+ </b:itemList>
25
+ </b:partialOrder>
26
+ <b:partialOrder lsid="" type="list" index="1">
27
+ <b:relationList />
28
+ <b:itemList>
29
+ <b:partialOrder lsid="" type="list" index="0">
30
+ <b:relationList>
31
+ <b:relation parent="0" child="1" />
32
+ </b:relationList>
33
+ <b:itemList>
34
+ <b:dataElement lsid="" index="0">
35
+ <b:dataElementData />
36
+ </b:dataElement>
37
+ <b:dataElement lsid="" index="1">
38
+ <b:dataElementData>SGVsbG8=</b:dataElementData>
39
+ </b:dataElement>
40
+ </b:itemList>
41
+ </b:partialOrder>
42
+ </b:itemList>
43
+ </b:partialOrder>
44
+ <b:partialOrder lsid="" type="list" index="2">
45
+ <b:relationList />
46
+ <b:itemList />
47
+ </b:partialOrder>
48
+ <b:partialOrder lsid="" type="list" index="3">
49
+ <b:relationList>
50
+ <b:relation parent="0" child="1" />
51
+ <b:relation parent="1" child="2" />
52
+ </b:relationList>
53
+ <b:itemList>
54
+ <b:partialOrder lsid="" type="list" index="0">
55
+ <b:relationList />
56
+ <b:itemList />
57
+ </b:partialOrder>
58
+ <b:partialOrder lsid="" type="list" index="1">
59
+ <b:relationList />
60
+ <b:itemList>
61
+ <b:dataElement lsid="" index="0">
62
+ <b:dataElementData>dGVzdA==</b:dataElementData>
63
+ </b:dataElement>
64
+ </b:itemList>
65
+ </b:partialOrder>
66
+ <b:partialOrder lsid="" type="list" index="2">
67
+ <b:relationList />
68
+ <b:itemList />
69
+ </b:partialOrder>
70
+ </b:itemList>
71
+ </b:partialOrder>
72
+ </b:itemList>
73
+ </b:partialOrder>
74
+ </b:myGridDataDocument>
75
+ </b:dataThing>
76
+ <b:dataThing key="SINGLE_IN">
77
+ <b:myGridDataDocument lsid="" syntactictype="l('null')">
78
+ <s:metadata xmlns:s="http://org.embl.ebi.escience/xscufl/0.1alpha" />
79
+ <b:partialOrder lsid="" type="list">
80
+ <b:relationList />
81
+ <b:itemList />
82
+ </b:partialOrder>
83
+ </b:myGridDataDocument>
84
+ </b:dataThing>
85
+ </b:dataThingMap>
86
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: t2-server
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 2
10
- version: 0.5.2
9
+ - 3
10
+ version: 0.5.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Robert Haines
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-05 00:00:00 +00:00
18
+ date: 2010-11-09 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency