Fix ValueError when addplot column is all NaN#697
Open
wavebyrd wants to merge 864 commits intomatplotlib:masterfrom
Open
Fix ValueError when addplot column is all NaN#697wavebyrd wants to merge 864 commits intomatplotlib:masterfrom
wavebyrd wants to merge 864 commits intomatplotlib:masterfrom
Conversation
add input requirement checkout based on input reference test cat _version.py file test publish use publish v1 (instead of release/v1), and p3.x instead of p3.9 apparently @release/v1 is needed (not just @v1) now try twine publishTestPyPI and publishPyPI workflows
GitHub Actions workflows to deploy package to PyPI and TestPyPI
add status badge for mplfinance checks
Set single candle color
Minor Changes to README, to Workflow, and change Dev Status from alpha to beta
Adding edgecolors and linewidths **for `type=scatter`**
Support `marketcolors` kwarg in `make_addplot()`
As Per Suggestion All Exam Update - Used OHLCV Data Only - Calculation Within Notebook - Detail Description Calculation - Details mplfinance function used
Indicator Examples
add scratch work from issue436 and stackoverflow 75737197
move indicator examples into indicator directory
Style Enhancements, and add styles from Chandrakant
API for adding labels: `mpf.make_addplot(..., label="myLabel")`
some clarification on fork/clone workflow.
regenerate price-movements notebook, and other cleanup
When all values in an addplot column are NaN, the filtered array `yd` is empty. Calling np.nanmax() or np.nanmin() on an empty array raises ValueError. Guard against this by checking len(yd) before computing min/max, and default to the primary y-axis when there is no real data. Fixes matplotlib#672
Member
|
This account has been blocked from the Matplotlib organisation for automating PRs matplotlib/matplotlib#31296 (comment) |
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.
Summary
When all values in an addplot column are NaN,
_addplot_columnsfiltersout NaN values into
yd, which becomes an empty list. Callingnp.nanmax()/np.nanmin()on that empty list raises:This adds a length check before the nanmax/nanmin calls. When there is
no real data, secondary_y auto-detection is skipped and the column is
plotted on the primary y-axis. matplotlib already handles all-NaN series
gracefully in the actual plot/scatter/bar calls, so nothing else needs
to change.
Reproduction
Test plan
Fixes #672