Skip to content

BUG: fix klucher nan output for numpy#509

Merged
wholmgren merged 3 commits into
pvlib:masterfrom
mikofski:patch-1
Jul 27, 2018
Merged

BUG: fix klucher nan output for numpy#509
wholmgren merged 3 commits into
pvlib:masterfrom
mikofski:patch-1

Conversation

@mikofski

@mikofski mikofski commented Jul 25, 2018

Copy link
Copy Markdown
Member

pvlib 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:

  • Closes issue #xxxx
  • I am familiar with the contributing guidelines.
  • Fully tested. Added and/or modified tests to ensure correct behavior for all reasonable inputs. Tests (usually) must pass on the TravisCI and Appveyor testing services.
  • Updates entries to docs/sphinx/source/api.rst for API changes.
  • Adds description and name entries in the appropriate docs/sphinx/source/whatsnew file for all changes.
  • Code quality and style is sufficient. Passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • New code is fully documented. Includes sphinx/numpydoc compliant docstrings and comments in the code where necessary.
  • Pull request is nearly complete and ready for detailed review.

Brief description of the problem and proposed solution (if not already fully described in the issue linked to above):

* 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
@mikofski

Copy link
Copy Markdown
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
@wholmgren

Copy link
Copy Markdown
Member

Thanks @mikofski! I think we only need to see a whatsnew entry before merging. The test errors are unrelated.

@wholmgren wholmgren added this to the 0.6.0 milestone Jul 25, 2018
@wholmgren wholmgren added the bug label Jul 25, 2018
@mikofski

Copy link
Copy Markdown
Member Author

@wholmgren this patch is passing all tests, the failure is due to "703165TYA.CSV" not having any content so readtmy3() fails

@mikofski

Copy link
Copy Markdown
Member Author

@wholmgren I added what's new, all good now?

@wholmgren wholmgren merged commit 80bf796 into pvlib:master Jul 27, 2018
@wholmgren

Copy link
Copy Markdown
Member

thanks mark!

@mikofski mikofski deleted the patch-1 branch July 27, 2018 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

klucher results different between pandas and numpy

2 participants