From 85d32a3ece84f3794923ec5b59b3185957a6aa5a Mon Sep 17 00:00:00 2001 From: Jeremy Wilkinson <77890459+jjhw3@users.noreply.github.com> Date: Wed, 4 Oct 2023 08:43:40 +0100 Subject: [PATCH] fix: prematurely exhausting all generator arguments passed to hist plot. (#449) --- src/mplhep/plot.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mplhep/plot.py b/src/mplhep/plot.py index 69e1b210..e185a1e8 100644 --- a/src/mplhep/plot.py +++ b/src/mplhep/plot.py @@ -306,10 +306,9 @@ def iterable_not_string(arg): # Check if iterable if iterable_not_string(kwargs[kwarg]): # Check if tuple of floats or ints (can be used for colors) - all_entries_numerical = all( + if isinstance(kwargs[kwarg], tuple) and all( isinstance(x, int) or isinstance(x, float) for x in kwargs[kwarg] - ) - if isinstance(kwargs[kwarg], tuple) and all_entries_numerical: + ): for i in range(len(_chunked_kwargs)): _chunked_kwargs[i][kwarg] = kwargs[kwarg] else: