From 5d73525836e4e483bcefb69cb4e1fcfae5747a2f Mon Sep 17 00:00:00 2001 From: Jason Grace <110117391+JasonGrace2282@users.noreply.github.com> Date: Thu, 2 Nov 2023 11:23:30 -0400 Subject: [PATCH] Fix CSV reader adding empty lists in rendering summary (#3430) * Fix CSV reader adding empty files Fixes issue #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> --- manim/utils/docbuild/manim_directive.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manim/utils/docbuild/manim_directive.py b/manim/utils/docbuild/manim_directive.py index 5b744985ca..c369464679 100644 --- a/manim/utils/docbuild/manim_directive.py +++ b/manim/utils/docbuild/manim_directive.py @@ -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, ".")