Skip to content

Commit

Permalink
Merge pull request #23 from Social-Evolution-and-Behavior/debug-jana
Browse files Browse the repository at this point in the history
Fixes for issues #17 and #20, and a few more minor issues
  • Loading branch information
asafgal committed May 2, 2021
2 parents 7009d34 + 81117d4 commit 417223f
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 10 deletions.
26 changes: 18 additions & 8 deletions antrax/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,13 @@ def solve(explist, *, glist: parse_movlist=None, movlist: parse_movlist=None, cl
for e in explist:

eglist = glist if glist is not None else e.glist

emlist = [e.ggroups[g - 1] for g in eglist]
emlist = [m for grp in emlist for m in grp]

if movlist is not None:
emlist = [m for m in emlist if m in movlist]

hpc_options['dry'] = dry
hpc_options['classifier'] = classifier
hpc_options['missing'] = missing
Expand All @@ -282,19 +286,25 @@ def solve(explist, *, glist: parse_movlist=None, movlist: parse_movlist=None, cl
for c in eclist:
hpc_options['c'] = c
hpc_options['waitfor'] = None
if step == 0 or step == 1:
jid = antrax_hpc_job(e, 'solve', opts=hpc_options, solve_step=1)
hpc_options['waitfor'] = jid
if step == 0 or step == 2:
jid = antrax_hpc_job(e, 'solve', opts=hpc_options, solve_step=2)
hpc_options['waitfor'] = jid
if step == 0 or step == 3:
jid = antrax_hpc_job(e, 'solve', opts=hpc_options, solve_step=3)
else:
hpc_options['c'] = None
hpc_options['waitfor'] = None
if step == 0 or step == 1:
jid = antrax_hpc_job(e, 'solve', opts=hpc_options, solve_step=1)
hpc_options['waitfor'] = jid
if step == 0 or step == 2:
jid = antrax_hpc_job(e, 'solve', opts=hpc_options, solve_step=2)
hpc_options['waitfor'] = jid
if step == 0 or step == 3:
jid = antrax_hpc_job(e, 'solve', opts=hpc_options, solve_step=3)
else:
hpc_options['c'] = None
hpc_options['waitfor'] = None
jid = antrax_hpc_job(e, 'solve', opts=hpc_options, solve_step=1)
hpc_options['waitfor'] = jid
jid = antrax_hpc_job(e, 'solve', opts=hpc_options, solve_step=2)
hpc_options['waitfor'] = jid
jid = antrax_hpc_job(e, 'solve', opts=hpc_options, solve_step=3)

else:

Expand Down
1 change: 1 addition & 0 deletions antrax/hpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def antrax_hpc_job(ex, step, opts, solve_step=None):
print('Job number ' + str(jid) + ' was submitted')
print('')
else:
jid = 0
print('Dry run, no job submitted.')
print('')

Expand Down
Binary file modified bin/antrax_glnxa64_mcr_interface
Binary file not shown.
Binary file not shown.
11 changes: 11 additions & 0 deletions matlab/@tracklet/tracklet.m
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,19 @@ function load_ids(trjs)
if ~isfile(f)
continue
end

T = readtable(f);

% patch to a weird case when sometimes matlab doesnt
% understand the csv structure (GitHub issue #20)
if ~ismember('tracklet', T.Properties.VariableNames)
T = readtable(f,'Delimiter',',');
end

if isempty(T)
return
end

ix = ismember(T.tracklet,mtrjnames);
T = T(ix,:);

Expand Down
13 changes: 12 additions & 1 deletion matlab/@trgraph/solve.m
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,15 @@ function eliminate_cc(G,cc,id)
for i=1:length(assigned_nodes)
idix = find(G.assigned_ids(assigned_nodes(i),:));
for j=1:length(idix)
score = G.assignment_scores(assigned_nodes(i),idix(j));
%try
score = G.assignment_scores(assigned_nodes(i),idix(j));
%catch ME
% report('E','error in propagate_all')
% report('I',['node is ',num2str(assigned_nodes(i))])
% report('I',['size of assignment scores is ',num2str(size(G.assignment_scores))])
% report('I',['size of assignment ids is ',num2str(size(G.assigned_ids))])
% rethrow(ME)
%end
nij = propagate(G,assigned_nodes(i),idix(j),score);
n = n + nij;
end
Expand All @@ -533,6 +541,8 @@ function eliminate_cc(G,cc,id)
nnp=nn;

report('I','Biconnected components condition (positive)')

if ~isempty(G.pairs)
G.pairs = G.pairs(argsort(G.pairs(:,3)),:);
while true
n=0;
Expand Down Expand Up @@ -569,6 +579,7 @@ function eliminate_cc(G,cc,id)
break
end
end
end

if nn==nnp
return
Expand Down
6 changes: 5 additions & 1 deletion matlab/@trgraph/trgraph.m
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ function filter_impossible_jumps(G)
report('I','done distance mat');
sset = find(din>1 & ~ignore);

pairs = {};

for six=1:length(sset)%,G.NumWorkers)

Expand Down Expand Up @@ -528,7 +529,9 @@ function filter_impossible_jumps(G)
named_pairs(i).dist = pairs(i,3);
end

pairs = pairs(argsort(pairs(:,3)),:);
if ~isempty(pairs)
pairs = pairs(argsort(pairs(:,3)),:);
end

G.pairs = pairs;

Expand Down Expand Up @@ -744,6 +747,7 @@ function set_data(G)
if ~isempty(G.assigned_ids)
GS(i).assigned_ids = G.assigned_ids(ix,:);
GS(i).possible_ids = G.possible_ids(ix,:);
GS(i).assignment_scores = G.assignment_scores(ix,:);
GS(i).finalized = G.finalized(ix,:);
end
GS(i).isopen = false;
Expand Down

0 comments on commit 417223f

Please sign in to comment.