-
Notifications
You must be signed in to change notification settings - Fork 1.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
Migrate spectral modifier functions to pvlib.spectrum #1628
Conversation
Good move! Still thinking about the names and wondering what naming patterns they conform to and which patterns are currently gaining or losing popularity. Subspecies (?) is often at the end. |
docs/sphinx/source/reference/effects_on_pv_system_output/spectrum.rst
Outdated
Show resolved
Hide resolved
docs/sphinx/source/reference/effects_on_pv_system_output/spectrum.rst
Outdated
Show resolved
Hide resolved
in coordination with pvlib#1658, drop "spectral_correction" from the new function names
I'm not in favor of shortening the function names to just the author names. I though we had some other discussion recently where that was discouraged actually. |
I had a similar thought recently, thanks for pulling this together! |
My thought was that function names in other modules don't include the type of the model, e.g. it's not |
I don't know if this scales, but maybe we can reach out to authors and ask them what they'd like the function name to be. I agree with shortening the function names when the module conveys the function purpose, but, that creates a pit for new users to fall into:
etc. Another thought to toss out: we could add a publication year to the function name to create space for e.g. another model from First Solar. |
I think the year may be added on occasion, but I don't think this is a global solution. There are few modules/namespaces as focused and conveniently short as Spectrum does not contain only one type of function, so I think the functions need a suitable prefix. The latest addition to this module got a nice long name: calc_spectral_mismatch_field so if we take that as a starting point the new ones could be:
I somewhat hesitate to use spectral_mismatch in the names of the empirical models or approximations. I'm also not sure about the |
These work for me.
Ditto. |
I have updated to |
I'll be anticipating some PR's with renames then! |
Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com>
Looking back through the discussion, it seems like the current state of the PR is acceptable to those who expressed opinions on the matter. I'll go ahead and merge to prevent it from languishing again. Codecov failure can be ignored. |
following the conventions set out in pvlib#1628
* Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Merge branch 'Spectral-corrections' of https://github.com/Jacc0027/pvlib-python into Spectral-corrections * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update pvlib/atmosphere.py Co-authored-by: Kevin Anderson <57452607+kanderso-nrel@users.noreply.github.com> * relocation of parameter descriptions according to the order of input parameters * Update api.rst Adding atmosphere.AM_AOD_PW_spectral correction as requested in #1296 * remove input screening * move reference values to be optional parameters * fix implementation issues * first cut at tests using file from Jacc0027 * CI correction. Line #215 * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Testing tests * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update atmosphere.py * Test Review * Update atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update test_atmosphere.py * Update atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <cwhanse@sandia.gov> * Update atmosphere.py Added the requested changes * Update atmosphere.py Fixed 2 blank line errors. * Update test_atmosphere.py Updated test function name to: caballero_spectral_correction * Update api.rst Updated the atmosphere function name from AM_AOD_PW_spectral_correction to caballero_spectral_correction * Update test_atmosphere.py Updated some functions calls from AM_AOD_PW_spectral_correction to caballero_spectral_correction * Update atmosphere.py Updated the logic to show errors. * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <cwhanse@sandia.gov> * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <cwhanse@sandia.gov> * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <cwhanse@sandia.gov> * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <cwhanse@sandia.gov> * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <cwhanse@sandia.gov> * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <cwhanse@sandia.gov> * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py Trying to solve #814 and #817 issues. * Update atmosphere.py * Update api.rst * Delete api.rst * Update test_atmosphere.py * Update atmosphere.py * Update test_atmosphere.py * Update atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * update function logic and get tests working * Update atmosphere.py Updated both "TODO" issues. * Update atmosphere.py * Update v0.9.6.rst Added caballero spectral correction as a new function. * Update airmass_atmospheric.rst Added a new function: atmosphere.caballero_spectral_correction * Update pvlib/atmosphere.py Co-authored-by: Anton Driesse <anton.driesse@pvperformancelabs.com> * rename function and move to pvlib.spectrum following the conventions set out in #1628 * misc cleanup - reorder and rename parameters to match #1768 - remove reference parameters - shorten/simplify docstring - restructure calculation to be more readable --------- Co-authored-by: Kevin Anderson <57452607+kanderso-nrel@users.noreply.github.com> Co-authored-by: Kevin Anderson <kevin.anderson@nrel.gov> Co-authored-by: Cliff Hansen <cwhanse@sandia.gov> Co-authored-by: Anton Driesse <anton.driesse@pvperformancelabs.com> Co-authored-by: Kevin Anderson <kevin.anderso@gmail.com>
[ ] Closes #xxxxdocs/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.As suggested in #1062 (comment) and maybe elsewhere, this PR moves the functions for First Solar and SAPM spectral modifiers to the
pvlib.spectrum.mismatch
module.I also thought as long as we are moving things, it would be good to renamesapm_spectral_loss
tosapm_spectral_correction
.Currently, the two functions are renamed to justNow renamed tospectrum.sapm
andspectrum.first_solar
.spectrum.spectral_factor_firstsolar
andspectrum.spectral_factor_sapm
Do others agree with this change? Shouldpvlib.pvsystem.PVSystem.sapm_spectral_loss
be renamed as well?