Skip to content

Add test for vf_ground_sky_2d view factor bounds#2690

Open
Chirag3841 wants to merge 1 commit intopvlib:mainfrom
Chirag3841:fix-vf-ground-sky-wedge-clean
Open

Add test for vf_ground_sky_2d view factor bounds#2690
Chirag3841 wants to merge 1 commit intopvlib:mainfrom
Chirag3841:fix-vf-ground-sky-wedge-clean

Conversation

@Chirag3841
Copy link

  • [x ] Closes bifacial.utils.vf_ground_sky_2d interprets max_rows asymmetrically #1867
  • [ x] I am familiar with the contributing guidelines
  • [ x] Tests added
  • Updates entries in docs/sphinx/source/reference for API changes.
  • [ x] 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.
  • [ x] 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.

Description

Fixes an off-by-one / fencepost issue in vf_ground_sky_2d where one fewer sky
wedge was considered on the right side compared to the left side in symmetric
geometries.

The fix includes horizon bounds (cos(0)=1 and cos(pi)=-1) so the wedge
calculation is consistent on both sides.

Tests

Added a regression test test_vf_ground_sky_2d_returns_valid_range to ensure
the returned view factor stays within the physically valid range [0, 1].

@Chirag3841
Copy link
Author

@AdamRJensen I implemented a fix for the fencepost/off-by-one issue in vf_ground_sky_2d
and added related regression test too.

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.

bifacial.utils.vf_ground_sky_2d interprets max_rows asymmetrically

1 participant