rbbt-util 5.33.12 → 5.33.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/hpc/batch.rb +20 -19
- data/lib/rbbt/hpc/slurm.rb +14 -10
- data/lib/rbbt/util/python/util.rb +33 -0
- data/lib/rbbt/workflow/dependencies.rb +4 -1
- data/lib/rbbt/workflow/step/dependencies.rb +1 -1
- data/lib/rbbt/workflow/usage.rb +2 -0
- data/share/rbbt_commands/hpc/orchestrate +2 -0
- data/share/rbbt_commands/hpc/task +2 -0
- data/share/rbbt_commands/lsf/orchestrate +2 -0
- data/share/rbbt_commands/lsf/task +2 -0
- data/share/rbbt_commands/slurm/orchestrate +2 -0
- data/share/rbbt_commands/slurm/task +2 -0
- data/test/rbbt/util/python/test_util.rb +17 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06dd3eb576050f8f635f49f02e4382ce2b65e23194fe3a5d601f2394c36941a0
|
4
|
+
data.tar.gz: cba8da17adfd6716a7ba870d67779e9a0618662b6d1fafdc9088a8669dc90db7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25f4d416e5d10f8e813f510278de8c510861e881027b4bef94125d33ce431f2613c4b535c7c75025eaf2b14c2315d50d3e78bf181c02cdb24ab72f80e3d1906f
|
7
|
+
data.tar.gz: 9145fc107255622f68ae7e0b761d8f638bfb8dfeb4ef69205b74e3174ce190dd59bf4dcda85e090dc69bafc480dc302819d475b4685f6618975283f54ace870c
|
data/lib/rbbt/hpc/batch.rb
CHANGED
@@ -138,35 +138,37 @@ EOF
|
|
138
138
|
batch_options = IndiferentHash.setup({})
|
139
139
|
|
140
140
|
keys = [
|
141
|
-
:
|
141
|
+
:queue,
|
142
|
+
:account,
|
143
|
+
:partition,
|
144
|
+
:exclusive,
|
145
|
+
:highmem,
|
146
|
+
:time,
|
147
|
+
:nodes,
|
148
|
+
:task_cpus,
|
149
|
+
:mem,
|
150
|
+
:mem_per_cpu,
|
151
|
+
:gres,
|
142
152
|
:lua_modules,
|
153
|
+
:contraints,
|
154
|
+
:licenses,
|
155
|
+
:batch_dir,
|
143
156
|
:batch_name,
|
144
157
|
:contain,
|
158
|
+
:sync,
|
145
159
|
:contain_and_sync,
|
146
160
|
:copy_image,
|
147
161
|
:drbbt,
|
148
162
|
:env_cmd,
|
149
|
-
:exclusive,
|
150
|
-
:highmem,
|
151
163
|
:manifest,
|
152
|
-
:nodes,
|
153
|
-
:queue,
|
154
|
-
:singularity,
|
155
|
-
:singularity_img,
|
156
|
-
:singularity_opt_dir,
|
157
|
-
:singularity_ruby_inline,
|
158
|
-
:sync,
|
159
|
-
:task_cpus,
|
160
|
-
:gres,
|
161
|
-
:mem,
|
162
|
-
:mem_per_cpu,
|
163
|
-
:licenses,
|
164
|
-
:contraints,
|
165
|
-
:time,
|
166
164
|
:user_group,
|
167
165
|
:wipe_container,
|
168
166
|
:workdir,
|
169
|
-
:purge_deps
|
167
|
+
:purge_deps,
|
168
|
+
:singularity,
|
169
|
+
:singularity_img,
|
170
|
+
:singularity_opt_dir,
|
171
|
+
:singularity_ruby_inline
|
170
172
|
]
|
171
173
|
|
172
174
|
keys.each do |key|
|
@@ -224,7 +226,6 @@ EOF
|
|
224
226
|
Misc.add_defaults batch_options,
|
225
227
|
:batch_name => batch_name,
|
226
228
|
:inputs_dir => inputs_dir,
|
227
|
-
:queue => 'debug',
|
228
229
|
:nodes => 1,
|
229
230
|
:step_path => job.path,
|
230
231
|
:task_cpus => 1,
|
data/lib/rbbt/hpc/slurm.rb
CHANGED
@@ -21,16 +21,18 @@ export BATCH_SYSTEM=SLURM
|
|
21
21
|
def self.header(options = {})
|
22
22
|
options = options.dup
|
23
23
|
|
24
|
-
queue
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
24
|
+
queue = Misc.process_options options, :queue
|
25
|
+
account = Misc.process_options options, :account
|
26
|
+
partition = Misc.process_options options, :partition
|
27
|
+
task_cpus = Misc.process_options options, :task_cpus
|
28
|
+
time = Misc.process_options options, :time
|
29
|
+
nodes = Misc.process_options options, :nodes
|
30
|
+
workdir = Misc.process_options options, :workdir
|
31
|
+
exclusive = Misc.process_options options, :exclusive
|
32
|
+
highmem = Misc.process_options options, :highmem
|
33
|
+
licenses = Misc.process_options options, :licenses
|
34
|
+
constraint = Misc.process_options options, :constraint
|
35
|
+
gres = Misc.process_options options, :gres
|
34
36
|
|
35
37
|
constraint = [constraint, "highmem"].compact * "&" if highmem
|
36
38
|
|
@@ -47,6 +49,8 @@ export BATCH_SYSTEM=SLURM
|
|
47
49
|
|
48
50
|
sbatch_params = {"job-name" => batch_name,
|
49
51
|
"qos" => queue,
|
52
|
+
"account" => account,
|
53
|
+
"partition" => partition,
|
50
54
|
"output" => fout,
|
51
55
|
"error" => ferr,
|
52
56
|
"cpus-per-task" => task_cpus,
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module RbbtPython
|
2
|
+
def self.py2ruby_a(array)
|
3
|
+
PyCall::List.(array).to_a
|
4
|
+
end
|
5
|
+
|
6
|
+
class << self
|
7
|
+
alias to_a py2ruby_a
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
def self.tsv2df(tsv)
|
12
|
+
df = nil
|
13
|
+
RbbtPython.run 'pandas' do
|
14
|
+
df = pandas.DataFrame.new(tsv.values, columns: tsv.fields, index: tsv.keys)
|
15
|
+
df.columns.name = tsv.key_field
|
16
|
+
end
|
17
|
+
df
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.df2tsv(tuple, options = {})
|
21
|
+
options = Misc.add_defaults options, :type => :list
|
22
|
+
tsv = TSV.setup({}, options)
|
23
|
+
tsv.key_field = tuple.columns.name
|
24
|
+
tsv.fields = py2ruby_a(tuple.columns.values)
|
25
|
+
keys = tuple.index.values
|
26
|
+
PyCall.len(tuple.index).times do |i|
|
27
|
+
k = keys[i]
|
28
|
+
tsv[k] = py2ruby_a(tuple.values[i])
|
29
|
+
end
|
30
|
+
tsv
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
@@ -74,7 +74,10 @@ module Workflow
|
|
74
74
|
dep = Step === dep ? dep.dup : Workflow.load_step(dep)
|
75
75
|
|
76
76
|
dep.original_workflow ||= dep.workflow if dep.workflow
|
77
|
-
dep.original_task_name ||= dep.task_name if dep.
|
77
|
+
dep.original_task_name ||= dep.task_name if dep.task_name
|
78
|
+
|
79
|
+
dep.original_task_name ||= dep.path.split("/")[-3]
|
80
|
+
dep.original_task_name ||= dep.path.split("/")[-2]
|
78
81
|
|
79
82
|
dep.workflow = workflow
|
80
83
|
dep.info[:name] = dep.name
|
data/lib/rbbt/workflow/usage.rb
CHANGED
@@ -25,6 +25,8 @@ $slurm_options = SOPT.get <<EOF
|
|
25
25
|
-t--tail Tail the logs
|
26
26
|
-BPP--batch_procpath* Save Procpath performance for batch job; specify only options
|
27
27
|
-q--queue* Queue
|
28
|
+
-a--account* Account
|
29
|
+
-p--partition* Partition
|
28
30
|
-t--task_cpus* Tasks
|
29
31
|
-tm--time* Time
|
30
32
|
-m--mem* SLURM minimum memory
|
@@ -24,6 +24,8 @@ $slurm_options = SOPT.get <<EOF
|
|
24
24
|
-t--tail Tail the logs
|
25
25
|
-BPP--batch_procpath* Save Procpath performance for batch job; specify only options
|
26
26
|
-q--queue* Queue
|
27
|
+
-a--account* Account
|
28
|
+
-p--partition* Partition
|
27
29
|
-t--task_cpus* Tasks
|
28
30
|
-tm--time* Time
|
29
31
|
-m--mem* SLURM minimum memory
|
@@ -25,6 +25,8 @@ $slurm_options = SOPT.get <<EOF
|
|
25
25
|
-t--tail Tail the logs
|
26
26
|
-BPP--batch_procpath* Save Procpath performance for batch job; specify only options
|
27
27
|
-q--queue* Queue
|
28
|
+
-a--account* Account
|
29
|
+
-p--partition* Partition
|
28
30
|
-t--task_cpus* Tasks
|
29
31
|
-tm--time* Time
|
30
32
|
-m--mem* SLURM minimum memory
|
@@ -24,6 +24,8 @@ $slurm_options = SOPT.get <<EOF
|
|
24
24
|
-t--tail Tail the logs
|
25
25
|
-BPP--batch_procpath* Save Procpath performance for batch job; specify only options
|
26
26
|
-q--queue* Queue
|
27
|
+
-a--account* Account
|
28
|
+
-p--partition* Partition
|
27
29
|
-t--task_cpus* Tasks
|
28
30
|
-tm--time* Time
|
29
31
|
-m--mem* SLURM minimum memory
|
@@ -25,6 +25,8 @@ $slurm_options = SOPT.get <<EOF
|
|
25
25
|
-t--tail Tail the logs
|
26
26
|
-BPP--batch_procpath* Save Procpath performance for batch job; specify only options
|
27
27
|
-q--queue* Queue
|
28
|
+
-a--account* Account
|
29
|
+
-p--partition* Partition
|
28
30
|
-t--task_cpus* Tasks
|
29
31
|
-tm--time* Time
|
30
32
|
-m--mem* SLURM minimum memory
|
@@ -24,6 +24,8 @@ $slurm_options = SOPT.get <<EOF
|
|
24
24
|
-t--tail Tail the logs
|
25
25
|
-BPP--batch_procpath* Save Procpath performance for batch job; specify only options
|
26
26
|
-q--queue* Queue
|
27
|
+
-a--account* Account
|
28
|
+
-p--partition* Partition
|
27
29
|
-t--task_cpus* Tasks
|
28
30
|
-tm--time* Time
|
29
31
|
-m--mem* SLURM minimum memory
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), '../../..', 'test_helper.rb')
|
2
|
+
require 'rbbt/util/python'
|
3
|
+
require 'rbbt/util/python/util'
|
4
|
+
|
5
|
+
class TestPythonUtil < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def test_tuple
|
8
|
+
tsv = TSV.setup([], :key_field => "Key", :fields => %w(Value1 Value2), :type => :list)
|
9
|
+
tsv["k1"] = %w(V1_1 V2_1)
|
10
|
+
tsv["k2"] = %w(V1_2 V2_2)
|
11
|
+
df = RbbtPython.tsv2df(tsv)
|
12
|
+
new_tsv = RbbtPython.df2tsv(df)
|
13
|
+
assert_equal tsv, new_tsv
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.33.
|
4
|
+
version: 5.33.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -312,6 +312,7 @@ files:
|
|
312
312
|
- lib/rbbt/util/open.rb
|
313
313
|
- lib/rbbt/util/procpath.rb
|
314
314
|
- lib/rbbt/util/python.rb
|
315
|
+
- lib/rbbt/util/python/util.rb
|
315
316
|
- lib/rbbt/util/semaphore.rb
|
316
317
|
- lib/rbbt/util/simpleDSL.rb
|
317
318
|
- lib/rbbt/util/simpleopt.rb
|
@@ -539,6 +540,7 @@ files:
|
|
539
540
|
- test/rbbt/util/misc/test_multipart_payload.rb
|
540
541
|
- test/rbbt/util/misc/test_omics.rb
|
541
542
|
- test/rbbt/util/misc/test_pipes.rb
|
543
|
+
- test/rbbt/util/python/test_util.rb
|
542
544
|
- test/rbbt/util/simpleopt/test_get.rb
|
543
545
|
- test/rbbt/util/simpleopt/test_parse.rb
|
544
546
|
- test/rbbt/util/simpleopt/test_setup.rb
|
@@ -609,6 +611,7 @@ test_files:
|
|
609
611
|
- test/rbbt/resource/test_path.rb
|
610
612
|
- test/rbbt/util/test_colorize.rb
|
611
613
|
- test/rbbt/util/test_procpath.rb
|
614
|
+
- test/rbbt/util/python/test_util.rb
|
612
615
|
- test/rbbt/util/misc/test_development.rb
|
613
616
|
- test/rbbt/util/misc/test_omics.rb
|
614
617
|
- test/rbbt/util/misc/test_pipes.rb
|