-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add scale up boundary to datetimetickformatter #13467
Add scale up boundary to datetimetickformatter #13467
Conversation
@tcmetzger do you have any thoughts on the property name here? Offhand, |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## branch-3.5 #13467 +/- ##
===========================================
Coverage 92.65% 92.65%
===========================================
Files 326 326
Lines 20733 20734 +1
===========================================
+ Hits 19210 19211 +1
Misses 1523 1523 |
@@ -223,6 +223,13 @@ describe("DatetimeTickFormatter", () => { | |||
expect(labels).to.be.equal(["0ms", "5ms", "10ms"]) | |||
}) | |||
}) | |||
describe("scale_up_boundary", () => { | |||
it("should handle boolean", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test needs a new name, up above there was a "should handle boolean" because the property strip_leading_zeros
can accept boolean values and numeric values, and that test checked that the boolean case worked. But here scale_up_boundary
is boolean flag, it only accepts booleans in any case. This test is checking one of the two cases specifically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I will update this as soon as we agreed on a suitable property name.
I see - especially since it refers to a boolean (when I read Some ideas:
I think we don't necessarily need to include the "up" part, since it seems like any scaling that can be activated or deactivated is always up (i.e. there is no corresponding property that would activate DOWNscaling to the next lowest resolution, so no need to differentiate). This is based on my understanding of the current code that implies that automatic scaling happens only if this property is set to True (and nothing happens if False). This might change based on Bryan's comment https://github.com/bokeh/bokeh/pull/13467/files#r1366182425, if I understand correctly! |
@bryevdv Any update on your review comment above? |
@muendlein sorry not yet, it's a busy time of year. In the mean time, do you have an preference on the property name suggesstions? |
@bryevdv Take your time! I took some inspiration from the suggestions and my current favorite is |
@muendlein a couple of comments:
Otherwise, I am also still unsure about the property and type. I am worried that making it a |
fd2b74b
to
fabf629
Compare
@bryevdv Thank you for your feedback! |
@muendlein apologies, I just realized I had understood the issue and PR backwards—every other request previously has been to add more context, I did not realize that this is essentially the opposite. The tick formatter changes all make sense to me now. And I actually think I am fine keeping this a boolean, too. If we did ever want to make it more configurable, we could add a second property that specifies "how" the scale up should be done. @mattpap I'll plan to merge this |
As for the name, I think I actually would advise to go with @tcmetzger's suggest of |
I don't have comments on the logic of this change, but I made a quick tweak to get rid of |
Thanks @muendlein ! |
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.