Skip to content

Add lambertw_pvlib#2723

Open
cwhanse wants to merge 3 commits intopvlib:mainfrom
cwhanse:lambertw
Open

Add lambertw_pvlib#2723
cwhanse wants to merge 3 commits intopvlib:mainfrom
cwhanse:lambertw

Conversation

@cwhanse
Copy link
Member

@cwhanse cwhanse commented Mar 23, 2026

  • Closes #xxxx
  • I am familiar with the contributing guidelines
  • I attest that all AI-generated material has been vetted for accuracy and is in compliance with the pvlib license
  • Tests added
  • Updates entries in docs/sphinx/source/reference 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 (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

Add a real-valued-only Lamberts W function. As tested, function is as precise as scipy's lambertw, and 4x faster due to not doing all arithmetic with complex values.

@cwhanse
Copy link
Member Author

cwhanse commented Mar 23, 2026

Once this is accepted, next PR will replace calls to scipy's lambertw in ivtools. I'm splitting this in two parts, since it's not a matter of replacing a function name. The private function _log_lambertw handles the overflow cases that are computed using a Newton's technique in the ivtools functions.

@cwhanse
Copy link
Member Author

cwhanse commented Mar 23, 2026

Put this in pvlib.tools or in pvlib.ivtools.utils? Make lambertw_pvlib private?

pvlib docs don't provide links to public function in either of these folders so there's no API change.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant