Skip to content

Commit 7111058

Browse files
committed
* Formatting of ModelChain.diode_params into pandas.DataFrame
1 parent 9635a40 commit 7111058

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ API Changes with Deprecations
108108
argument for capability during the deprecation period.
109109
* Parameter `pvsystem.DC_MODEL_PARAMS` is renamed to `pvsystem._DC_MODEL_PARAMS`.
110110
Users should not rely on this dictionary's existence or structure.
111+
* The `modelchain.ModelChain.diode_params` attribute is now formatted in
112+
a pandas.DataFrame with `DatetimeIndex`, rather than in a tuple.
111113

112114
Other API Changes
113115
~~~~~~~~~~~~~~~~~

pvlib/modelchain.py

Lines changed: 7 additions & 4 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,7 +929,7 @@ def run_model(self, weather, times=None):
926929
927930
Assigns attributes: solar_position, airmass, irradiance,
928931
total_irrad, effective_irradiance, weather, cell_temperature, aoi,
929-
aoi_modifier, spectral_modifier, dc, ac, losses.
932+
aoi_modifier, spectral_modifier, dc, ac, losses, diode_params.
930933
"""
931934
if times is not None:
932935
warnings.warn('times keyword argument is deprecated and will be '

0 commit comments

Comments
 (0)