Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: _chunked_kwargs not expanding kwargs if they're tuples even if t… #448

Merged
merged 2 commits into from
Oct 3, 2023

Conversation

jjhw3
Copy link
Contributor

@jjhw3 jjhw3 commented Oct 3, 2023

fix: _chunked_kwargs not expanding kwargs if they're tuples even if the tuple isn't a valid mpl color.

This issue confused me for a long time and is likely to come up if one uses the 'zip' builtin to zip up colours and histograms. Although this could be fixed by simply converting the tuple of colors returned by zip into a list, this is a better solution as it does not require users to read the source code to figure this out.

@jjhw3
Copy link
Contributor Author

jjhw3 commented Oct 3, 2023

Before this fix, the following would not work (note the tuple of colors), now it does:

hs = [hist.new.Reg(10,0,10).Weight().fill(np.random.normal(3+i, 1, 1000)) for i in range(3)]
hep.histplot(hs, histtype='fill', stack=True, color=('red', 'blue', 'firebrick'));

@andrzejnovak
Copy link
Member

Ah, looks good. Thanks for the fix!

@andrzejnovak andrzejnovak merged commit 826b1aa into scikit-hep:master Oct 3, 2023
rpsimeon34 pushed a commit to rpsimeon34/mplhep that referenced this pull request Oct 4, 2023
scikit-hep#448)

* fix: _chunked_kwargs not expanding kwargs if they're tuples even if the tuple isn't a valid mpl color

* [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>
jonas-eschle pushed a commit that referenced this pull request Apr 22, 2024
#448)

* fix: _chunked_kwargs not expanding kwargs if they're tuples even if the tuple isn't a valid mpl color

* [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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants