Skip to content

Commit 09ae6ad

Browse files
committed
*� Formatting of ModelChain.diode_params in pandas.DataFrame
1 parent 9635a40 commit 09ae6ad

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

docs/sphinx/source/whatsnew/v0.7.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ API Breaking Changes
1919
of W/m2 rather than suns.
2020
* Calling :py:func:`pvlib.pvsystem.retrieve_sam` with no parameters will raise
2121
an exception instead of displaying a dialog.
22+
* The `modelchain.ModelChain.diode_params` attribute is now formatted in
23+
a pandas.DataFrame with `DatetimeIndex`, rather than in a tuple.
2224

2325
API Changes with Deprecations
2426
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pvlib/modelchain.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from functools import partial
1010
import warnings
11+
import pandas as pd
1112

1213
from pvlib import (atmosphere, clearsky, pvsystem, solarposition, temperature,
1314
tools)
@@ -453,9 +454,11 @@ def _singlediode(self, calcparams_model_function):
453454
calcparams_model_function(self.effective_irradiance,
454455
self.cell_temperature))
455456

456-
self.diode_params = (photocurrent, saturation_current,
457-
resistance_series,
458-
resistance_shunt, nNsVth)
457+
self.diode_params = pd.DataFrame({'I_L': photocurrent,
458+
'I_o': saturation_current,
459+
'R_s': resistance_series,
460+
'R_sh': resistance_shunt,
461+
'nNsVth': nNsVth})
459462

460463
self.dc = self.system.singlediode(
461464
photocurrent, saturation_current, resistance_series,
@@ -924,9 +927,11 @@ def run_model(self, weather, times=None):
924927
-------
925928
self
926929
927-
Assigns attributes: solar_position, airmass, irradiance,
928-
total_irrad, effective_irradiance, weather, cell_temperature, aoi,
929-
aoi_modifier, spectral_modifier, dc, ac, losses.
930+
Assigns attributes: ``solar_position``, ``airmass``, ``irradiance``,
931+
``total_irrad``, ``effective_irradiance``, ``weather``,
932+
``cell_temperature``, ``aoi``, ``aoi_modifier``, ``spectral_modifier``,
933+
``dc``, ``ac``, ``losses``,
934+
``diode_params`` (if dc_model is a single diode model)
930935
"""
931936
if times is not None:
932937
warnings.warn('times keyword argument is deprecated and will be '

0 commit comments

Comments
 (0)