Skip to content

Add bifacial scaling to Townsend snow loss model#2756

Open
shethkajal7 wants to merge 1 commit into
pvlib:mainfrom
shethkajal7:add-bifacial-townsend-snow
Open

Add bifacial scaling to Townsend snow loss model#2756
shethkajal7 wants to merge 1 commit into
pvlib:mainfrom
shethkajal7:add-bifacial-townsend-snow

Conversation

@shethkajal7
Copy link
Copy Markdown

@shethkajal7 shethkajal7 commented May 17, 2026

Add optional front_side_fraction argument to loss_townsend for bifacial snow loss adjustment. Includes test coverage for the scaling behavior.

Description

This PR adds an optional front_side_fraction argument to pvlib.snow.loss_townsend.

The new argument allows users to scale the calculated Townsend snow loss by the front-side energy fraction for bifacial systems. This follows the bifacial guidance in Townsend and Previtali (2023), where bifacial snow modeling uses total front + rear POA in the Townsend calculation and then scales the resulting loss by the front-side energy contribution.

The default value is None, so existing behavior is unchanged.

Changes

  • Add optional front_side_fraction keyword argument to loss_townsend
  • Document bifacial usage in the function docstring
  • Add test coverage confirming that front_side_fraction scales the existing Townsend result correctly

Backward compatibility

This change is backward compatible. When front_side_fraction=None, the function follows the existing behavior.

Tests

Ran locally:

python -m pytest tests/test_snow.py -k townsend
python -m ruff check pvlib/snow.py tests/test_snow.py

Both passed.

Checklist

  • Closes Enhancement to Townsend monthly snow loss model for engineering workflows #2755
  • 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:`shethkajal7`).
  • 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 optional front_side_fraction argument to loss_townsend for bifacial snow loss adjustment. Includes test coverage for the scaling behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement to Townsend monthly snow loss model for engineering workflows

1 participant