Description
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 well -
pvlib/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 see mismatch.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.
- Is splitting
pvlib/spectrum/mismatch.py
a good idea?
If yes: - Alternative categorisation structure?
- Alternative file names?
I'd be happy to work on this if we reach a consensus. I'm looking forward to hearing your views.