Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gold I-V dataset with benchmarking #426

Closed
wants to merge 57 commits into from
Closed
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9ab2e95
Add draft i_from_v_alt function with tests
Jun 15, 2017
a66abc4
Merge branch 'master' of github.com:pvlib/pvlib-python
Jun 15, 2017
a19447b
Better comments and more explicit typing
Jun 15, 2017
76616d5
Use transform from shunt resistance to shunt conductance
Jun 15, 2017
e35412f
Add v_from_i_alt() with initial tests and use np.where
Jun 16, 2017
82217fd
Use test fixtures
Jun 21, 2017
135ce4c
Add @requires_scipy to test fixtures
Jun 23, 2017
f927aef
More current_sum_at_diode_node() tests and using fixture
Jun 23, 2017
741a7f4
Naming, documentation, and formatting
Jun 23, 2017
c9129dc
Deprecate replaced functions and flake8
Jul 27, 2017
3aa150d
Merge branch 'master' of github.com:pvlib/pvlib-python
Jul 27, 2017
85e957d
Add release documentation and flake8 again
Jul 27, 2017
fb22171
Replace deprecated function usages and update test_singlediode_series…
Jul 27, 2017
275eccc
Merge branch 'master' of github.com:pvlib/pvlib-python
Sep 10, 2017
cdd2bd9
Conform to existing API
Sep 11, 2017
223275a
Run flake8
Sep 11, 2017
6b50ad9
Implement some code quality suggestions
Sep 11, 2017
e4e09be
Remove extraneous print statements
Sep 11, 2017
37484f1
Better docstrings
Sep 11, 2017
f9c4c82
Fix parameter ranges in docstrings
Sep 11, 2017
26eabde
Add test that overflows lambertw arg
Sep 11, 2017
4d7754d
Add test for mixed solution types logic
Sep 11, 2017
03ae51e
Use broadcast_arrays for cleaner code
Sep 12, 2017
6c410d2
One more simplification
Sep 12, 2017
19af023
Better use of broadcast_arrays
Sep 12, 2017
0cbf4bd
Merge branch 'master' of github.com:pvlib/pvlib-python
Jan 30, 2018
329450a
Merge branch 'master' of github.com:pvlib/pvlib-python into gold_dataset
Feb 13, 2018
c96795d
Initial code with example output
Feb 13, 2018
8d1ecd9
Initial polishing and comments
Feb 14, 2018
59cf37f
Add all features for first gold dataset
markcampanelli Mar 4, 2018
d592b0c
Merge branch 'master' of github.com:pvlib/pvlib-python into gold_dataset
markcampanelli Mar 4, 2018
0dbf951
Add remaining devices for SDM gold data
markcampanelli Apr 4, 2018
5c19b66
Merge branch 'master' of github.com:pvlib/pvlib-python into gold_dataset
markcampanelli Apr 4, 2018
43e2457
Reorg files and address comments
markcampanelli Apr 6, 2018
f1c04be
Merge branch 'master' of github.com:pvlib/pvlib-python into gold_dataset
markcampanelli Apr 6, 2018
7eccfc8
WIP during OS install
markcampanelli May 10, 2018
0c33a71
Merge branch 'master' of github.com:pvlib/pvlib-python into gold_dataset
markcampanelli Jun 2, 2018
9d03ac9
Finish unit tests and file structure
markcampanelli Jun 7, 2018
229c86f
Fix comment and tidy .gitignore
markcampanelli Jun 7, 2018
054a537
Add test skip decorator for pyinterval
markcampanelli Jun 7, 2018
05de14c
Add scipy test skips for minimal python 2.7 build
markcampanelli Jun 7, 2018
1bdeb45
Remove scipy dependencies
markcampanelli Jun 7, 2018
599f48b
Add scipy test skip filter
markcampanelli Jun 8, 2018
3b825e2
Merge branch 'master' of github.com:pvlib/pvlib-python into gold_dataset
markcampanelli Jun 8, 2018
cb01100
Update for new pvsystem.calcparams_desoto API
markcampanelli Jun 8, 2018
0c527e1
Add README documentation and whatsnew
markcampanelli Jun 10, 2018
0ad15d1
Remove constants.py and move constants into sdm.py
markcampanelli Jun 16, 2018
7166194
Simplify large cell device bootstrapping
markcampanelli Jun 17, 2018
39d1d5b
Improve documentation
markcampanelli Jun 20, 2018
5eca66f
Merge upstream master
markcampanelli May 15, 2019
aee313e
Make requirements consistent for py34
markcampanelli May 15, 2019
e6e6dc7
Add GH issue
markcampanelli May 15, 2019
6ad79ec
Merge branch 'master' of github.com:pvlib/pvlib-python into gold_dataset
markcampanelli May 16, 2019
f9dc4e7
Merge upstream
markcampanelli May 16, 2019
13b6042
Update outputs and fix typos and sticklers
markcampanelli May 17, 2019
0041d4e
Remove pvfactors for Python 3.4
markcampanelli May 17, 2019
d85aac6
Merge branch 'master' of github.com:markcampanelli/pvlib-python into …
markcampanelli May 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
.tox/
.coverage
.cache
nosetests.xml
.coverage
.pytest_cache/
.tox/
coverage.xml
nosetests.xml

