You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pvlib/ivtools/sdm.py is currently rather lengthy at ~1350 lines of code. Near-term additions (#2212 and #2185) will bring it to ~2000. I suggest we split up sdm.py into submodules, similar to what was recently done in pvlib.spectrum (#2125).
Current and future functionality spans:
estimating parameter values for various SDMs using various data sources
I love that idea.
Can we drop the first underscore in filenames suggestions? Users importing from file namespace (instead of submodule through __init__.py) may think these are private files (weak internal use in PEP-8. Source.)
Should the calcparams_XX functions be moved to pvlib.ivtools.sdm?
Given they are currently in pvlib.pvsystem, +1. But probably in a separate PR, or at least be extra careful with deprecations.
Imagining myself as a user, it seems more natural to first look for a function that fit a specific model (e.g. CEC) and then filter by the kind of data available (IEC61853 or datasheet), which suggests ivtools.sdm.cec. As you point out, though, that pattern would require importing (from somewhere) a number of private/supporting functions that are used by both of the sandia methods.
I was imagining that the user experience would not change; all functions would still be accessed and documented via pvlib.ivtools.sdm.<function_name>. Users need not even know about the underlying modules. Rather, the effect of the reorganization would be to improve the developer experience.
Activity
echedey-ls commentedon Oct 10, 2024
I love that idea.
Can we drop the first underscore in filenames suggestions? Users importing from file namespace (instead of submodule through
__init__.py) may think these are private files (weak internal use in PEP-8. Source.)cwhanse commentedon Oct 10, 2024
Imagining myself as a user, it seems more natural to first look for a function that fit a specific model (e.g. CEC) and then filter by the kind of data available (IEC61853 or datasheet), which suggests
ivtools.sdm.cec. As you point out, though, that pattern would require importing (from somewhere) a number of private/supporting functions that are used by both of thesandiamethods.kandersolar commentedon Oct 10, 2024
I was imagining that the user experience would not change; all functions would still be accessed and documented via
pvlib.ivtools.sdm.<function_name>. Users need not even know about the underlying modules. Rather, the effect of the reorganization would be to improve the developer experience.kandersolar commentedon Oct 11, 2024
After more thought, I am warming to the idea of organizing by model. I will open a PR for consideration.