diff --git a/docs/sphinx/source/whatsnew/v0.7.0.rst b/docs/sphinx/source/whatsnew/v0.7.0.rst index c88400a5de..06bdd7e041 100644 --- a/docs/sphinx/source/whatsnew/v0.7.0.rst +++ b/docs/sphinx/source/whatsnew/v0.7.0.rst @@ -19,6 +19,8 @@ API Breaking Changes of W/m2 rather than suns. * Calling :py:func:`pvlib.pvsystem.retrieve_sam` with no parameters will raise an exception instead of displaying a dialog. +* The `modelchain.ModelChain.diode_params` attribute is now formatted in + a pandas.DataFrame with `DatetimeIndex`, rather than in a tuple. API Changes with Deprecations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 2b9c093a67..45a9f5ca98 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -8,6 +8,7 @@ from functools import partial import warnings +import pandas as pd from pvlib import (atmosphere, clearsky, pvsystem, solarposition, temperature, tools) @@ -453,9 +454,11 @@ def _singlediode(self, calcparams_model_function): calcparams_model_function(self.effective_irradiance, self.cell_temperature)) - self.diode_params = (photocurrent, saturation_current, - resistance_series, - resistance_shunt, nNsVth) + self.diode_params = pd.DataFrame({'I_L': photocurrent, + 'I_o': saturation_current, + 'R_s': resistance_series, + 'R_sh': resistance_shunt, + 'nNsVth': nNsVth}) self.dc = self.system.singlediode( photocurrent, saturation_current, resistance_series, @@ -926,12 +929,11 @@ def run_model(self, weather, times=None): ------- self - Notes - ----- Assigns attributes: ``solar_position``, ``airmass``, ``irradiance``, ``total_irrad``, ``effective_irradiance``, ``weather``, ``cell_temperature``, ``aoi``, ``aoi_modifier``, ``spectral_modifier``, - ``dc``, ``ac``, ``losses``. + ``dc``, ``ac``, ``losses``, + ``diode_params`` (if dc_model is a single diode model) """ if times is not None: warnings.warn('times keyword argument is deprecated and will be '