# Translations
*.mo
Expand All @@ -61,6 +62,7 @@ coverage.xml
.idea/
*.sublime-project
*.sublime-workspace
.vscode

# Rope
.ropeproject
Expand All @@ -72,9 +74,9 @@ coverage.xml
# HDF tables
*.h5


#Datafiles
# Datafiles
*.csv
*.json

# vi
*.swp
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py27.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ dependencies:
- pip:
- coveralls
- pytest-timeout
- pyinterval
1 change: 1 addition & 0 deletions ci/requirements-py34.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ dependencies:
- pip:
- coveralls
- pytest-timeout
- pyinterval
2 changes: 2 additions & 0 deletions ci/requirements-py35.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ dependencies:
- pip:
- coveralls
- pytest-timeout
- pyinterval

1 change: 1 addition & 0 deletions ci/requirements-py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ dependencies:
- nose
- pip:
- coveralls
- pyinterval
5 changes: 3 additions & 2 deletions docs/sphinx/source/whatsnew/v0.6.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Enhancements
* Add sea surface albedo in irradiance.py (:issue:`458`)
* Implement first_solar_spectral_loss in modelchain.py (:issue:`359`)
* Clarify arguments Egref and dEgdT for calcparams_desoto (:issue:`462`)

* Add gold I-V data set for the single-diode model, along with ``i_from_v()``
and ``v_from_i()`` accuracy and performance benchmarking

Bug fixes
~~~~~~~~~
Expand All @@ -35,4 +36,4 @@ Contributors
* Will Holmgren
* Yu Cao
* Cliff Hansen

* Mark Campanelli
Empty file added pvlib/data/__init__.py
Empty file.
56 changes: 56 additions & 0 deletions pvlib/data/gold/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Gold Datasets
============

This directory contains gold datasets and python modules for gauging various
algorithms, enabling verification and benchmarking.

## Single-Diode Model (SDM)

### Gold Dataset Creation

The I-V curve gold dataset for the SDM is generated by runnning the following
python script in this directory

```console
$ python sdm.py
```

which will overwrite the existing `sdm.json` and `sdm.csv` files. `sdm.json` is
the lossless, machine-interoperable format, and `sdm.csv` is formatted to be
human-readable and to be easily viewed in a spreadsheet program.

NOTES:
- You will need to `pip install pyinterval` in order to generate gold
datasets, because interval arithmetic is used to ensure computational accuracy.
- I-V curves are generated over a range of device types and operating
conditions.
- See the `sdm.py` and `test_sdm.py` source code for details/examples.

### Gauging SDM Functions Against a Gold Dataset

Using an existing `sdm.json` gold dataset, you can guage various `i_from_v()`
and `v_from_i()` implementations for accuracy/performance using a python script
such as

```python
import os
import pprint

from pvlib import pvsystem
from pvlib.data.gold import sdm

json_path = os.path.join(os.path.dirname(sdm.__file__), "sdm.json")
gold_dataset = sdm.load_gold_dataset(json_path=json_path)
pprint.pprint(sdm.gauge_functions(gold_dataset, {
"i_from_v": pvsystem.i_from_v,
"v_from_i": pvsystem.v_from_i,
}))
```

NOTES:
- Any functions compatible with the `pvsystem.i_from_v` and `pvsystem.v_from_i`
APIs can be guaged against the gold dataset.
- For each function guaged, the worst computed I-V curve for each device is returned along with performance timing information and statistics for
the ensemble of I-V curve computations for that device (without any
repetitions).
- See the `sdm.py` and `test_sdm.py` source code for details/examples.
Empty file added pvlib/data/gold/__init__.py
Empty file.
5,048 changes: 5,048 additions & 0 deletions pvlib/data/gold/sdm.csv

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pvlib/data/gold/sdm.json

Large diffs are not rendered by default.

Loading