add nan handling to excel files

This commit is contained in:
2022-05-04 11:37:57 +02:00
parent 7f2033193e
commit 9d5d9ebd13

View File

@@ -269,7 +269,9 @@ class Excel(BaseReport):
self._compare_totals = {} self._compare_totals = {}
if book is None: if book is None:
self.excel_file_name = self.file_name.replace(".json", ".xlsx") self.excel_file_name = self.file_name.replace(".json", ".xlsx")
self.book = xlsxwriter.Workbook(self.excel_file_name) self.book = xlsxwriter.Workbook(
self.excel_file_name, {"nan_inf_to_errors": True}
)
self.set_book_properties() self.set_book_properties()
self.close = True self.close = True
else: else:
@@ -782,7 +784,9 @@ class Benchmark:
) )
def excel(self): def excel(self):
book = xlsxwriter.Workbook(self.get_excel_file_name()) book = xlsxwriter.Workbook(
self.get_excel_file_name(), {"nan_inf_to_errors": True}
)
Excel.set_properties(book, "Experimentation summary") Excel.set_properties(book, "Experimentation summary")
sheet = book.add_worksheet("Benchmark") sheet = book.add_worksheet("Benchmark")
normal = book.add_format({"font_size": 14, "border": 1}) normal = book.add_format({"font_size": 14, "border": 1})