Skip to content

Commit

Permalink
debug json output bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
willsheffler committed Sep 22, 2020
1 parent be2e855 commit bcbfac5
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions worms/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@ def getmem():


def filter_and_output_results(
criteria,
ssdag,
result,
output_from_pose,
merge_bblock,
db,
output_symmetric,
output_centroid,
output_prefix,
max_output,
max_score0,
max_score0sym,
rms_err_cut,
no_duplicate_bases,
output_only_AAAA,
full_score0sym,
output_short_fnames,
output_only_connected,
null_base_names,
only_outputs,
**kw,
criteria,
ssdag,
result,
output_from_pose,
merge_bblock,
db,
output_symmetric,
output_centroid,
output_prefix,
max_output,
max_score0,
max_score0sym,
rms_err_cut,
no_duplicate_bases,
output_only_AAAA,
full_score0sym,
output_short_fnames,
output_only_connected,
null_base_names,
only_outputs,
**kw,
):
sf = ros.core.scoring.ScoreFunctionFactory.create_score_function("score0")
if hasattr(ros.core.scoring.symmetry, 'symmetrize_scorefunction'):
Expand Down Expand Up @@ -77,25 +77,6 @@ def filter_and_output_results(
info_file.write(" seg%i_enter seg%i_pdb" % (N - 1, N - 1))
info_file.write("\n")

if True:
# make json files with bblocks for single result
tmp, seenit = list(), set()
for j in range(len(ssdag.verts)):
v = ssdag.verts[j]
ibb = v.ibblock[result.idx[iresult, j]]
bb = ssdag.bbs[j][ibb]
fname = str(bytes(bb.file), 'utf-8')
if fname not in seenit:
for e in db[0]._alldb:
if e['file'] == fname:
tmp.append(e)
seenit.add(fname)
import json
jsonfname = 'tmp_%i.json' % iresult
print('output bblocks to', jsonfname)
with open(jsonfname, 'w') as out:
json.dump(tmp, out)

if output_from_pose:
info_file = None
nresults = 0
Expand All @@ -106,6 +87,25 @@ def filter_and_output_results(
print('output skipping', iresult)
continue

if False:
# make json files with bblocks for single result
tmp, seenit = list(), set()
for j in range(len(ssdag.verts)):
v = ssdag.verts[j]
ibb = v.ibblock[result.idx[iresult, j]]
bb = ssdag.bbs[j][ibb]
fname = str(bytes(bb.file), 'utf-8')
if fname not in seenit:
for e in db[0]._alldb:
if e['file'] == fname:
tmp.append(e)
seenit.add(fname)
import json
jsonfname = 'tmp_%i.json' % iresult
print('output bblocks to', jsonfname)
with open(jsonfname, 'w') as out:
json.dump(tmp, out)

# print(getmem(), 'MEM ================ top of loop ===============')

if iresult % 100 == 0:
Expand Down

0 comments on commit bcbfac5

Please sign in to comment.