pione 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. data/.gitignore +3 -2
  2. data/History.txt +6 -0
  3. data/Rakefile +1 -1
  4. data/bin/pione-broker +1 -1
  5. data/bin/pione-clean +1 -1
  6. data/bin/pione-client +1 -1
  7. data/bin/pione-log +1 -1
  8. data/bin/pione-relay +1 -1
  9. data/bin/pione-relay-account-db +1 -1
  10. data/bin/pione-relay-client-db +1 -1
  11. data/bin/pione-syntax-checker +1 -1
  12. data/bin/pione-task-worker +1 -1
  13. data/bin/pione-tuple-space-provider +1 -1
  14. data/bin/pione-tuple-space-receiver +1 -1
  15. data/bin/pione-tuple-space-viewer +1 -1
  16. data/bin/pione-val +1 -1
  17. data/example/CTFCorrection/CTFCorrection.pione +78 -0
  18. data/example/CTFCorrection/package.yml +1 -0
  19. data/example/HelloWorld/scenario/output/message.txt +1 -0
  20. data/example/LoopByTouch/LoopByTouch.pione +10 -18
  21. data/example/LoopByTouch/PairLoop.pione +18 -0
  22. data/example/LoopByTouch/SingleLoop.pione +5 -0
  23. data/example/LoopByTouch/TripletLoop.pione +24 -0
  24. data/example/MakePair/scenario/output/comb-1-2.pair +0 -0
  25. data/example/MakePair/scenario/output/comb-1-3.pair +0 -0
  26. data/example/MakePair/scenario/output/comb-1-4.pair +0 -0
  27. data/example/MakePair/scenario/output/comb-1-5.pair +0 -0
  28. data/example/MakePair/scenario/output/comb-2-3.pair +0 -0
  29. data/example/MakePair/scenario/output/comb-2-4.pair +0 -0
  30. data/example/MakePair/scenario/output/comb-2-5.pair +0 -0
  31. data/example/MakePair/scenario/output/comb-3-4.pair +0 -0
  32. data/example/MakePair/scenario/output/comb-3-5.pair +0 -0
  33. data/example/MakePair/scenario/output/comb-4-5.pair +0 -0
  34. data/example/MakePair/scenario/output/perm-1-2.pair +0 -0
  35. data/example/MakePair/scenario/output/perm-1-3.pair +0 -0
  36. data/example/MakePair/scenario/output/perm-1-4.pair +0 -0
  37. data/example/MakePair/scenario/output/perm-1-5.pair +0 -0
  38. data/example/MakePair/scenario/output/perm-2-1.pair +0 -0
  39. data/example/MakePair/scenario/output/perm-2-3.pair +0 -0
  40. data/example/MakePair/scenario/output/perm-2-4.pair +0 -0
  41. data/example/MakePair/scenario/output/perm-2-5.pair +0 -0
  42. data/example/MakePair/scenario/output/perm-3-1.pair +0 -0
  43. data/example/MakePair/scenario/output/perm-3-2.pair +0 -0
  44. data/example/MakePair/scenario/output/perm-3-4.pair +0 -0
  45. data/example/MakePair/scenario/output/perm-3-5.pair +0 -0
  46. data/example/MakePair/scenario/output/perm-4-1.pair +0 -0
  47. data/example/MakePair/scenario/output/perm-4-2.pair +0 -0
  48. data/example/MakePair/scenario/output/perm-4-3.pair +0 -0
  49. data/example/MakePair/scenario/output/perm-4-5.pair +0 -0
  50. data/example/MakePair/scenario/output/perm-5-1.pair +0 -0
  51. data/example/MakePair/scenario/output/perm-5-2.pair +0 -0
  52. data/example/MakePair/scenario/output/perm-5-3.pair +0 -0
  53. data/example/MakePair/scenario/output/perm-5-4.pair +0 -0
  54. data/example/MakePair/scenario/output/succ-1-2.pair +0 -0
  55. data/example/MakePair/scenario/output/succ-2-3.pair +0 -0
  56. data/example/MakePair/scenario/output/succ-3-4.pair +0 -0
  57. data/example/MakePair/scenario/output/succ-4-5.pair +0 -0
  58. data/example/SyntaxError/output_line_error.pione +6 -0
  59. data/example/WorkflowPatterns/38_GeneralSynchronizingMerge/GeneralSynchronizingMerge.pione +94 -0
  60. data/lib/pione.rb +1 -10
  61. data/lib/pione/agent/process-manager.rb +6 -5
  62. data/lib/pione/agent/rule-provider.rb +7 -9
  63. data/lib/pione/agent/task-worker.rb +1 -1
  64. data/lib/pione/command.rb +1 -0
  65. data/lib/pione/command/basic-command.rb +12 -77
  66. data/lib/pione/command/child-process.rb +19 -13
  67. data/lib/pione/command/daemon-process.rb +0 -9
  68. data/lib/pione/command/front-owner-command.rb +0 -6
  69. data/lib/pione/command/option.rb +243 -0
  70. data/lib/pione/command/pione-broker.rb +10 -5
  71. data/lib/pione/command/pione-clean.rb +4 -0
  72. data/lib/pione/command/pione-client.rb +257 -210
  73. data/lib/pione/command/pione-log.rb +38 -19
  74. data/lib/pione/command/pione-relay-account-db.rb +42 -17
  75. data/lib/pione/command/pione-relay-client-db.rb +35 -14
  76. data/lib/pione/command/pione-relay.rb +16 -8
  77. data/lib/pione/command/pione-syntax-checker.rb +33 -13
  78. data/lib/pione/command/pione-task-worker.rb +26 -23
  79. data/lib/pione/command/pione-tuple-space-provider.rb +8 -17
  80. data/lib/pione/command/pione-tuple-space-receiver.rb +13 -3
  81. data/lib/pione/command/pione-tuple-space-viewer.rb +42 -23
  82. data/lib/pione/command/pione-val.rb +15 -7
  83. data/lib/pione/component/document.rb +49 -70
  84. data/lib/pione/component/package.rb +125 -83
  85. data/lib/pione/location/basic-location.rb +1 -0
  86. data/lib/pione/model/assignment.rb +11 -0
  87. data/lib/pione/model/parameters.rb +10 -0
  88. data/lib/pione/model/variable.rb +14 -0
  89. data/lib/pione/parser/common-parser.rb +4 -0
  90. data/lib/pione/parser/document-parser.rb +4 -3
  91. data/lib/pione/parser/rule-definition-parser.rb +2 -1
  92. data/lib/pione/patch/rinda-patch.rb +1 -1
  93. data/lib/pione/rule-handler/action-handler.rb +6 -1
  94. data/lib/pione/rule-handler/basic-handler.rb +0 -6
  95. data/lib/pione/rule-handler/flow-handler.rb +14 -9
  96. data/lib/pione/system/global.rb +3 -0
  97. data/lib/pione/system/package-cache.rb +18 -0
  98. data/lib/pione/transformer/document-transformer.rb +26 -3
  99. data/lib/pione/transformer/rule-definition-transformer.rb +10 -2
  100. data/lib/pione/tuple-space/presence-notifier.rb +4 -3
  101. data/lib/pione/uri-scheme.rb +11 -0
  102. data/lib/pione/uri-scheme/git-scheme.rb +12 -0
  103. data/lib/pione/util.rb +2 -0
  104. data/lib/pione/util/package-parameters-list.rb +32 -0
  105. data/lib/pione/util/process-info.rb +21 -0
  106. data/lib/pione/version.rb +1 -1
  107. data/pione.gemspec +1 -1
  108. data/test/agent/spec_rule-provider.rb +57 -44
  109. data/test/command/command-behavior.rb +15 -0
  110. data/test/command/spec_pione-client.rb +56 -0
  111. data/test/command/spec_pione-val.domain.dump +0 -0
  112. data/test/command/spec_pione-val.rb +22 -0
  113. data/test/component/spec_document.pione +51 -0
  114. data/test/component/spec_document.rb +41 -70
  115. data/test/component/spec_package.rb +18 -3
  116. data/test/parser/spec_document-parser.yml +15 -0
  117. data/test/parser/spec_rule-definition-parser.yml +7 -2
  118. data/test/rule-handler/spec_action-handler.rb +6 -6
  119. data/test/rule-handler/spec_flow-handler.pione +25 -0
  120. data/test/rule-handler/spec_flow-handler.rb +35 -95
  121. data/test/rule-handler/spec_update-criteria.rb +2 -2
  122. data/test/test-util.rb +68 -4
  123. data/test/transformer/spec_block-transformer.rb +1 -1
  124. data/test/transformer/spec_document-transformer.rb +50 -0
  125. data/test/transformer/spec_expr-transformer.rb +1 -1
  126. data/test/transformer/spec_flow-element-transformer.rb +13 -13
  127. data/test/transformer/spec_literal-transformer.rb +1 -1
  128. data/test/transformer/spec_rule-definition-transformer.rb +31 -19
  129. data/test/uri-scheme/spec_git-scheme.rb +20 -0
  130. data/test/util/spec_id.rb +6 -6
  131. data/test/util/spec_package-parameters-list.rb +59 -0
  132. data/test/util/spec_package-parameters-list_1.pione +17 -0
  133. data/test/util/spec_package-parameters-list_2.pione +13 -0
  134. data/test/util/spec_package-parameters-list_3.pione +12 -0
  135. data/test/util/spec_package-parameters-list_4.pione +6 -0
  136. data/test/util/spec_process-info.rb +56 -0
  137. metadata +79 -16
  138. data/lib/pione/option.rb +0 -13
  139. data/lib/pione/option/child-process-option.rb +0 -19
  140. data/lib/pione/option/common-option.rb +0 -31
  141. data/lib/pione/option/option-interface.rb +0 -73
  142. data/lib/pione/option/presence-notifier-option.rb +0 -16
  143. data/lib/pione/option/task-worker-owner-option.rb +0 -24
  144. data/lib/pione/option/tuple-space-provider-option.rb +0 -28
  145. data/lib/pione/option/tuple-space-provider-owner-option.rb +0 -18
  146. data/lib/pione/option/tuple-space-receiver-option.rb +0 -8
data/.gitignore CHANGED
@@ -1,6 +1,6 @@
1
1
  *~
2
- ~/input
3
- output*
2
+ /input
3
+ /output
4
4
  result
5
5
  html
6
6
  log.txt
@@ -14,3 +14,4 @@ nohup.out
14
14
  Gemfile.lock
15
15
  gems
16
16
  coverage
17
+ .EosLog
data/History.txt CHANGED
@@ -1,5 +1,11 @@
1
1
  # History
2
2
 
3
+ ## 0.2.1(2013/06/15)
4
+
5
+ * Added basic/advaneced parameter.
6
+ * Enabled to run rehearsal test.
7
+ * Imporved test coverage.
8
+
3
9
  ## 0.2.0(2013/05/31)
4
10
 
5
11
  * Added initial package system.
data/Rakefile CHANGED
@@ -82,7 +82,7 @@ end
82
82
 
83
83
  desc 'execute basic tests'
84
84
  task 'test' do
85
- sh "bundle exec bacon -I lib -rsimplecov test/parser/spec_*.rb test/transformer/spec_*.rb test/model/spec_*.rb test/log/spec_*.rb test/location/spec_*.rb test/component/spec_*.rb test/util/spec_*.rb test/tuple/spec_*.rb test/uri-scheme/spec_*.rb test/agent/spec_logger.rb test/agent/spec_messenger.rb test/rule-handler/spec_action-handler.rb test/rule-handler/spec_update-criteria.rb test/tuple-space/spec_data-finder.rb test/system/spec_*.rb"
85
+ sh "bundle exec bacon -I lib -rsimplecov test/parser/spec_*.rb test/transformer/spec_*.rb test/model/spec_*.rb test/log/spec_*.rb test/location/spec_*.rb test/component/spec_*.rb test/util/spec_*.rb test/tuple/spec_*.rb test/uri-scheme/spec_*.rb test/agent/spec_logger.rb test/agent/spec_messenger.rb test/agent/spec_rule-provider.rb test/rule-handler/spec_action-handler.rb test/rule-handler/spec_flow-handler.rb test/rule-handler/spec_update-criteria.rb test/tuple-space/spec_data-finder.rb test/system/spec_*.rb test/command/spec_*.rb"
86
86
  end
