pvlib / twoaxistracking

twoaxistracking is a python package for simulating two-axis tracking solar collectors, particularly self-shading.
https://twoaxistracking.readthedocs.io
BSD 3-Clause "New" or "Revised" License
8 stars 4 forks source link

Add return_geometries parameter to shaded_fraction #33

Closed AdamRJensen closed 2 years ago

AdamRJensen commented 2 years ago

Closes #12

This PR adds a parameter called return_geometries to the shaded_fraction function. When this parameter is True, the function returns a tuple (shading_fraction, geometries), where geometries is a dictionary containing the unshaded area and the shading areas. When return_geometries is False, only the shading fraction is returned (default behavior).

The PR also removes the total_collector_area from the rectangular_geometry and circular_geometry in order to simplify the tests.

kandersolar commented 2 years ago

I can't do a full review today, but after a quick look it seems like shading_geometries is a sometimes a Polygon and sometimes a list of Polygons. Would it be better to return a list in all cases, and that list is empty for cases with no shading geometries (e.g. sun below horizon)?

AdamRJensen commented 2 years ago

I can't do a full review today, but after a quick look it seems like shading_geometries is a sometimes a Polygon and sometimes a list of Polygons. Would it be better to return a list in all cases, and that list is empty for cases with no shading geometries (e.g. sun below horizon)?

But of course. Your sharp mind strikes again!

AdamRJensen commented 2 years ago

Thanks for the review @kanderso-nrel 🙏