duongthienz commited on
Commit
00304c8
·
verified ·
1 Parent(s): 92e88c4

Revert No-Voice in proportion graph in multi-file analysis

Browse files
Files changed (1) hide show
  1. utils.py +7 -3
utils.py CHANGED
@@ -488,10 +488,14 @@ def build_multifile_category_df(validNames, results, summaries, categories, cate
488
 
489
  for fn in validNames:
490
  summary, extras = summaries[fn]["categories"]
 
 
 
 
 
 
 
491
  theseCategories = categories + extras
492
- # Use the annotation's actual span as denominator, falling back to
493
- # results[fn][1]. This avoids >1.0 values when totalSeconds was
494
- # truncated to int or is slightly shorter than the last segment end.
495
  annotation_end = max(
496
  (s.end for s in results[fn][0].itersegments()),
497
  default=results[fn][1]
 
488
 
489
  for fn in validNames:
490
  summary, extras = summaries[fn]["categories"]
491
+ # If this file was skipped in the first loop (calcCategories failed),
492
+ # summary will be [] — fill every category column with 0 so all
493
+ # arrays stay the same length.
494
+ if not summary:
495
+ for category in allCategories:
496
+ df6_dict[category].append(0)
497
+ continue
498
  theseCategories = categories + extras
 
 
 
499
  annotation_end = max(
500
  (s.end for s in results[fn][0].itersegments()),
501
  default=results[fn][1]