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
Is your feature request related to a problem? Please describe.
A lot of times constants are referenced in the documentation, but the only way to access them is either by visual inspection of the code or importing the object that contains it programmatically.
Describe the solution you'd like
Include constants in a toctree and add their respective documentation.
Describe alternatives you've considered
A toctree dedicated exclusively to all pvlib constants.
Agree with Kevin that they should be documented near where they belong. I am overall very supportive of documenting them! For example, the SURFACE_ALBEDOS comes from a publication and that would be nice to know.
Should we consider properties for constants. Although highly unlikely, constants could be accidentally overwritten and currently nothing in pvlib would alert you to this. Although clumsy a property is read only and cannot be changed without a set method
Although highly unlikely, constants could be accidentally overwritten and currently nothing in pvlib would alert you to this
I'm only in favour about marking their type as Final. It would alert linters.
The same way we almost never check input values to models because we expect the user-base to know what they are doing, I would not try to over-complicate providing some handy values.
Agreed, I only mention it here for posterity in case this becomes an issue again in the future. The documentation of TEMPERATURE was previously an issue, & I had suggested making it a class which allows it & its members to be documented. This was a drop in replacement, although admittedly unnecessarily overcomplicated
Hi, I’d like to contribute to this issue. Would a focused PR documenting SURFACE_ALBEDOS alongside the related irradiance functions, including its source reference, be a useful starting point?
Activity
kandersolar commentedon Jun 18, 2024
To my knowledge, the current sphinx docs document only one module-level variable; see the bottom of this page: https://pvlib-python.readthedocs.io/en/stable/reference/pv_modeling/temperature.html
I think documenting the variables near the functions they are related to makes sense. I don't think a toctree for all variables makes sense.
AdamRJensen commentedon Jun 18, 2024
Agree with Kevin that they should be documented near where they belong. I am overall very supportive of documenting them! For example, the
SURFACE_ALBEDOScomes from a publication and that would be nice to know.mikofski commentedon Jun 18, 2024
Should we consider properties for constants. Although highly unlikely, constants could be accidentally overwritten and currently nothing in pvlib would alert you to this. Although clumsy a property is read only and cannot be changed without a
setmethodechedey-ls commentedon Jun 18, 2024
I'm only in favour about marking their type as Final. It would alert linters.
The same way we almost never check input values to models because we expect the user-base to know what they are doing, I would not try to over-complicate providing some handy values.
mikofski commentedon Jun 19, 2024
Agreed, I only mention it here for posterity in case this becomes an issue again in the future. The documentation of
TEMPERATUREwas previously an issue, & I had suggested making it a class which allows it & its members to be documented. This was a drop in replacement, although admittedly unnecessarily overcomplicatedanshurajbisoyi98-ctrl commentedon Oct 4, 2026
Hi, I’d like to contribute to this issue. Would a focused PR documenting
SURFACE_ALBEDOSalongside the related irradiance functions, including its source reference, be a useful starting point?cwhanse commentedon Oct 4, 2026
@anshurajbisoyi98-ctrl that would be welcome. Please ensure any AI content is vetted before you submit.