-
Notifications
You must be signed in to change notification settings - Fork 74
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
ColormapDialog: upgrade _DataInPlotMode
to DisplayMode
#3964
Conversation
…istogram" exclusive
…PlotMode' checked directly the action which sumplify things
…s None)' Signed-off-by: payno <[email protected]>
Are you sure it is not actually a |
Well the expected object is a |
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.
It is worth checking where setColorDialog
is used inside silx
and update to setColormapDialog
to avoid deprecation warnings.
It would be nice to see where _createDialog
is used and if it can't be replaced by usage setColormapDialog
... but I guess not (or it would not be there).
Regarding public API changes, we should make explicit what we actually do: No public API (= stuff without a *: Unless impossible to deprecate, but it should be the exception. |
BTW, +1 for the method renaming to use a consistent name |
For the first one clearly. For |
Co-authored-by: Thomas VINCENT <[email protected]>
Co-authored-by: Thomas VINCENT <[email protected]>
Co-authored-by: Thomas VINCENT <[email protected]>
Co-authored-by: Thomas VINCENT <[email protected]>
I propose to keep a possible change of |
@@ -749,12 +755,26 @@ def _plotGammaMarkerConstraint(self, x, y): | |||
x = min(x, vmax) | |||
return x, y | |||
|
|||
def setDataInPlotMode(self, mode: str | DataInPlotMode): |
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.
Maybe there is a better naming for: setDataInPlotMode
and DataInPlotMode
?
PlotMode
? DisplayMode
? RangeDisplayMode
?
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.
+1 for DisplayMode
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.
But then I would also rename DataInPlotMode
by DisplayMode
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.
@vallsv do you mind if we change _DataInPlotMode
to DisplayMode
? As those are Enum we won't be able to deprecate them
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.
_DataInPlotMode
is private, so no need for deprecation for me
Co-authored-by: Thomas VINCENT <[email protected]>
_DataInPlotMode
to DisplayMode
@@ -66,6 +66,7 @@ | |||
import logging | |||
|
|||
import numpy | |||
from future import __annotations__ |
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.
This needs to be the very first of executable line of code right after the module docstring.
And it's: from __future__ import annotations
;)
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.
nice one ^^
The goal of this PR is to allow user select the display mode of the ColormapDialog for the min / max value (
data histogram
ordata range
)TODO
_dataInPlotMode
setColorDialog
tosetColormapDialog
? This would make more sense to me. Especially as we are moving to 2.0EXTRA
Changelog:
move _DataInPlotMode to public API.
close #3963