Skip to content

Commit 7770007

Browse files
author
dacoex
committed
Merge remote-tracking branch 'refs/remotes/pvlib/master' into io
2 parents 38c0082 + 300d1ab commit 7770007

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+39993
-4913
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pvlib/version.py export-subst

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ build/
2525

2626
*.egg-info/
2727
.installed.cfg
28-
*.egg
28+
*.egg*
2929

3030
# spa_c_files builds
3131
pvlib/spa_c_files/build*
@@ -52,10 +52,12 @@ coverage.xml
5252
# Translations
5353
*.mo
5454

55-
# Mr Developer
55+
# IDE's (Mr Developer, pydev, pycharm...)
5656
.mr.developer.cfg
5757
.project
5858
.pydevproject
59+
.spyderproject
60+
.idea/
5961

6062
# Rope
6163
.ropeproject

.landscape.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
doc-warnings: yes
2+
test-warnings: yes
3+
strictness: medium
4+
max-line-length: 79
5+
autodetect: yes
6+
ignore-paths:
7+
- ci
8+
- docs
9+
pep257:
10+
disable:
11+
- D202

.travis.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ addons:
2323
- ccache
2424

2525
cache:
26-
directories:
27-
- $HOME/.ccache
26+
# - pip
27+
- ccache
2828

2929
# setup miniconda for numpy, scipy, pandas
3030
before_install:
@@ -41,20 +41,28 @@ before_install:
4141
- conda config --set always_yes yes --set changeps1 no
4242
- conda update -q conda
4343
- conda info -a
44-
44+
4545
install:
4646
- echo "install"
4747
- conda env create --file ci/requirements-$CONDA_ENV.yml
4848
- source activate test_env # all envs are named test_env in the yml files
49+
# needed to make sure that pandas is compiled against the right
50+
# version of numpy
51+
- if [[ "$CONDA_ENV" == "py27-min" ]]; then
52+
pip uninstall numpy --yes;
53+
pip uninstall pandas --yes;
54+
pip install --no-cache-dir numpy==1.9.0;
55+
pip install --no-cache-dir pandas==0.14.0;
56+
fi
4957
- conda list
5058
- echo $PATH
5159
- ls -l /home/travis/miniconda/envs/test_env/lib
5260
#- pip install . # use pip to automatically install anything not in the yml files (i.e. numpy/scipy/pandas for py3*)
5361
#- pip install scipy # won't do anything if already installed
54-
- python setup.py install
62+
- pip install -e .
5563

5664
script:
57-
- nosetests -v --with-coverage --cover-package=pvlib pvlib
65+
- py.test pvlib --cov=pvlib --cov-report term-missing
5866

5967
after_success:
6068
coveralls

LICENSE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Copyright (c) 2013, Sandia National Labs
22
All rights reserved.
33

4+
Copyright (c) 2014-2016, PVLIB Python Developers
5+
All rights reserved.
6+
47
Redistribution and use in source and binary forms, with or without modification,
58
are permitted provided that the following conditions are met:
69

