Skip to content

Commit

Permalink
Fix CSV reader adding empty lists in rendering summary (ManimCommunit…
Browse files Browse the repository at this point in the history
…y#3430)

* Fix CSV reader adding empty files

Fixes issue ManimCommunity#3311

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
JasonGrace2282 and pre-commit-ci[bot] authored Nov 2, 2023
1 parent b7a8a2d commit 5d73525
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manim/utils/docbuild/manim_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ def _log_rendering_times(*args):

print("\nRendering Summary\n-----------------\n")

# filter out empty lists caused by csv reader
data = [row for row in data if row]

max_file_length = max(len(row[0]) for row in data)
for key, group in it.groupby(data, key=lambda row: row[0]):
key = key.ljust(max_file_length + 1, ".")
Expand Down

0 comments on commit 5d73525

Please sign in to comment.