-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[BUG]: Infer spectral models correctly #2253
base: main
Are you sure you want to change the base?
[BUG]: Infer spectral models correctly #2253
Conversation
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.
Maybe we're trying too hard to help. I'm inclined to default to the no_loss
model if parameters are not found, regardless of Technology
, Material
or weather
.
Or just do away with the inference altogether and set to no_loss
if spectral_model=None
Co-Authored-By: Cliff Hansen <[email protected]>
|
|
Are this PR changes desired in pvlib or is another way of handling / changing this behaviour desired? |
@echedey-ls I'm more inclined to remove the inference altogether, rather than continue to check the module parameters and/or the weather. This changed code preserves the old behavior, which is somewhat murky and was not well-documented (e.g., which values of "Technology" and "Material" led to which spectral models?) Also, the added inspection of weather is not used by the "run_model_" routines, so a user may expect that the ModelChain will handle all that spectral stuff for him, only to find out later that there was no spectral adjustment in the model results. These are the reasons I think that |
@cwhanse I strongly agree with that. Shall I remove the function that makes the explicit inference too? I would keep it so users can explicitly make the inference, it's easier to expand in the future and may even return a collection of models the ModelChain + weather can be used for. |
I would vote yes. |
I think we keep the inference, but return 'no_loss' unless parameters for the 'sandia' or 'first_solar' models are found. I would not inspect 'weather' in that inference. If a user passes the 'first_solar' parameters with 'module_parameters' they should know enough to include 'precipitable_water' in 'weather'. |
[ ] Updates entries indocs/sphinx/source/reference
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`
).remote-data
) and Milestone are assigned to the Pull Request and linked Issue.Fix #2017 - note the approach may have been different. In this case, spectral inference has been deferred until weather is known, in order to take its available parameters for the inference.
Tested for script:
Code cleaned up from #2017
Still haven't added tests, please let me know what you think about the behaviour first.