Skip to content

Commit 739ab19

Browse files
authored
Create ivtools (#718)
* initial commit fit_cec_using_sam * outline ivcurves * use nrel-pysam * remove sam_dir * add Sandia single curve fit * complete function * add test, move code to ivtools.py * remove single files * change PySCC usage to wrapper * add nrel-pysam to ci/requirements * stickler, add pysam version in ci/requirements * does case matter? * remove pysam for py27, move import pysam to try/except * add requires_scipy * rename variables for style guide * add test for fit_cec_with_sam * fix conflict in requirements * fix typo, raise syntax * remove ivtools dir * fix pytest fixture usage * linter, fix np.allclose * relax test condition * remove try/except, add to docstring, use helper functions * add requires_pysam * fix import * fix infinite loop * update whatsnew, api.rst * fix lint errors * lint * resolve comments * comment response * fix function name in test * more comment responses * add nan output to fit_cec_sam, comment responses * lint * consistent return nan, v_oc arg etc. defaults to None, edit description * initialize failed * lint * implement exception for failed fitting * remove requirement for sorted i * update internal variable name for consistency * add to __init__.py * code style changes * lint * adjust error messaging in _calculate_sde_parameters * edits to units in docstring * change error handling in fit_sde_sandia, docstring reformat * fix tests, docstring edits * test math formatting * more edits to docstring * multiline raw string * try another approach * move r * change function name, docstring edits * update function name * add math delimiters * remove delimiter, use indent * fix alignment in docstring * some edits to docstring format * change name back to sde * add bad IV curves for coverage test * separate bad IV test, fix test * lint * update api.rst and whatsnew * hardwire test output rather than read from old CEC file * test fix * really fix it this time * fix raise statement
1 parent 3c84edd commit 739ab19

File tree

10 files changed

+636
-2
lines changed

10 files changed

+636
-2
lines changed

ci/requirements-py35.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ dependencies:
2424
- shapely # pvfactors dependency
2525
- siphon # conda-forge
2626
- pip:
27+
- nrel-pysam
2728
- pvfactors==1.0.1

ci/requirements-py36.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ dependencies:
2424
- shapely # pvfactors dependency
2525
- siphon # conda-forge
2626
- pip:
27+
- nrel-pysam
2728
- pvfactors==1.0.1

ci/requirements-py37.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ dependencies:
2424
- shapely # pvfactors dependency
2525
- siphon # conda-forge
2626
- pip:
27+
- nrel-pysam
2728
- pvfactors==1.0.1

docs/sphinx/source/api.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,14 @@ PVWatts model
294294
pvsystem.pvwatts_losses
295295
pvsystem.pvwatts_losses
296296

297+
Functions for fitting PV models
298+
-------------------------------
299+
.. autosummary::
300+
:toctree: generated/
301+
302+
ivtools.fit_sde_sandia
303+
ivtools.fit_sdm_cec_sam
304+
297305
Other
298306
-----
299307

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,26 @@ Documentation
104104
~~~~~~~~~~~~~
105105
* Corrected docstring for `pvsystem.PVSystem.sapm`
106106

107+
API Changes
108+
~~~~~~~~~~~
109+
110+
111+
Enhancements
112+
~~~~~~~~~~~~
113+
* Add `ivtools` module to contain functions for IV model fitting.
114+
* Add :py:func:`~pvlib.ivtools.fit_sde_sandia`, a simple method to fit
115+
the single diode equation to an IV curve.
116+
* Add :py:func:`~pvlib.ivtools.fit_sdm_cec_sam`, a wrapper for the CEC single
117+
diode model fitting function '6parsolve' from NREL's System Advisor Model.
118+
119+
120+
Bug fixes
121+
~~~~~~~~~
122+
123+
124+
Testing
125+
~~~~~~~
126+
107127
Removal of prior version deprecations
108128
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
109129
* Removed `irradiance.extraradiation`.
@@ -119,6 +139,7 @@ Contributors
119139
~~~~~~~~~~~~
120140
* Mark Campanellli (:ghuser:`markcampanelli`)
121141
* Will Holmgren (:ghuser:`wholmgren`)
142+
* Cliff Hansen (:ghuser:`cwhanse`)
122143
* Oscar Dowson (:ghuser:`odow`)
123144
* Anton Driesse (:ghuser:`adriesse`)
124145
* Alexander Morgan (:ghuser:`alexandermorgan`)

pvlib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from pvlib import location
88
from pvlib import solarposition
99
from pvlib import iotools
10+
from pvlib import ivtools
1011
from pvlib import tracking
1112
from pvlib import pvsystem
1213
from pvlib import spa

0 commit comments

Comments
 (0)