Give siPrefix behavior to values of zero#2842
Merged
campagnola merged 10 commits intopyqtgraph:masterfrom Jan 17, 2024
Merged
Conversation
> > allows for default scaling on the first text typed in after zeroing
blow away previous code that only sometimes succeeded (which used previous value)
j9ac9k
reviewed
Oct 31, 2023
| sb = pg.SpinBox(suffix=suffix) | ||
|
|
||
| sb.lineEdit().setText('0.1' + suffix) | ||
| sb.lineEdit().setText(f'0.1{suffix}') |
j9ac9k
reviewed
Oct 31, 2023
| if isinf(self.val) or isnan(self.val): | ||
| return self.val | ||
| steps = int(steps) | ||
| sign = [decimal.Decimal(-1), decimal.Decimal(1)][steps >= 0] |
Member
There was a problem hiding this comment.
Thanks for replacing single character variable names!
Member
|
The PR looks good to me, I'm wondering if we need to go through a deprecation dance for removing the I would be open to having those methods accept |
Contributor
Author
|
Here's that deprecation warning. Thanks for the review! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds new behavior to the SpinBox widget when
siPrefixis True. By default, values of 0 will now take on the SI prefix associated with the initial step, as would immediately be present if the user were to press up or down once. This scaling hint will make it clearer what that initial step will be, as well as make it so that initial values typed in manually will be set to that scale. This behavior can also be overridden with a newscaleAtZerooption, which can be configured to any value regardless of that initial step. Tests and example coverage are included.This PR also corrects a small, unrelated incompatibility in the (likely not broadly used) GarbageCollector class, as well as adds a test that would have caught the problem.
Other Tasks
Bump Dependency Versions
Files that need updates
Confirm the following files have been either updated or there has been a determination that no update is needed.
README.mdsetup.pytox.ini.github/workflows/main.ymland associatedrequirements.txtand condaenvironemt.ymlfilespyproject.tomlbinder/requirements.txtPre-Release Checklist
Pre Release Checklist
__init__.pyCHANGELOGprimarily using contents from automated changelog generation in GitHub release pagePost-Release Checklist
Steps To Complete
.dev0to__version__in__init__.py