Skip to content

Commit

Permalink
hotfix/catch-zerodivision-error
Browse files Browse the repository at this point in the history
  • Loading branch information
DhanshreeA committed Nov 28, 2024
1 parent 2a3f196 commit 8ee13d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ersilia/core/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,13 @@ def get_file_sizes(self, input_file, output_file):
input_size = sys.getsizeof(input_file) / 1024
output_size = sys.getsizeof(output_file) / 1024

input_avg_row_size = input_size / len(input_file)
output_avg_row_size = output_size / len(output_file)
try:
input_avg_row_size = input_size / len(input_file)
output_avg_row_size = output_size / len(output_file)
except ZeroDivisionError:
self.logger.warning("Encountered a ZeroDivisionError. No data in input or output file")
input_avg_row_size = -1
output_avg_row_size = -1

return {
"input_size": input_size,
Expand Down

0 comments on commit 8ee13d3

Please sign in to comment.