handle nan in tools.golden_sect_DataFrame#1408
Conversation
| " is not NaN in (lower, upper)") | ||
|
|
||
| return func(df, 'V1'), df['V1'] | ||
| func_result = func(df, 'V1') |
There was a problem hiding this comment.
This PR gets #1394 working again for me locally, so +1 for that. However I think this will still fail with a KeyError if either of upper or lower is all nans: in that case iterlimit will still be nan, so the while loop will not execute at all, causing df['V1'] to not exist when this line executes. I think the all-nan case is worth supporting: a ModelChain simulation of only nighttime is not particularly useful, but shouldn't throw an error IMHO.
kandersolar
left a comment
There was a problem hiding this comment.
Not an expert about the context of this function but LGTM. Stickler is complaining still.
|
I guess my preference long term would be to replace this with the |
[ ] Closes #xxxx[ ] Updates entries indocs/sphinx/source/referencefor API changes.[ ] Adds description and name entries in the appropriate "what's new" file indocs/sphinx/source/whatsnewfor all changes. Includes link to the GitHub Issue with:issue:`num`or this Pull Request with:pull:`num`. Includes contributor name and/or GitHub username (link with:ghuser:`user`).Supplements #1089. See discussion.