Commit 9f1ab449 authored by Betoule Marc's avatar Betoule Marc
Browse files

bug correction for empty param list in cross_prod

parent baea1871
...@@ -285,7 +285,10 @@ def launch_ccali(pipe, n, address=('127.0.0.1',5000), authkey='secret', job_dir= ...@@ -285,7 +285,10 @@ def launch_ccali(pipe, n, address=('127.0.0.1',5000), authkey='secret', job_dir=
import re import re
l = subprocess.Popen(['qjob', '-wide','-nh'], stdout=subprocess.PIPE).communicate()[0] l = subprocess.Popen(['qjob', '-wide','-nh'], stdout=subprocess.PIPE).communicate()[0]
existing_process = re.findall( '%s([0-9]*)'%job_name,l) existing_process = re.findall( '%s([0-9]*)'%job_name,l)
starting_num = max([int(p) for p in existing_process])+1 try:
starting_num = max([int(p) for p in existing_process])+1
except:
starting_num = 0
for i in range(starting_num,starting_num+n): for i in range(starting_num,starting_num+n):
name = '%s%d'%(job_name,i) name = '%s%d'%(job_name,i)
jobfile = get_log_file (pipe, name+'.job') jobfile = get_log_file (pipe, name+'.job')
......
...@@ -40,8 +40,13 @@ def cross_prod(*args): ...@@ -40,8 +40,13 @@ def cross_prod(*args):
return zip(*args) return zip(*args)
l1 = args[0] l1 = args[0]
l2 = cross_prod(*(args[1:])) l2 = cross_prod(*(args[1:]))
for a in l1: if l1 and l2:
res.extend([(a,)+b for b in l2]) for a in l1:
res.extend([(a,)+b for b in l2])
elif l1:
res.extend(zip(l1))
elif l2:
res.extend(l2)
return res return res
def union(*args): def union(*args):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment