8000 *– Formatting of ModelChain.diode_params in pandas.DataFrame (#832) · shirubana/pvlib-python@718bd93 · GitHub
[go: up one dir, main page]

Skip to content

Commit 718bd93

Browse files
tylunelcwhanse
authored andcommitted
*� Formatting of ModelChain.diode_params in pandas.DataFrame (pvlib#832)
Changes ModelChain.diode_params from tuple to DataFrame
1 parent 5f7e9d6 commit 718bd93

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-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: 8 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,
@@ -926,12 +929,11 @@ def run_model(self, weather, times=None):
926929
-------
927930
self
928931
929-
Notes
930-
-----
931932
Assigns attributes: ``solar_position``, ``airmass``, ``irradiance``,
932933
``total_irrad``, ``effective_irradiance``, ``weather``,
933934
``cell_temperature``, ``aoi``, ``aoi_modifier``, ``spectral_modifier``,
934-
``dc``, ``ac``, ``losses``.
935+
``dc``, ``ac``, ``losses``,
936+
``diode_params`` (if dc_model is a single diode model)
935937
"""
936938
if times is not None:
937939
warnings.warn('times keyword argument is deprecated and will be '

0 commit comments

Comments
 (0)
0