-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Proposal: split up mismatch.py #2125
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
Comments
You mean
I’m -1 on using a pvlib sub package above spectrum called mismatch because it has many meanings, like electrical mismatch or array level mismatch etc another idea instead of mismatch use |
@mikofski I don't mean to create a package above spectrum called mismatch. I agree that would not be a good idea. I mean splitting up the existing
This is also what I meant. So what we have currently is:
and what I was thinking about is taking some functions out of I hope this makes my suggestion clearer than in the original post 😅 |
I agree on rearranging things. I would keep spectral mismatch factors in Another point, do we need deprecations for this? I doubt anybody includes from the |
Thanks for your suggestions @echedey-ls
On this point, what is your thinking behind combining the groups?
Good point. I am not sure --- @AdamRJensen @kandersolar ? |
Mainly because the main topic seems that they are related to calculating spectral mismatch or response from an SR and a spectrum. Also, because the prefix from pvlib import irradiance
from pvlib.spectrum import irradiance This wouldn't work if a file is named irradiance.py under spectrum/. But yeah, we could find some other name I guess. And then we come to the first point, which is why split things that are going to be used for a common purpose. Anyway, not a strong opinion; I'm grateful that the base code gets broke down into smaller and maintainable pieces. |
Because the names of these sub-files aren't seen by the user (functions are imported from pvlib.spectrum), then we're more lenient on using longer filenames. Another response for the prefix, as pointed out by @echedey-ls, is that there's already a file named irradiance.py. Given that the functions are advertised in the documentation as imported from pvlib.spectrum, then we can justify not having a deprecation cycle for the filename changes. As we discussed during today's GSoC group meeting, then I think the preferred naming is:
Also, don't forget to update the |
@AdamRJensen can you write a one sentence description of each of these modules? For those not at the GSoC meeting. |
@RDaxini could you do that? I'm back in the saddle peddling my way through Greece |
So in the GSoC meeting we talked more specifically about the naming and combining subpackages or not. Since the names are similar to the original post suggestion, my understanding is the content is broadly similar too:
ps welcome to join our fun meetings next time @cwhanse :D |
Thanks, that clarifies for me the difference between I'll let you know if I need another meeting :) |
I recommend against repeating "spectral" in the module name - they're already in the |
Should we vote? |
@RDaxini, @kandersolar I think we can conclude that there is a favor for nixing the prefix, you can update #2136 accordingly |
@AdamRJensen ok will do. No computer and limited Internet atm, will do it when I'm back at the end of next week. |
Is your feature request related to a problem? Please describe.
I've been working with the spectrum unit of pvlib a fair bit recently for my GSoC project and I find that the
pvlib/spectrum/mismatch.py
file currently contains a range of functions, several of which are not directly related to spectral mismatch.Current functions in
pvlib/spectrum/mismatch.py
:pvlib.spectrum.get_example_spectral_response
pvlib.spectrum.get_am15g (deprecated v0.11, removed 0.12)
pvlib.spectrum.get_reference_spectra
pvlib.spectrum.calc_spectral_mismatch_field
pvlib.spectrum.spectral_factor_caballero
pvlib.spectrum.spectral_factor_firstsolar
pvlib.spectrum.spectral_factor_sapm
pvlib.spectrum.spectral_factor_pvspec
pvlib.spectrum.spectral_factor_jrc
pvlib.spectrum.sr_to_qe
pvlib.spectrum.qe_to_sr
Describe the solution you'd like
I am wondering whether it might help organise the functions more clearly if we were to split up this file into several subpackages, still within
pvlib/spectrum
.One suggestion:
pvlib/spectrum/mismatch.py
--> covers the effect on PV performance; calculations of spectral mismatch (atmospheric, field, indoor)
pvlib/spectrum/spectral_irr.py
--> covers the outdoor meteorological side of things; all spectral irradiance calcs, e.g.
get_reference_spectra
, possibly movespectrl2
into here as wellpvlib/spectrum/spectral_resp.py
--> covers the PV characteristics side of things, e.g. sr_to_qe / qe_to_sr calculations,
get_example_spectral_response
I think this framework fits with what we have currently and, in terms of future development, I see scope for expansion of
spectral_irr.py
in particular to include for example, function to calculate spectral indices such as the average photon energy. I can seemismatch.py
being expanded to include variants of the standard spectral mismatch factor, or alternatives such as the (weighted) useful fraction.Describe alternatives you've considered
Could just rename
mismatch.py
entirely to broaden its scope, but I think creating a few files here instead would be better for organisation and future development.Additional context
The suggestion above is just one idea to illustrate what I am thinking about. I am keen to hear other views on this idea.
pvlib/spectrum/mismatch.py
a good idea?If yes:
I'd be happy to work on this if we reach a consensus. I'm looking forward to hearing your views.
The text was updated successfully, but these errors were encountered: