Skip to content

Commit 54e1eaf

Browse files
committed
resolve whatsnew merge conflict
2 parents 55bce4a + 4186b75 commit 54e1eaf

File tree

14 files changed

+403
-2017
lines changed

14 files changed

+403
-2017
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ build/
3030
# spa_c_files builds
3131
pvlib/spa_c_files/build*
3232

33+
# spa_c_files source
34+
pvlib/spa_c_files/spa.c
35+
pvlib/spa_c_files/spa.h
36+
pvlib/spa_c_files/spa_tester.c
37+
3338
# generated documentation
3439
# pvlib/sphinx/Docs/build/
3540

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,22 @@ Hopefully you're using [virtualenv](http://virtualenv.readthedocs.org/en/latest/
2424
pip install git+https://github.com/pvlib/pvlib-python.git
2525
```
2626

27-
Alternatively, ``git clone`` this repository and run
27+
Alternatively, ``git clone`` this repository, ``cd`` into it, and run
2828

2929
```
3030
pip install .
3131
```
3232

3333
Add ``-e`` to install in [develop mode](http://pip.readthedocs.org/en/latest/reference/pip_install.html#editable-installs).
3434

35+
To use the NREL SPA algorithm, a pip install from the web cannot be used. Instead:
36+
37+
1. Download the pvlib repository from https://github.com/pvlib/pvlib-python.git
38+
2. Download the SPA files from [NREL](http://www.nrel.gov/midc/spa/)
39+
3. Copy the SPA files into ``pvlib-python/pvlib/spa_c_files``
40+
4. From the ``pvlib-python`` directory, run ``pip uninstall pvlib`` followed by ``pip install . ``
41+
42+
3543
Usage Example
3644
-------------
3745
```

docs/sphinx/source/whatsnew/v0.1.0.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Other changes
4343
* Limited the scope of ``clearsky.py``'s ``scipy`` dependency.
4444
``clearsky.ineichen`` will work without ``scipy`` so long as
4545
the Linke Turbidity is supplied as a keyword argument. (:issue:`13`)
46+
* Removed NREL's SPA code to comply with their license (:issue:`9`).
4647

4748

4849
Documentation

pvlib/spa_c_files/README

Lines changed: 0 additions & 46 deletions
This file was deleted.

pvlib/spa_c_files/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
README
2+
------
3+
4+
NREL provides a C implementation of the solar position algorithm
5+
described in
6+
[Reda, I.; Andreas, A. (2003). Solar Position Algorithm for Solar Radiation Applications. 55 pp.; NREL Report No. TP-560-34302](
7+
http://www.nrel.gov/docs/fy08osti/34302.pdf).
8+
9+
This folder contains the files required to make NREL's C code accessible
10+
to the ``pvlib-python`` package. We use the Cython package to wrap NREL's SPA
11+
implementation.
12+
13+
** Due to licensing issues, you must download the NREL C files from their
14+
[website](http://www.nrel.gov/midc/spa) **
15+
16+
Download the ``spa.c`` and ``spa.h`` files from NREL,
17+
and copy them into the ``pvlib/spa_c_files`` directory.
18+
19+
There are a total of 5 files needed to compile the C code, described below:
20+
21+
* ``spa.c``: original C code from NREL
22+
* ``spa.h``: header file for spa.c
23+
* ``cspa_py.pxd``: a cython header file which essentially tells cython which parts of the main header file to pay attention to
24+
* ``spa_py.pyx``: the cython code used to define both functions in the python namespace. NOTE: It is possible to provide user access to other paramters of the SPA algorithm through modifying this file
25+
* ``setup.py``: a distutils file which performs the compiling of the cython code
26+
27+
The cython compilation process produces two files:
28+
* ``spa_py.c``: an intermediate cython c file
29+
* ``spa_py.so``: the python module which can be imported into a namespace
30+
31+
To process the original 5 files,
32+
use the following shell command inside this folder
33+
34+
$ python setup.py build_ext --inplace

pvlib/spa_c_files/a.out

-49.5 KB
Binary file not shown.

pvlib/spa_c_files/cspa_py.pxd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cdef extern from "spa.h":
55
int day
66
int hour
77
int minute
8-
int second
8+
double second
99
double delta_ut1
1010
double delta_t
1111
double timezone
@@ -27,7 +27,7 @@ cdef extern from "spa.h":
2727
int function
2828

2929
double zenith
30-
double azimuth180
30+
double azimuth_astro
3131
double azimuth
3232
double incidence
3333

0 commit comments

Comments
 (0)