You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pvlib-python is a community supported tool that provides a set of documented functions for simulating the performance of photovoltaic energy systems. The toolbox was originally developed in MATLAB at Sandia National Laboratories and it implements many of the models and methods developed at the Labs. More information on Sandia Labs PV performance modeling programs can be found at https://pvpmc.sandia.gov/. We collaborate with the PVLIB-MATLAB project, but operate independently of it.
12
+
PVLIB Python is a community supported tool that provides a set of
13
+
functions and classes for simulating the performance of photovoltaic
14
+
energy systems. PVLIB Python was originally ported from the PVLIB MATLAB
15
+
toolbox developed at Sandia National Laboratories and it implements many
16
+
of the models and methods developed at the Labs. More information on
17
+
Sandia Labs PV performance modeling programs can be found at
18
+
https://pvpmc.sandia.gov/. We collaborate with the PVLIB MATLAB project,
19
+
but operate independently of it.
12
20
13
21
14
22
Documentation
15
23
=============
16
24
17
-
Full documentation can be found at [readthedocs](http://pvlib-python.readthedocs.org/en/latest/).
18
-
19
-
20
-
Contributing
21
-
============
22
-
23
-
We need your help to make pvlib-python a great tool! Please see the [Contributing to pvlib-python wiki](https://github.com/pvlib/pvlib-python/wiki/Contributing-to-pvlib-python) for more on how you can contribute. The long-term success of pvlib-python requires substantial community support.
25
+
Full documentation can be found at [readthedocs](http://pvlib-python.readthedocs.io/en/latest/).
24
26
25
27
26
28
Installation
27
29
============
28
30
29
-
If you have Python
30
-
------------------
31
-
To obtain the most recent stable release, just use ``pip`` or ``conda``:
If your system complains that you don't have access privileges or asks for a password then you're trying to install pvlib into your system's Python distribution. This is a very bad idea and you should instead follow the **If you don't have Python** instructions below.
42
-
43
-
44
-
If you don't have Python
45
-
------------------------
46
-
There are many ways to install Python on your system, but the Anaconda Scientific Python distribution provides by far the easiest way for new users to get started. Anaconda includes all of the popular libraries that you'll need for pvlib, including Pandas, NumPy, and SciPy. "Anaconda installs cleanly into a single directory, does not require Administrator or root privileges, does not affect other Python installs on your system, or interfere with OSX Frameworks." -Anaconda Documentation.
47
-
48
-
1. Install the full Anaconda Scientific Python distribution available [here](https://store.continuum.io/cshop/anaconda/).
If you have trouble, see the [Anaconda FAQ](http://docs.continuum.io/anaconda/faq.html), Google your error messages, or make a new issue on our [Issues page](https://github.com/pvlib/pvlib-python/issues).
53
-
54
-
55
-
Working at the bleeding edge
56
-
----------------------------
57
-
We strongly recommend working in a **virtual environment** if you're going to use the development versions of the code. There are many ways to use virtual environments in Python, but Anaconda again provides the easiest solution:
58
-
59
-
1. Create a new conda environment for pvlib and pre-install a handful of packages into the environment: ``conda create --name pvlibdev python pandas scipy ephem``
60
-
2. Activate the new environment: ``source activate pvlibdev``
61
-
2. Install the latest development version:
62
-
2. If you don't plan to modify the source-code: ``pip install git+https://github.com/pvlib/pvlib-python.git``
63
-
2. If you do plan to modify the source code: Use the GitHub GUI application or git command-line tool to clone this repository to your computer, then navigate your command-line to the top-level pvlib-python directory, then ``pip install -e .``
64
-
2. You may also consider installing additional packages into your development environment: ``conda install ipython-notebook nose seaborn``
65
-
66
-
The [conda documentation](http://conda.pydata.org/docs/using/index.html) has more information on how to use virtual environments.
67
-
31
+
pvlib-python releases may be installed using the ``pip`` and ``conda`` tools.
32
+
Please see the [Installation page](http://pvlib-python.readthedocs.io/en/latest/installation.html) of the documentation for complete instructions.
68
33
69
-
NREL SPA algorithm
70
-
------------------
71
-
pvlib-python is distributed with several validated, high-precision, and high-performance solar position calculators.
72
-
It also includes wrappers for the official NREL SPA algorithm.
73
-
To use the NREL SPA algorithm, a pip install from the web cannot be used. Instead:
34
+
pvlib-python is compatible with Python versions 2.7, 3.4, 3.5
74
35
75
-
1. Download the pvlib repository from https://github.com/pvlib/pvlib-python.git
76
-
2. Download the SPA files from [NREL](http://www.nrel.gov/midc/spa/)
77
-
3. Copy the SPA files into ``pvlib-python/pvlib/spa_c_files``
78
-
4. From the ``pvlib-python`` directory, run ``pip uninstall pvlib`` followed by ``pip install . ``
79
36
37
+
Contributing
38
+
============
80
39
81
-
Usage
82
-
=====
83
-
You're now ready to start some version of the Python interpreter and use pvlib. The easiest way to start is with one of our IPython notebook tutorials:
84
-
85
-
1. Use the nbviewer website to choose a tutorial to experiment with. Go to our [nbviewer tutorial page](http://nbviewer.ipython.org/github/pvlib/pvlib-python/tree/master/docs/tutorials/), click on e.g. pvsystem.ipynb, and then click on the download symbol.
86
-
1. Start the IPython Notebook server: ``ipython notebook``. This should open a web browser with the IPython Notebook's file/folder listing. If not, navigate to the url shown in the command line history, likely ``http://localhost:8888``
87
-
2. In IPython Notebook, navigate to the file that you downloaded in step one and open it.
88
-
2. Use ``shift-enter`` to execute the notebook cell-by-cell. There is also a Play button that will execute all of the cells in the notebook.
89
-
90
-
You can also experiment with the following simple code in a new IPython notebook or any other Python interpreter:
91
-
92
-
```
93
-
# built-in imports
94
-
import sys
95
-
import datetime
96
-
97
-
# add-on imports
98
-
import pandas as pd
99
-
100
-
# pvlib imports
101
-
from pvlib.location import Location
102
-
import pvlib.solarposition
103
-
import pvlib.clearsky
104
-
105
-
# make a location
106
-
tus = Location(32.2, -111, 'MST', 700)
107
-
108
-
# make a pandas DatetimeIndex for some day
109
-
times = pd.date_range(start=datetime.datetime(2014,6,24), end=datetime.datetime(2014,6,25), freq='1Min')
Many good online resources exist for getting started with scientific Python.
40
+
We need your help to make pvlib-python a great tool!
41
+
Please see the [Contributing page](http://pvlib-python.readthedocs.io/en/latest/contributing.html) for more on how you can contribute.
42
+
The long-term success of pvlib-python requires substantial community support.
121
43
122
44
123
45
License
124
46
=======
125
-
3 clause BSD.
126
47
48
+
BSD 3-clause
127
49
128
-
Compatibility
129
-
=============
130
-
131
-
pvlib-python is compatible with Python versions 2.7, 3.3, 3.4, 3.5 and Pandas versions 0.13.1 through 0.17. Note that our Numba-accelerated solar position algorithms have more specific version requirements that will be resolved by the Numba installer.
132
50
133
-
For Linux + Python 3 users: Continuum's Python 3.x SciPy conda package is not compiled properly and has a few bugs related to complex arithmetic. The most common place for these bugs to show up when using pvlib-python is in calculating IV curve parameters using the ``singlediode`` function. We reported [the issue](https://github.com/ContinuumIO/anaconda-issues/issues/425) to Continuum and are waiting for it to be fixed. In the meantime, you can compile your own SciPy distribution, or you can use this trick on Python 3.3 and 3.4 (not 3.5): Downgrade your NumPy to 1.8 and SciPy to 0.14, then install whatever version of pandas you want but without dependencies. The conda commands for this are:
134
-
135
-
```
136
-
conda install numpy=1.8 scipy=0.14
137
-
conda install pandas --no-deps
138
-
```
139
-
140
-
141
-
Testing
51
+
Contact
142
52
=======
143
-
Testing can easily be accomplished by running ``nosetests`` on the pvlib directory:
144
-
```
145
-
nosetests -v pvlib
146
-
```
147
-
Unit test code should be placed in the corresponding test module in the pvlib/test directory. Use ``pip`` or ``conda`` to install ``nose``. Developers must include comprehensive tests for any additions or modifications to pvlib.
148
-
149
-
150
-
Code Transition
151
-
================
152
-
Here are some of the major differences between the latest build and the original Sandia PVLIB\_Python project.
153
-
154
-
Library wide changes:
155
-
* Remove ``pvl_`` from module names.
156
-
* Consolidation of similar modules. For example, functions from ``pvl_clearsky_ineichen.py`` and ``pvl_clearsky_haurwitz.py`` have been consolidated into ``clearsky.py``.
157
-
* Removed ``Vars=Locals(); Expect...; var=pvl\_tools.Parse(Vars,Expect);`` pattern. Very few tests of input validitity remain. Garbage in, garbage or ``nan`` out.
158
-
* Removing unnecssary and sometimes undesired behavior such as setting maximum zenith=90 or airmass=0. Instead, we make extensive use of ``nan`` values.
159
-
* Adding logging calls, removing print calls.
160
-
* Code in reviewed modules is mostly PEP8 compliant.
161
-
* All code is Python 3 compatible (see testing).
162
-
* Changing function and module names so that they do not conflict.
163
-
* Added ``/pvlib/data`` for lookup tables, test, and tutorial data.
164
-
* Return one DataFrame instead of a tuple of DataFrames.
165
-
166
-
More specific changes:
167
-
* Add PyEphem option to solar position calculations.
168
-
*``irradiance.py`` has more AOI, projection, and irradiance sum and calculation functions
169
-
* TMY data is not forced to 1987.
170
-
* Locations are now ``pvlib.location.Location`` objects, not structs.
171
-
* Specify time zones using a string from the standard IANA Time Zone Database naming conventions or using a pytz.timezone instead of an integer GMT offset. We may add dateutils support in the future.
172
-
*``clearsky.ineichen`` supports interpolating monthly Linke Turbidities to daily resolution.
173
-
174
-
Documentation:
175
-
* Using readthedocs for documentation hosting.
176
-
* Many typos and formatting errors corrected.
177
-
* Documentation source code and tutorials live in ``/`` rather than ``/pvlib/docs``.
178
-
* Additional tutorials in ``/docs/tutorials``.
179
-
180
-
Testing:
181
-
* Tests are cleaner and more thorough. They are still no where near complete.
182
-
* Using Coveralls to measure test coverage.
183
-
* Using TravisCI for automated testing.
184
-
* Using ``nosetests`` for more concise test code.
53
+
54
+
Please use our [issues page](https://github.com/pvlib/pvlib-python/issues)
0 commit comments