BUG: fix klucher nan output for numpy#509
Merged
Merged
Conversation
* fixes pvlib#508 * use `F = np.where(np.isnan(F), 0, F) to only replace `nan` with zero * previously if numpy array with nan, then entire array was zeroed so output differed from pandas series input
Member
Author
|
FYI: @jdnewmil |
* the original test had the bug in it, because floats don't have `fillna` attribute, **but** that doesn't mean that the value was `NaN`! * instead of hard-coding the expected value, what we really expect is that it should produce the same value as the pandas series result * also compare the pandas series result to a numpy array of the same
Member
|
Thanks @mikofski! I think we only need to see a whatsnew entry before merging. The test errors are unrelated. |
Member
Author
|
@wholmgren this patch is passing all tests, the failure is due to "703165TYA.CSV" not having any content so |
Member
Author
|
@wholmgren I added what's new, all good now? |
Member
|
thanks mark! |
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.
F = np.where(np.isnan(F), 0, F)to only replacenanwith zeropvlib python pull request guidelines
Thank you for your contribution to pvlib python! You may delete all of these instructions except for the list below.
You may submit a pull request with your code at any stage of completion.
The following items must be addressed before the code can be merged. Please don't hesitate to ask for help if you're unsure of how to accomplish any of the items below:
docs/sphinx/source/api.rstfor API changes.docs/sphinx/source/whatsnewfile for all changes.git diff upstream/master -u -- "*.py" | flake8 --diffBrief description of the problem and proposed solution (if not already fully described in the issue linked to above):