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.
When wanting to test different decomposition models in batch, I find myself having to iterate a decomp_model string list and use a if/else structure which calls the appropriate decomposition model or store the decomposition function into an external variable decomp_func = getattr(pvlib.irradiance, decomp_model).
Describe the solution you'd like
Having a get_irradiance_components, a decomposition equivalent to get_total_irradiance, would do the same trick as the getattr and be built-in within pvlib.
Additional context get_total_irradiance could likely work as a template for what I'm suggesting.
Would you be willing to provide more context around this?
These types of problems are generally more cleanly solved by dependency injection (DI) than if/else statements or switch arguments to "god" functions. Also, the DI solutions tend to be more readily extensible if-when new decomposition models come along.
Activity
[-]Add get_irradiance_components function[/-][+]Add `get_irradiance_components` function[/+]markcampanelli commentedon Aug 29, 2026
Would you be willing to provide more context around this?
These types of problems are generally more cleanly solved by dependency injection (DI) than if/else statements or switch arguments to "god" functions. Also, the DI solutions tend to be more readily extensible if-when new decomposition models come along.