You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose we make all these functions private (add a leading underscore to their names). I doubt they get any meaningful amount of use, so I wouldn't bother with a deprecation for any of them.
Unless I'm mistaken, the calculation in calculate_deltat is not actually part of the SPA, despite living in spa.py. I wonder if it should be moved from solarposition.py. If we did that, then none of the functions in spa.py would really be user-facing (they are all supposed to be used by the wrappers in solarposition.py) and I guess the entire module could be made private (pvlib._spa).
I've gone back and forth on this and ultimately I guess it's ok. It seems unnecessarily hostile to users that actually went to the effort to read source code, and we want more of those users rather than antagonizing the few that we have. I've used some of these functions in my own code, but I'm not the typical user and I can update it if I need to. And I'd like to see spa moved to its own package, but who wants to support that? Which is the point, isn't it?
My thinking is that (with the possible exception of pvlib.tools) functions should either (1) have a stable interface and be fully documented in the sphinx docs, or (2) be an implementation detail and marked private with the underscore prefix. My motivation here isn't so much about maintenance/support burden, it's just about moving these functions into one of those two options and out of the no man's land they're in right now. So I'd be fine with bringing the SPA presence in the sphinx docs up to snuff instead of making them private like #1769 does.
I do think the non-SPA functions listed above should probably be private though.
The SPA-related changes in #1769 are now reverted. Now it only changes the other functions listed above. I'd rather improve the SPA docs in a separate PR.
On closer inspection, I realized scaling.latlon_to_xy was intended to be public, it just wasn't listed in the sphinx docs. #1769 now lists it instead of making it private.
Activity
cwhanse commentedon May 30, 2023
Only
pvlib.spa.calculate_deltathas a hyperlink.kandersolar commentedon May 31, 2023
Unless I'm mistaken, the calculation in
calculate_deltatis not actually part of the SPA, despite living inspa.py. I wonder if it should be moved fromsolarposition.py. If we did that, then none of the functions inspa.pywould really be user-facing (they are all supposed to be used by the wrappers insolarposition.py) and I guess the entire module could be made private (pvlib._spa).wholmgren commentedon Jun 15, 2023
I've gone back and forth on this and ultimately I guess it's ok. It seems unnecessarily hostile to users that actually went to the effort to read source code, and we want more of those users rather than antagonizing the few that we have. I've used some of these functions in my own code, but I'm not the typical user and I can update it if I need to. And I'd like to see spa moved to its own package, but who wants to support that? Which is the point, isn't it?
kandersolar commentedon Jun 15, 2023
My thinking is that (with the possible exception of
pvlib.tools) functions should either (1) have a stable interface and be fully documented in the sphinx docs, or (2) be an implementation detail and marked private with the underscore prefix. My motivation here isn't so much about maintenance/support burden, it's just about moving these functions into one of those two options and out of the no man's land they're in right now. So I'd be fine with bringing the SPA presence in the sphinx docs up to snuff instead of making them private like #1769 does.I do think the non-SPA functions listed above should probably be private though.
kandersolar commentedon Jun 20, 2023
The SPA-related changes in #1769 are now reverted. Now it only changes the other functions listed above. I'd rather improve the SPA docs in a separate PR.
kandersolar commentedon Jun 23, 2023
On closer inspection, I realized
scaling.latlon_to_xywas intended to be public, it just wasn't listed in the sphinx docs. #1769 now lists it instead of making it private.