Skip to content

Commit

Permalink
fix: prematurely exhausting all generator arguments passed to hist pl…
Browse files Browse the repository at this point in the history
…ot. (#449)
  • Loading branch information
jjhw3 authored Oct 4, 2023
1 parent 826b1aa commit 85d32a3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/mplhep/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 85d32a3

Please sign in to comment.