Skip to content

Add examples for run_model_from_poa() and run_model_from_effective_irradiance()#2621

Open
Chirag3841 wants to merge 24 commits intopvlib:mainfrom
Chirag3841:add-examples-poa-irrad
Open

Add examples for run_model_from_poa() and run_model_from_effective_irradiance()#2621
Chirag3841 wants to merge 24 commits intopvlib:mainfrom
Chirag3841:add-examples-poa-irrad

Conversation

@Chirag3841
Copy link

@Chirag3841 Chirag3841 commented Dec 11, 2025

@cwhanse

Description

This pull request adds clear and practical usage examples to the run_model_from_poa and run_model_from_effective_irradiance methods in pvlib.modelchain.ModelChain. These two functions are widely used, but until now the documentation did not contain complete examples demonstrating how to prepare input data or how the methods should be used in real workflows.

This PR introduces both single-array and multi-array examples for each method. The single-array examples show a minimal and straightforward modeling setup using PVSystem, Location, and ModelChain along with the required irradiance or effective irradiance DataFrame. The multi-array examples demonstrate how to correctly structure per-array inputs, showing how users should supply multiple DataFrames with aligned indexes and consistent ordering to match the system’s arrays.

These examples are especially important because multi-array usage is not intuitive without seeing a working format.

@Chirag3841
Copy link
Author

Chirag3841 commented Dec 11, 2025

@cwhanse
Fresh PR created as per requirement.

Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
@Chirag3841
Copy link
Author

@cwhanse
Any changes required sir now ?

@Chirag3841
Copy link
Author

@cwhanse
Sir what can I do now ?

@cwhanse
Copy link
Member

cwhanse commented Dec 16, 2025

@cwhanse Sir what can I do now ?

Have you tried to run the examples? When I do, I get errors: Array is not imported, Array doesn't take tilt as a parameter, probably others. It's important that examples are executable for a user.

@Chirag3841
Copy link
Author

Okay sir I will do that

@Chirag3841 Chirag3841 force-pushed the add-examples-poa-irrad branch from 8e54b17 to af125da Compare February 6, 2026 06:51
@Chirag3841
Copy link
Author

@cwhanse Now,I ran the doctest cases carefully, and everything passed without any errors.

@cwhanse
Copy link
Member

cwhanse commented Feb 6, 2026

@Chirag3841 can you fix the lint error, and also, merge pvlib:main into this branch? The doc build failure was fixed recently, has to do with pandas frequency strings and not with your PR.

@Chirag3841
Copy link
Author

@cwhanse I have removed that lint issue in line number 1943 and merge pvlib:main into this branch.

Copy link
Member

@cwhanse cwhanse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cwhanse cwhanse added this to the v0.15.1 milestone Feb 6, 2026
Chirag3841 and others added 5 commits February 6, 2026 22:15
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
@Chirag3841
Copy link
Author

@cwhanse I have added that note in documentation section in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add examples for run_model methods, add docstrings for ModelChain constants

2 participants