Skip to content

Commit

Permalink
Add minus sign in front of dEgdT, sdm.py (#2322)
Browse files Browse the repository at this point in the history
* Add - in front of dEgdT

Co-Authored-By: Cliff Hansen <[email protected]>
Co-Authored-By: Kevin Anderson <[email protected]>

* assert np.allclose -> assert_allclose

* test scalar values

* rtol unnecessary

* revert back assert_allclose changes

* document returned value `dEgdT`

* whatsnew

* Revert "document returned value `dEgdT`"

This reverts commit 40451a1.

---------

Co-authored-by: Cliff Hansen <[email protected]>
Co-authored-by: Kevin Anderson <[email protected]>
  • Loading branch information
3 people authored Dec 13, 2024
1 parent cb37129 commit b50b56f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/sphinx/source/whatsnew/v0.11.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Bug fixes
~~~~~~~~~
* :py:func:`~pvlib.spa.julian_day_dt` now accounts for the 10 day difference
between Julian and Gregorian calendars prior to the year 1582. (:issue:`2077`, :pull:`2249`)
* Corrected sign of temperature coefficient ``dEgdT`` in :py:func:`~pvlib.pvsystem.fit_desoto_sandia`.
Results may differ slightly from previous versions. (:issue:`2311`, :pull:`2322`)

Documentation
~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion pvlib/ivtools/sdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ def fun_rsh(x, rshexp, ee, e0, rsh):
params['R_sh_exp'] = R_sh_exp

elif model == 'desoto':
dEgdT = 0.0002677
dEgdT = -0.0002677
x_for_io = const['q'] / const['k'] * (
1. / tok - 1. / tck[u] + dEgdT * (tc[u] - const['T0']) / tck[u])

Expand Down
3 changes: 3 additions & 0 deletions pvlib/tests/ivtools/test_sdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def test_fit_desoto_sandia(cec_params_cansol_cs5p_220p):
expected = pd.Series(params)
assert np.allclose(modeled[params.keys()].values,
expected[params.keys()].values, rtol=5e-2)
assert_allclose(result['dEgdT'], -0.0002677)
assert_allclose(result['EgRef'], 1.3112547292120638)
assert_allclose(result['cells_in_series'], specs['cells_in_series'])


def _read_iv_curves_for_test(datafile, npts):
Expand Down

0 comments on commit b50b56f

Please sign in to comment.