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
When I proposed pvlib.ivtools I had in mind only the use case of fitting single diode models for PV modules. I expect to see PRs soon with a function to fit the Sandia inverter model (to measured efficiency curves), and functions for the Loss Factor Model. These don't meet the narrow scope of the current ivtools. There are likely other model fitting functions that could be of interest to pvlib users.
#708 refactors ivtools to separate functions into modules sde and sdm for single diode equation and model fitting, respectively. In hindsight, ivtools is too generic, since it doesn't communicate what the module does besides something with IV curves.
An alternate home for model fitting functions, including those in ivtools, might be pvanalytics. But the inverter model fitting code doesn't seem natural there, either, since pvanalytics is primarily being designed for analysis of time-series data from PV systems.
Options:
keep pvlib.ivtools, and stick fit_inverter_snl (or whatever it's named) into pvlib.pvsystem.
add fitting functions to the code module containing the related model function, e.g., put fit_inverter_snl into pvlib.pvsystem or merge Create inverter.py #886 and add fit_inverter_snl there.
create a new module with a broader name than ivtools to contain all model fitting functions, divided up into appropriate modules.
-1 on pvanalytics, IMO generating inverter and PV-module parameters should be the job of pvlib
My personal preference would be to split pvsystem.py out into pvmodules.py and inverters.py, then fit_inverters* and the inverter models would be in inverters.py and ditto for PV-modules. If that's too specific, then PV-modules and inverters could be in components.py which could be a catchall for PV-modules, inverters, trackers, batteries, cabling, xfmrs, etc.
Activity
mikofski commentedon Mar 9, 2020
-1 on pvanalytics, IMO generating inverter and PV-module parameters should be the job of pvlib
My personal preference would be to split
pvsystem.pyout intopvmodules.pyandinverters.py, thenfit_inverters*and the inverter models would be ininverters.pyand ditto for PV-modules. If that's too specific, then PV-modules and inverters could be incomponents.pywhich could be a catchall for PV-modules, inverters, trackers, batteries, cabling, xfmrs, etc.pvsystemis too long, Breaking out parts of pvsystem.py? #436pvsystemwould still havePVSystemclass and some system performance functions likesinglediode,max_power_point, etccalcparams*,retrieve_sam,snl_inverter,adrinverteror another way to split them would be
pvsystem/performance.pyandpvsystem/parameters.py?cwhanse commentedon Mar 10, 2020
I'd favor
pvmodule.pyandinverter.pyover the (IMO) too-genericcomponent.py,parameters.py, etc.wholmgren commentedon Mar 10, 2020
+/- 0 on moving the fit code to
pvanalytics.-1 on adding it to existing
pvsystem.py.+1 on breaking up
pvsystem.pyand uncertain on moving the fit functions into the relevant new modules.-1 on a
pvsystemsubpackage at this point in time.wholmgren commentedon Aug 28, 2020
ok to close this @cwhanse?
cwhanse commentedon Aug 28, 2020
yes