Skip to content

Commit

Permalink
Updated axes. Added ignore-no-formulas logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
emeryberger committed Jan 13, 2020
1 parent 9fd49cf commit 7775685
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/components/plot-stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

# identify "ExceLint-eligible" sheets!
# there are at least two adjacent formulas (different or not)

# number of suspicious ranges / number of rectangles
# number of suspicious ranges / number of rectangles
# produce an ExceLint-eligible filter
# also - omit any worksheets with no formulas (or "ineligible")

parser = argparse.ArgumentParser('plot-stats.py')
parser.add_argument('--input', help='Process an input .csv file, as generated by json-stats-to-csv.py.')
Expand All @@ -30,11 +31,14 @@
workbookName = row['workbookName']
worksheet = row['worksheet']
suspiciousnessThreshold = row['suspiciousnessThreshold']
# Strip off .xlsx ending
items.append((workbookName[:-5] + '!' + worksheet, row['suspiciousCells']))
numFormulaCells = row['numFormulaCells']
# We don't bother with any sheet with one or fewer formulas, since ExceLint by definition will detect nothing.
if int(numFormulaCells) > 1:
# print(numFormulaCells)
# Strip off .xlsx ending
items.append((workbookName[:-5] + '!' + worksheet, row['suspiciousCells']))

sorted_items = sorted(items, key=lambda x: int(x[1]))
# print(sorted_items)

for item in sorted_items:
if int(item[1]) > 0:
Expand All @@ -45,7 +49,7 @@
max_cells = cells[-1]

plt.figure(figsize=(8,8))
plt.axes([0.1,0.2,0.9,0.6])
plt.axes([0.1,0.2,0.9,0.7])
plt.title('ExceLint + CUSTODES: susp thresh = ' + str(suspiciousnessThreshold), y=1.02)
#plt.xlabel('Worksheet name')
plt.ylabel('# suspicious cells')
Expand Down

0 comments on commit 7775685

Please sign in to comment.