Description
Is your feature request related to a problem? Please describe.
pvlib.spectrum.spectral_factor_firstsolar
contains data screens for precipitable_water
and airmass_absolute
that change input data. Max/min values can be set for precipitable_water
by the user but not airmass_absolute
.
I see two issues:
- Changing data in any circumstance is a serious question, but in this case specifically I do not think it is pvlib's job to change user data.
- User control and the function's flexibility is impeded by the absence of module parameters to control min/max
airmass_absolute
.
Describe the solution you'd like
I can think of several potential solutions but would like community feedback on what should be implemented. Based on the feedback, I can create a PR with proposed changes. Current ideas:
- Do nothing.
- Remove all data screens for
airmass_absolute
andprecipitable_water
- Retain data screens but replace actions to change user data with only warnings to the user that the input data exceeds the thresholds, and these thresholds can either be:
- Defined by the user, or
- Defined by the developer
- Add new arguments (
max_airmass_absolute
andmin_airmass_absolute
) topvlib.spectrum.spectral_factor_firstsolar
so that the user can define min/max values forairmass_absolute
in the same way they can definemax_precipitable_water
andmin_precipitable_water
, and their input data will be changed accordingly. - Something else?
Additional context
I understand this issue touches on a question about the role of pvlib as a toolbox and to what extent it should hold the user's hand through the application of its functions. I touched on the subject in this informal blog post where I used the same spectral factor function as an example. At the very least, I don't think we should be changing user data without letting the user control this change. Going a step further, I don't think this function should include within it an action to change user data. It's job is to calculate the spectral mismatch factor given a set of airmass_absolute
and precipitable_water
values. I see room for including warnings to advise the user.