Skip to content

Conversation

kandersolar
Copy link
Member

@kandersolar kandersolar commented Sep 29, 2025

  • [ ] Closes #xxxx
  • I am familiar with the contributing guidelines
  • 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.

Projected solar zenith angle (tan_phi) is calculated several times in the infinite_sheds workflow. This PR calculates it once and passes it around, simplifying the relevant utility functions and their signatures.

For context, this is a step towards future enhancements I intend to make to pvlib.bifacial, which would benefit from working with tan_phi instead of the base solar position and module angles.

@kandersolar kandersolar added this to the v0.13.2 milestone Sep 29, 2025
@echedey-ls
Copy link
Contributor

You've probably got the email, but docs are failing with:

This failing example

Extension error:
Here is a summary of the problems encountered when running the examples:
Unexpected failing examples (1):
    ../../examples/agrivoltaics/plot_agrivoltaics_ground_irradiance.py failed leaving traceback:
    Traceback (most recent call last):
      File "/home/docs/checkouts/readthedocs.org/user_builds/pvlib-python/checkouts/2559/docs/examples/agrivoltaics/plot_agrivoltaics_ground_irradiance.py", line 145, in <module>
        unshaded_ground_fraction = pvlib.bifacial.utils._unshaded_ground_fraction(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: _unshaded_ground_fraction() got an unexpected keyword argument 'surface_azimuth'

My opinion is that it's bad practice to use internals in public-facing examples. But a fix, using internals or not, is okay with me.

Also, I think this deserves a whatsnew 👀
Nice improvement.

@kandersolar
Copy link
Member Author

My opinion is that it's bad practice to use internals in public-facing examples.

Agreed. We should consider making that ground shaded fraction function public.

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.

2 participants