MANIFEST.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include *.txt
2+
include versioneer.py
3+
include pvlib/_version.py
24
recursive-include pvlib/data *
35
include README.md
46
include pvlib/spa_c_files/*.h
57

6-
#recursive-include docs *.txt
8+
#recursive-include docs *.txt

README.md

Lines changed: 24 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -5,180 +5,51 @@ pvlib-python
55
[![Build status](https://ci.appveyor.com/api/projects/status/gr2eyhc84tvtkopk?svg=true)](https://ci.appveyor.com/project/wholmgren/pvlib-python-fv2to)
66
[![Coverage Status](https://img.shields.io/coveralls/pvlib/pvlib-python.svg)](https://coveralls.io/r/pvlib/pvlib-python)
77
[![Documentation Status](https://readthedocs.org/projects/pvlib-python/badge/?version=latest)](http://pvlib-python.readthedocs.org/en/latest/)
8-
[![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.20562.svg)](http://dx.doi.org/10.5281/zenodo.20562)
8+
[![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.50141.svg)](http://dx.doi.org/10.5281/zenodo.50141)
9+
[![Code Health](https://landscape.io/github/pvlib/pvlib-python/master/landscape.svg?style=flat)](https://landscape.io/github/pvlib/pvlib-python/master)
910

1011

11-
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.
1220

1321

1422
Documentation
1523
=============
1624

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/).
2426

2527

2628
Installation
2729
============
2830

29-
If you have Python
30-
------------------
31-
To obtain the most recent stable release, just use ``pip`` or ``conda``:
32-
33-
```
34-
pip install pvlib
35-
```
36-
37-
```
38-
conda install -c http://conda.anaconda.org/pvlib pvlib
39-
```
40-
41-
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/).
49-
50-
2. Install pvlib: ``conda install -c http://conda.anaconda.org/pvlib pvlib``
51-
52-
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.
6833

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
7435

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 . ``
7936

37+
Contributing
38+
============
8039

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')
110-
111-
# calculate the solar position
112-
solpos = pvlib.solarposition.get_solarposition(times, tus)
113-
solpos.plot()
114-
115-
# calculate clear sky data
116-
tus_cs = pvlib.clearsky.ineichen(times, tus, airmass_model='young1994')
117-
tus_cs.plot()
118-
```
119-
120-
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.
12143

12244

12345
License
12446
=======
125-
3 clause BSD.
12647

48+
BSD 3-clause
12749

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.
13250

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
14252
=======
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)
55+
to contact the developers and pvlib community.

appveyor.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
# CI on Windows via appveyor
2-
# This file was based on pandas' and xarray's appveyor.yml
3-
# This file was based on Olivier Grisel's python-appveyor-demo
2+
# This file is based on MetPy's appveyor.yml
43

54
environment:
6-
global:
7-
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
8-
# /E:ON and /V:ON options are not enabled in the batch script intepreter
9-
# See: http://stackoverflow.com/a/13751649/163740
10-
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
5+
6+
CONDA_PATH: "C:\\Miniconda"
117

128
matrix:
13-
- PYTHON: "C:\\Python27-conda32"
14-
PYTHON_VERSION: "2.7"
15-
PYTHON_ARCH: "32"
9+
- PYTHON_VERSION: "2.7"
10+
- PYTHON_VERSION: "3.4"
11+
#- PYTHON_VERSION: "3.5"
1612

17-
- PYTHON: "C:\\Python34-conda64"
18-
PYTHON_VERSION: "3.4"
19-
PYTHON_ARCH: "64"
13+
platform:
14+
- x86
15+
- x64
2016

2117
install:
22-
# Install miniconda Python
23-
- "powershell ./ci/install_python.ps1"
24-
25-
# Prepend newly installed Python to the PATH of this build (this cannot be
26-
# done from inside the powershell script as it would require to restart
27-
# the parent CMD process).
28-
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
29-
30-
# Check that we have the expected version and architecture for Python
31-
- "python --version"
32-
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
33-
34-
# install xray and depenencies
35-
- "conda install --yes --quiet pip numpy scipy pandas nose pytz ephem numba"
36-
- "python setup.py install"
18+
# Use the pre-installed Miniconda for the desired arch
19+
- ps: if($env:PYTHON_VERSION -eq '3.5')
20+
{ $env:CONDA_PATH="$($env:CONDA_PATH)35" }
21+
- ps: if($env:TARGET_ARCH -eq 'x64')
22+
{ $env:CONDA_PATH="$($env:CONDA_PATH)-x64" }
23+
- ps: $env:path="$($env:CONDA_PATH);$($env:CONDA_PATH)\Scripts;$($env:CONDA_PATH)\Library\bin;C:\cygwin\bin;$($env:PATH)"
24+
- cmd: conda config --set always_yes yes --set changeps1 no
25+
- cmd: conda update -q conda
26+
# Useful for debugging any issues with conda
27+
- cmd: conda info -a
28+
29+
# install depenencies
30+
- cmd: conda create -n test_env --yes --quiet python=%PYTHON_VERSION% pip numpy scipy pandas nose pytest pytz ephem numba siphon -c conda-forge
31+
- cmd: activate test_env
32+
- cmd: python --version
33+
- cmd: conda list
34+
35+
# install pvlib
36+
- cmd: pip install -e .
3737

3838
build: false
3939

4040
test_script:
41-
- "nosetests -v pvlib"
41+
- cmd: py.test -v pvlib

0 commit comments

Comments
 (0)