Skip to content

Prevent element-wise string comparison#921

Merged
j9ac9k merged 1 commit intopyqtgraph:developfrom
2xB:patch-9
Jun 17, 2019
Merged

Prevent element-wise string comparison#921
j9ac9k merged 1 commit intopyqtgraph:developfrom
2xB:patch-9

Conversation

@2xB
Copy link
Copy Markdown
Contributor

@2xB 2xB commented Jun 17, 2019

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

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.
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Jun 17, 2019

This looks good to me, I'll merge.

@j9ac9k j9ac9k merged commit 6632355 into pyqtgraph:develop Jun 17, 2019
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Numpy FutureWarning when setting bins in ImageItem.getHistogram()

2 participants