-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Update Slider docs and type check slidermin and slidermax. #8134
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a4694a0
DOC: numpydoc-ify widget.Slider.
heathhenley 36ad946
Raise ValueError if slidermin/max incompatible.
heathhenley f59028e
Dry out bounds checking for reuse.
heathhenley 9f4258b
Lint: tabs to spaces.
heathhenley ffba7d9
Tests for widgets.Slider.
heathhenley 9d3e5e1
Doc nit.
heathhenley ea899aa
Improve test coverage.
heathhenley dc55f80
Bounds check returns value.
heathhenley 325789a
FIX nitpicks on docstring
NelleV 2b42285
Fix: indent error
heathhenley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Lint: tabs to spaces.
- Loading branch information
commit 9f4258b456a49f463f87ac05a44fd1cbbeb10c5c
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,11 +291,11 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f', | |
|
||
valinit : float, optional | ||
The slider initial position. | ||
Default: 0.5 | ||
Default: 0.5 | ||
|
||
valfmt : str, optional | ||
Used to format the slider value, fprint format string. | ||
Default: '%1.2f' | ||
Default: '%1.2f' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same (Can you add the default on the line that defines the parameter?) |
||
|
||
closedmin : bool, optional | ||
Indicate whether the slider interval is closed on the bottom. | ||
|
@@ -370,11 +370,11 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f', | |
self.slidermin = slidermin | ||
self.slidermax = slidermax | ||
self.drag_active = False | ||
self._value_in_bounds(valinit) | ||
self._value_in_bounds(valinit) | ||
|
||
def _value_in_bounds(self, val): | ||
""" Makes sure self.val is with given bounds.""" | ||
if val <= self.valmin: | ||
if val <= self.valmin: | ||
if not self.closedmin: | ||
return | ||
val = self.valmin | ||
|
@@ -416,8 +416,8 @@ def _update(self, event): | |
event.canvas.release_mouse(self.ax) | ||
return | ||
val = event.xdata | ||
self._value_in_bounds(val) | ||
self._value_in_bounds(val) | ||
|
||
def set_val(self, val): | ||
xy = self.poly.xy | ||
xy[2] = val, 1 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you add the default on the line that defines the parameter?
(note that it is currently not indented properly).