-
Notifications
You must be signed in to change notification settings - Fork 1.1k
preconfigured ModelChain for pvwatts, sapm #1022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@cwhanse are you ok with the pattern drafted here? |
Yes, I prefer the factory to the subclass but not strongly. |
@cwhanse can you provide any additional default options for the pvsyst configuration? Let me know if I missed anything for sapm, too. |
pvlib/modelchain.py
Outdated
losses_model: pvwatts_losses | ||
""" | ||
|
||
kwargs.update(PVWATTS_CONFIG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is overlap in kwargs, this prioritizes PVWATTS_CONFIG
, e.g. if the user passes transposition_model='isotropic'
, 'perez'
will get used anyway. Should these lines should be config = PVWATTS_CONFIG.copy(); config.update(kwargs)
so that user-supplied parameters take precedence over the defaults? Or maybe if people want to mix and match models, they should just use the main ModelChain constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Yes and yes. I'll change the code, document the behavior, and encourage use of the main constructor for maximum flexibility.
@cwhanse this is ready for review. I suspect we'll need to modify the default configurations. |
anything else on this PR @cwhanse? |
docs/sphinx/source/api.rst
for API changes.docs/sphinx/source/whatsnew
for all changes. Includes link to the GitHub Issue with:issue:`num`
or this Pull Request with:pull:`num`
. Includes contributor name and/or GitHub username (link with:ghuser:`user`
).