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: truncate long channel names on data_mc plots #496

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

lorenzennio
Copy link
Contributor

Hey,

I realized that figures become unusable for long channel names:

image

I implemented a small fix for this, which results in:

image

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (5f96224) to head (cfc43c3).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #496   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         2093      2093           
  Branches       346       346           
=========================================
  Hits          2093      2093           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@alexander-held alexander-held left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, that's a good idea, thanks for improving this! The new behavior is better than the old and anyone needing more control over the string can edit the figure externally with matplotlib of course.

One very picky comment, can we go with an f-string here to be consistent with the rest of the codebase?

f"{label[:30]}..."

@alexander-held
Copy link
Member

There's an extra space before the "..." now which might be a bit confusing? I think it makes more sense without the space as in the original picture.

@lorenzennio
Copy link
Contributor Author

There's an extra space before the "..." now which might be a bit confusing? I think it makes more sense without the space as in the original picture.

I left this intentionally, so that it is separated from the actual name. But I'll change it if you prefer.

Copy link
Member

@alexander-held alexander-held left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel super strongly, just thought that depending on where the cutoff happens it might end up looking like the region name is done and some other information was cut out instead. The ... without space is less clear in that regard I believe.

Happy to merge this, thanks again!

* only show first 30 characters of channel names on data/MC plots

@alexander-held alexander-held merged commit cd0af1b into scikit-hep:master Dec 2, 2024
8 checks passed
@lorenzennio lorenzennio deleted the truncate_channel branch December 2, 2024 16:54
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