87
87
 
88
88
  desc 'parser test'
data/bin/pione-broker CHANGED
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneBroker.run
5
+ Pione::Command::PioneBroker.run(ARGV)
data/bin/pione-clean CHANGED
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneClean.run
5
+ Pione::Command::PioneClean.run(ARGV)
data/bin/pione-client CHANGED
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneClient.run
5
+ Pione::Command::PioneClient.run(ARGV)
data/bin/pione-log CHANGED
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneLog.run
5
+ Pione::Command::PioneLog.run(ARGV)
data/bin/pione-relay CHANGED
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneRelay.run
5
+ Pione::Command::PioneRelay.run(ARGV)
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneRelayAccountDB.run
5
+ Pione::Command::PioneRelayAccountDB.run(ARGV)
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneRelayClientDB.run
5
+ Pione::Command::PioneRelayClientDB.run(ARGV)
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneSyntaxChecker.run
5
+ Pione::Command::PioneSyntaxChecker.run(ARGV)
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneTaskWorker.run
5
+ Pione::Command::PioneTaskWorker.run(ARGV)
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneTupleSpaceProvider.run
5
+ Pione::Command::PioneTupleSpaceProvider.run(ARGV)
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneTupleSpaceReceiver.run
5
+ Pione::Command::PioneTupleSpaceReceiver.run(ARGV)
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneTupleSpaceViewer.run
5
+ Pione::Command::PioneTupleSpaceViewer.run(ARGV)
data/bin/pione-val CHANGED
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneEval.run
5
+ Pione::Command::PioneVal.run(ARGV)
@@ -0,0 +1,78 @@
1
+ Basic Param
2
+ $RESOLUTION := 3.80 # tiff2mrc -r
3
+ $CTF_DETERMINE_Cc := 0.7 # ctfDetermine -Cc
4
+ $CTF_DETERMINE_Cs := 2.1 # ctfDetermine -Cs
5
+ End
6
+
7
+ Advanced Param
8
+ $TIFF2MRC_m := 0
9
+ $TIFF2MRC_Offset := 0.0
10
+ $MRC_IMAGE_CENTER_Nx := 1000 # FIXME
11
+ $MRC_IMAGE_CENTER_Ny := 1000 # FIXME
12
+ $MRC_IMAGE_ABNORMAL_VALUE_REMOVE_u_MAX := 65535
13
+ $MRC_IMAGE_ABNORMAL_VALUE_REMOVE_u_HALF := 16384
14
+ $MRC_IMAGE_ABNORMAL_VALUE_REMOVE_m := 1
15
+ $MRC_DETERMINE_D := 50000
16
+ $MRC_DETERMINE_m := 128
17
+ $MRC_DETERMINE_CutLow := 0.025
18
+ $MRC_DETERMINE_CutHigh := 0.15
19
+ $MRC_DETERMINE_d := 3
20
+ $MRC_IMAGE_CTF_COMPENSATION_m := 1
21
+ End
22
+
23
+ Rule Main
24
+ input ('*.tif' or '*.mrc').all
25
+ output '*.ctf'.all
26
+ Flow
27
+ rule Tiff2Mrc
28
+ rule Mrc2Cen
29
+ rule Cen2Nor
30
+ rule Nor2Fft
31
+ rule Fft2Ctfinfo
32
+ rule Ctfinfo2Ctf
33
+ End
34
+
35
+ Rule Tiff2Mrc
36
+ input '*.tif'
37
+ output '{$*}.mrc'
38
+ Action
39
+ tiff2mrc -i {$I[1]} -o {$O[1]}.mrc -r {$RESOLUTION} -m {$TIFF2MRC_m} -Offset {$TIFF2MRC_Offset}
40
+ End
41
+
42
+ Rule Mrc2Cen
43
+ input '*.mrc'
44
+ output '{$*}.cen'
45
+ Action
46
+ mrcImageCenterGet -i {$I[1]} -o {$O[1]} -Nx {$MRC_IMAGE_CENTER_Nx} -Ny {$MRC_IMAGE_CENTER_Ny}
47
+ End
48
+
49
+ Rule Cen2Nor
50
+ input '*.cen'
51
+ output '{$*}.nor'
52
+ Action
53
+ mrcImageAbnormalValueRemove -i {$I[1]} -o {$O[1]} -u {$MRC_IMAGE_ABNORMAL_VALUE_REMOVE_u_MAX} {$MRC_IMAGE_ABNORMAL_VALUE_REMOVE_u_HALF} -m {$MRC_IMAGE_ABNORMAL_VALUE_REMOVE_m}
54
+ End
55
+
56
+ Rule Nor2Fft
57
+ input '*.nor'
58
+ output '{$*}.fft'
59
+ Action
60
+ mrcImageFFT -i {$I[1]} -o {$O[1]}
61
+ End
62
+
63
+ Rule Fft2Ctfinfo
64
+ input '*.fft'
65
+ output '{$*}.ctfinfo'
66
+ Action
67
+ ctfDetermine -i {$I[1]} -o {$O[1]} -D {$MRC_DETERMINE_D} -m {$MRC_DETERMINE_m} -CutLow {$MRC_DETERMINE_CutLow} -CutHigh {$MRC_DETERMINE_CutHigh} -d {$MRC_DETERMINE_d} -Cc {$CTF_DETERMINE_Cc} -Cs {$CTF_DETERMINE_Cs}
68
+ End
69
+
70
+ Rule Ctfinfo2Ctf
71
+ input '*.fft'
72
+ input '{$*}.ctfinfo'
73
+ output '{$*}.ctf'
74
+ Action
75
+ mv {$I[2]} {$I[2]}.tmp2
76
+ grep .: {$I[2]}.tmp2 > {$I[2]}
77
+ mrcImageCTFCompensation -i {$I[1]} -info2 {$I[2]} -o {$O[1]} -m {$MRC_IMAGE_CTF_COMPENSATION_m}
78
+ End
@@ -0,0 +1 @@
1
+ PackageName: CTFCorrection
@@ -0,0 +1 @@
1
+ Hello, world!
@@ -1,28 +1,20 @@
1
+ param $N := 3
2
+
1
3
  Rule Main
2
4
  output '1' or '2' or '3'
3
5
  Flow
4
6
  rule Init
5
- rule A
6
- rule B
7
- rule C
7
+ case $N
8
+ when 1
9
+ rule SingleLoop
10
+ when 2
11
+ rule PairLoop
12
+ when 3
13
+ rule TripletLoop
14
+ end
8
15
  End
9
16
 
10
17
  Rule Init
11
18
  output '1'.touch
12
19
  End
13
20
 
14
- Rule A
15
- input '1'
16
- output '2'.touch
17
- End
18
-
19
- Rule B
20
- input '2'
21
- output '3'.touch
22
- End
23
-
24
- Rule C
25
- input '3'
26
- output '1'.touch
27
- End
28
-
@@ -0,0 +1,18 @@
1
+ Rule PairLoop
2
+ input '1'
3
+ output '2'
4
+ Flow
5
+ rule PairA
6
+ rule PairB
7
+ End
8
+
9
+ Rule PairA
10
+ input '1'
11
+ output '2'.touch
12
+ End
13
+
14
+ Rule PairB
15
+ input '2'
16
+ output '1'.touch
17
+ End
18
+
@@ -0,0 +1,5 @@
1
+ Rule SingleLoop
2
+ input '1'
3
+ output '1'.touch
4
+ End
5
+
@@ -0,0 +1,24 @@
1
+ Rule TripletLoop
2
+ input '1'
3
+ output '2' or '3'
4
+ Flow
5
+ rule TripletA
6
+ rule TripletB
7
+ rule TripletC
8
+ End
9
+
10
+ Rule TripletA
11
+ input '1'
12
+ output '2'.touch
13
+ End
14
+
15
+ Rule TripletB
16
+ input '2'
17
+ output '3'.touch
18
+ End
19
+
20
+ Rule TripletC
21
+ input '3'
22
+ output '1'.touch
23
+ End
24
+
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ Rule ABC
2
+ input '*.a'
3
+ output ######
4
+ Action
5
+ cat {$I[1]} > {$O[1]}
6
+ End
@@ -0,0 +1,94 @@
1
+ param $COND1 := true
2
+ param $COND2 := not :: $COND1
3
+ param $COND3 := true # processing is endless if $COND3 is true
4
+
5
+ Rule Main
6
+ output 'o1'
7
+ output 'o2' or null
8
+ Flow
9
+ rule Init
10
+ rule A
11
+ rule B
12
+ rule C
13
+ rule D
14
+ rule E
15
+ rule F
16
+ End
17
+
18
+ Rule Init
19
+ output 'i1'.touch
20
+ End
21
+
22
+ Rule A
23
+ input 'i1'
24
+ output 'p1' or 'p2'
25
+ Flow
26
+ rule A1
27
+ rule A2
28
+ End
29
+
30
+ Rule A1
31
+ output 'p1'.touch
32
+ constraint $COND1
33
+ End
34
+
35
+ Rule A2
36
+ output 'p2'.touch
37
+ constraint $COND2
38
+ End
39
+
40
+ Rule B
41
+ input 'p1'
42
+ output 'p3'.touch
43
+ End
44
+
45
+ Rule C
46
+ input 'p2'
47
+ output 'p5'.touch
48
+ End
49
+
50
+ Rule D
51
+ input 'p3'
52
+ output 'p4'.touch
53
+ End
54
+
55
+ Rule E
56
+ input 'p4' or 'p5'
57
+ output 'o1'.touch
58
+ End
59
+
60
+ Rule F
61
+ input 'p1'
62
+ input 'p4'
63
+ output 'p1' or 'o2'
64
+ Flow
65
+ rule Once
66
+ rule F1
67
+ rule F2
68
+ End
69
+
70
+ Rule Once
71
+ output 'once'.touch
72
+ End
73
+
74
+ Rule F1
75
+ input 'p1'
76
+ input 'once'
77
+ output 'p1'
78
+ constraint $COND3
79
+ Flow
80
+ rule F1Touch
81
+ End
82
+
83
+ Rule F1Touch
84
+ input 'p1'
85
+ input 'once'
86
+ output 'p1'.touch
87
+ output 'once'.remove
88
+ End
89
+
90
+ Rule F2
91
+ output 'o2'.touch
92
+ constraint not :: $COND3
93
+ End
94
+