Skip to content

Commit

Permalink
Replace tabulate by csv in kprove
Browse files Browse the repository at this point in the history
  • Loading branch information
tothtamas28 committed Jul 22, 2022
1 parent 1e28381 commit ab97716
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pyk/src/pyk/ktool/kprove.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import csv
import json
import logging
import os
Expand All @@ -6,8 +7,6 @@
from tempfile import TemporaryDirectory
from typing import Dict, Final, Iterable, List, Mapping, Optional, Tuple

from tabulate import tabulate

from ..cli_utils import (
check_dir_path,
check_file_path,
Expand Down Expand Up @@ -165,8 +164,10 @@ def prove(
productivity = total_success_time / (total_success_time + total_failure_time)
table_lines.append(['TOTAL', total_success_time, total_success_n, avg_success_time, total_failure_time, total_failure_n, avg_failure_time, productivity])
table_lines = sorted(table_lines, key=lambda x: x[1] + x[4])
with open(rule_profile, 'w') as rp:
rp.write(tabulate(table_lines, headers=('Rule', 'Total Success Time', '# Successes', 'Avg. Success Time', 'Total Failure Time', '# Failures', 'Avg. Failure Time', 'Productivity')))
with open(rule_profile, 'w') as rp_file:
writer = csv.writer(rp_file)
writer.writerow(('Rule', 'Total Success Time', '# Successes', 'Avg. Success Time', 'Total Failure Time', '# Failures', 'Avg. Failure Time', 'Productivity'))
writer.writerows(table_lines)
_LOGGER.info(f'Wrote rule profile: {rule_profile}')

return final_state
Expand Down

0 comments on commit ab97716

Please sign in to comment.