This issue is intended to discuss the API for adding diffuse component-specific IAM calculations to the Array class.
This is part of my GSoC 2026 project, more specifically, part of the second phase of the project, with the goal of adding support for diffuse components and component-wise IAM in ModelChain. The plan is described in more detail in #2811.
Once diffuse irradiance components are available from Array.get_irradiance(), Array.get_iam() must also be updated to support diffuse component-specific IAM (isotropic sky, horizon, and ground). Currently, only direct IAM is returned.
There are a few ways this can be done:
- Split the existing
get_iam into get_iam_direct (preserving the current behavior) and get_iam_diffuse (returning diffuse component-specific IAM)
- Keep a single
get_iam method that can optionally return both direct and diffuse IAM
- Keep a single
get_iam method that computes either direct or diffuse IAM depending on the requested arguments
Personally, I am partial to the first option since the functionality of each becomes clearer to the user, but I believe there should be a consensus on this. It's worth mentioning that renaming get_iam() is a breaking change and would need a deprecation period.
Another API question is how diffuse IAM values should be returned. Should they be returned as a dict or DataFrame, keeping in line with the treatment of diffuse components in pvlib.irradiance?
This issue is intended to discuss the API for adding diffuse component-specific IAM calculations to the
Arrayclass.This is part of my GSoC 2026 project, more specifically, part of the second phase of the project, with the goal of adding support for diffuse components and component-wise IAM in
ModelChain. The plan is described in more detail in #2811.Once diffuse irradiance components are available from
Array.get_irradiance(),Array.get_iam()must also be updated to support diffuse component-specific IAM (isotropic sky, horizon, and ground). Currently, only direct IAM is returned.There are a few ways this can be done:
get_iamintoget_iam_direct(preserving the current behavior) andget_iam_diffuse(returning diffuse component-specific IAM)get_iammethod that can optionally return both direct and diffuse IAMget_iammethod that computes either direct or diffuse IAM depending on the requested argumentsPersonally, I am partial to the first option since the functionality of each becomes clearer to the user, but I believe there should be a consensus on this. It's worth mentioning that renaming
get_iam()is a breaking change and would need a deprecation period.Another API question is how diffuse IAM values should be returned. Should they be returned as a
dictorDataFrame, keeping in line with the treatment of diffuse components inpvlib.irradiance?