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

Hide repeats in datetimeformatter #13777

Merged
merged 9 commits into from
Apr 15, 2024

Conversation

muendlein
Copy link
Contributor

All pull requests must have an associated issue in the issue tracker. If there
isn't one, please go open an issue describing the defect, deficiency or desired
feature. You can read more about our issue and PR processes in the
wiki.

Copy link

codecov bot commented Mar 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.17%. Comparing base (e61219b) to head (eaf6838).
Report is 8 commits behind head on branch-3.5.

❗ Current head eaf6838 differs from pull request most recent head e1ef993. Consider uploading reports for the commit e1ef993 to get more accurate results

Additional details and impacted files
@@              Coverage Diff               @@
##           branch-3.5   #13777      +/-   ##
==============================================
+ Coverage       91.57%   92.17%   +0.59%     
==============================================
  Files             326      326              
  Lines           20737    20763      +26     
==============================================
+ Hits            18990    19138     +148     
+ Misses           1747     1625     -122     

Copy link
Member

@bryevdv bryevdv left a comment

Choose a reason for hiding this comment

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

A few initial comments @muendlein but I'm also not 100% clear on this change. Please add some before/after screenshots to aid quick comparison

@muendlein
Copy link
Contributor Author

@bryevdv now with some screenshots

formatter = DatetimeTickFormatter(
        microseconds = "%fus",
        milliseconds = "%3Nms",
        seconds = "%T",
        minsec = "%T",
        minutes = "%H:%M",
        hourmin = "%H:%M",
        hours = "%H:%M",
        days = "%b %d",
        months = "%b %Y",
        years = "%Y",
        strip_leading_zeros = ["microseconds", "milliseconds", "seconds"],
        boundary_scaling = False,
        context_which = "all",
        context = DatetimeTickFormatter(
            microseconds="%T",
            milliseconds="%T",
            seconds="%b %d, %Y",
            minsec="%b %d, %Y",
            minutes="%b %d, %Y",
            hourmin="%b %d, %Y",
            hours="%b %d, %Y",
            days="%Y",
            months="",
            years="",
            boundary_scaling=False,
            hide_repeats=True,
        ),

hide_repeats=True
hide_repeats_on

hide_repeats=False
hide_repeats_off

@bryevdv
Copy link
Member

bryevdv commented Mar 26, 2024

@muendlein OK now the code makes more sense, but now I am confused by the help string:

When activated only the first value of repeating formatted ticks will be shown. Context is unaffected by this setting.

This seems to be exactly opposite of what this does, since it specifically hides the context portion of the ticks in your screenshots above. Perhaps you mean something like "Context configuration is unaffected by this setting" but I don't think that's enough information to let users predict what this setting will do. We might also want to consider making the name more descriptive in some way cc @tcmetzger

@muendlein
Copy link
Contributor Author

@bryevdv I have added a bit more details to the help string in order to make it less confusing. Note: In my example above the hiding repeats is activated for the context directly and not the parent formatter.

@bryevdv
Copy link
Member

bryevdv commented Apr 8, 2024

@muendlein can you merge/rebase latest and we can see if the windows errors go away?

@bryevdv
Copy link
Member

bryevdv commented Apr 8, 2024

In considering the help string above I realized what I don't love about this approach. Ideally, we would hide ticks we don't want to see by removing the tick locations themselves altogether. "Removing" them by just replacing them with the empty strings seems like a bit of a kludge. But we don't pathways for that kind of feedback between the formatter and the ticker, and it's probably not worth trying to implement them, so I this approach will have to do.

@muendlein muendlein force-pushed the hide_repeats_in_datetimeformatter branch from b81a0c9 to eaf6838 Compare April 12, 2024 22:41
@muendlein
Copy link
Contributor Author

@bryevdv There seems to be an issue with the CI build.

@bryevdv
Copy link
Member

bryevdv commented Apr 12, 2024

@muendlein Yes it seems to be affecting all PRs at the moment. I'll get this merged once it is sorted.

edit: for reference

@bryevdv
Copy link
Member

bryevdv commented Apr 12, 2024

@muendlein the broken setuptools releases have been yanked, hopefully just restarting CI will work now 🤞

@mattpap mattpap added this to the 3.5 milestone Apr 13, 2024
Co-authored-by: Mateusz Paprocki <mattpap@gmail.com>
@bryevdv
Copy link
Member

bryevdv commented Apr 15, 2024

Thanks @muendlein !

@bryevdv bryevdv merged commit eb282dc into bokeh:branch-3.5 Apr 15, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants