Skip to content

Conversation

@cwhanse
Copy link
Member

@cwhanse cwhanse commented Mar 31, 2020

  • I am familiar with the contributing guidelines
  • Tests added
  • Updates entries to docs/sphinx/source/api.rst for API changes.
  • Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for 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`).
  • New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels and Milestone are assigned to the Pull Request and linked Issue.

Adds reverse bias capability to single diode functions. The Lambert W technique cannot solve the single diode equation with the term for current at reverse bias. The Bishop '88 methods can solve the equation. Tested with method='newton', not clear if method='brentq' is reliable for this application.

@CameronTStark CameronTStark added this to the 0.7.3 milestone Apr 1, 2020
@cwhanse cwhanse added the api label Apr 1, 2020
@cwhanse cwhanse modified the milestones: 0.7.3, 0.7.2 Apr 1, 2020
@cwhanse
Copy link
Member Author

cwhanse commented Apr 1, 2020

Ready for review.

stickler complains about breaks both before and after an operator. Suggestions? Test failures are for test_forecast.py.

d2mutau=0, NsVbi=np.Inf, method='newton'):
d2mutau=0, NsVbi=np.Inf, breakdown_factor=0.,
breakdown_voltage=-5.5, breakdown_exp=3.28,
method='newton'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a convention, is it better to add new kwargs at the end, E.g. after method='newton', so it doesn't break code that relies on position than explicit kwarg= usage?

I'm half asking if that's something that's been historically done.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but would like to keep like arguments grouped together in general order of decreasing interest: required module parameters first, then optional thin-film parameters, reverse bias parameters third, numerical control last.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's bad form to rely on the position of a keyword argument. Don't worry about it.

Copy link
Contributor

@CameronTStark CameronTStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than a few NITs and linting.

cwhanse and others added 4 commits April 6, 2020 09:19
Co-Authored-By: Cameron Stark <CameronTStark@users.noreply.github.com>
Co-Authored-By: Cameron Stark <CameronTStark@users.noreply.github.com>
Co-Authored-By: Cameron Stark <CameronTStark@users.noreply.github.com>
d2mutau=0, NsVbi=np.Inf, method='newton'):
d2mutau=0, NsVbi=np.Inf, breakdown_factor=0.,
breakdown_voltage=-5.5, breakdown_exp=3.28,
method='newton'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's bad form to rely on the position of a keyword argument. Don't worry about it.

@CameronTStark CameronTStark merged commit 7bd1a3f into pvlib:master Apr 11, 2020
@CameronTStark
Copy link
Contributor

Thanks @cwhanse!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants