Prevent element-wise string comparison#921
Merged
j9ac9k merged 1 commit intopyqtgraph:developfrom Jun 17, 2019
Merged
Conversation
Issue pyqtgraph#835 shows that comparing `bins`, which may be a numpy array, with a string `'auto'` leads to element-wise comparison, because the `==` operator for numpy arrays is used. With this commit, potential array and string are switched, so the `==` operator for strings is used, which does no element-wise comparison.
Member
|
This looks good to me, I'll merge. |
samschott
pushed a commit
to OE-FET/cx-pyqtgraph
that referenced
this pull request
Jun 18, 2019
Prevent element-wise string comparison
samschott
pushed a commit
to OE-FET/cx-pyqtgraph
that referenced
this pull request
Jun 18, 2019
# This is the 1st commit message: Merge pull request pyqtgraph#921 from 2xB/patch-9 Prevent element-wise string comparison # The commit message #2 will be skipped: # `_updateMaxTextSize` to reduce text size when no longer needed # # Currently `_updateMaxTextSize ` will increase the current space required for axis labels, if necessary, but not decrease it when the extra space is no longer needed. The proposed change will release no longer needed space again. # The commit message #3 will be skipped: # Clipping: don't assume that x-values have uniform spacing # # Do not assume that x-values have uniform spacing -- this can cause problems especially with large datasets and non-uniform spacing (e.g., time-dependent readings from an instrument). # # Use `np.searchsorted` instead to find the first and last data index in the view range. This only assumes that x-values are in ascending order. This prevents potentially too strong clipping. # The commit message #4 will be skipped: # draw path all around curve filling if enabled
samschott
pushed a commit
to OE-FET/cx-pyqtgraph
that referenced
this pull request
Jun 18, 2019
# This is the 1st commit message: Merge pull request pyqtgraph#921 from 2xB/patch-9 Prevent element-wise string comparison # The commit message #2 will be skipped: # `_updateMaxTextSize` to reduce text size when no longer needed # # Currently `_updateMaxTextSize ` will increase the current space required for axis labels, if necessary, but not decrease it when the extra space is no longer needed. The proposed change will release no longer needed space again. # The commit message #3 will be skipped: # Clipping: don't assume that x-values have uniform spacing # # Do not assume that x-values have uniform spacing -- this can cause problems especially with large datasets and non-uniform spacing (e.g., time-dependent readings from an instrument). # # Use `np.searchsorted` instead to find the first and last data index in the view range. This only assumes that x-values are in ascending order. This prevents potentially too strong clipping. # The commit message #4 will be skipped: # draw path all around curve filling if enabled # The commit message #5 will be skipped: # allow different color for tick labels # # created new `textPen` and `setTextPen` methods # The commit message #6 will be skipped: # Revert "draw path all around curve filling if enabled" # # This reverts commit d5dd912. # The commit message #7 will be skipped: # Revert "Clipping: don't assume that x-values have uniform spacing" # # This reverts commit 365c13f. # The commit message pyqtgraph#8 will be skipped: # Revert "`_updateMaxTextSize` to reduce text size when no longer needed" # # This reverts commit 1ea6461.
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.
Issue #835 shows that comparing
bins, which may be a numpy array, with a string'auto'leads to element-wise comparison. This is because the==operator for numpy arrays is used. With this Pull Request, potential array and string are switched, so the==operator for strings is used, which does no element-wise comparison.Closes #835