Skip to content

Commit c0e58dc

Browse files
committed
Merge pull request #135 from wholmgren/contributing
documentation updates
2 parents 5e124e5 + fdf6261 commit c0e58dc

File tree

8 files changed

+700
-104
lines changed

8 files changed

+700
-104
lines changed
Lines changed: 62 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,80 @@
11
.. _comparison_pvlib_matlab:
22

33
****************************
4-
Comparison with PVLIB_MATLAB
4+
Comparison with PVLIB MATLAB
55
****************************
66

7-
This document is under construction.
8-
Please see our
9-
`PVSC 2014 paper <http://energy.sandia.gov/wp/wp-content/gallery/uploads/PV_LIB_Python_final_SAND2014-18444C.pdf>`_
10-
and
11-
`PVSC 2015 abstract <https://github.com/UARENForecasting/pvlib-pvsc2015/blob/master/pvlib_pvsc_42.pdf?raw=true>`_
12-
for more information.
7+
PVLIB was originally developed as a library for MATLAB at Sandia
8+
National Lab, and Sandia remains the official maintainer of the MATLAB
9+
library. Sandia supported the initial Python port and
10+
then released further project maintenance and development to the
11+
`pvlib-python maintainers <https://github.com/orgs/pvlib/people>`_.
1312

14-
The pvlib-python license is BSD 3-clause,
15-
the PVLIB\_MATLAB license is ??.
13+
The pvlib-python maintainers collaborate with the PVLIB MATLAB
14+
maintainers but operate independently. We'd all like to keep the core
15+
functionality of the Python and MATLAB projects synchronized, but this
16+
will require the efforts of the larger pvlib-python community, not just
17+
the maintainers. Therefore, do not expect feature parity between the
18+
libaries, only similarity.
1619

17-
We want to keep developing the core functionality and algorithms
18-
of the Python and MATLAB projects roughly in parallel,
19-
but we're not making any promises at this point.
20-
The PVLIB\_MATLAB and pvlib-python projects are currently developed
21-
by different teams that do not regularly work together.
22-
We hope to grow this collaboration in the future.
23-
Do not expect feature parity between the libaries, only similarity.
20+
Major differences
21+
~~~~~~~~~~~~~~~~~
2422

25-
Here are some of the major differences between the latest pvlib-python build
26-
and the original Sandia PVLIB\_Python project, but many of these
27-
comments apply to the difference between pvlib-python and PVLIB\_MATLAB.
23+
* pvlib-python uses git version control to track all changes
24+
to the code. A summary of changes is included in the whatsnew file
25+
for each release. PVLIB MATLAB documents changes in Changelog.docx
26+
* pvlib-python has a comprehensive test suite, whereas PVLIB MATLAB does
27+
not have a test suite at all. Specifically, pvlib-python
2828

29+
* Uses TravisCI for automated testing on Linux.
30+
* Uses Appveyor for automated testing on Windows.
31+
* Uses Coveralls to measure test coverage.
2932

30-
Library wide changes
31-
~~~~~~~~~~~~~~~~~~~~
33+
* Using readthedocs for automated documentation building and hosting.
34+
* Removed ``pvl_`` from module/function names.
35+
* Consolidated similar functions into topical modules.
36+
For example, functions from ``pvl_clearsky_ineichen.m`` and
37+
``pvl_clearsky_haurwitz.m`` have been consolidated into ``clearsky.py``.
38+
* PVLIB MATLAB uses ``location`` structs as the input to some functions.
39+
pvlib-python just uses the lat, lon, etc. as inputs to the functions.
40+
Furthermore, pvlib-python replaces the structs with classes, and these classes
41+
have methods, such as :py:func:`~pvlib.location.Location.get_solarposition`,
42+
that automatically reference the appropriate data.
43+
See :ref:`modeling-paradigms` for more information.
44+
* pvlib-python implements a handful of class designed to simplify the
45+
PV modeling process. These include :py:class:`~pvlib.location.Location`,
46+
:py:class:`~pvlib.pvsystem.PVSystem`,
47+
:py:class:`~pvlib.pvsystem.LocalizedPVSystem`,
48+
:py:class:`~pvlib.tracking.SingleAxisTracker`,
49+
and
50+
:py:class:`~pvlib.modelchain.ModelChain`.
3251

33-
* Remove ``pvl_`` from module names.
34-
* Consolidation of similar modules. For example, functions from ``pvl_clearsky_ineichen.py`` and ``pvl_clearsky_haurwitz.py`` have been consolidated into ``clearsky.py``.
35-
* Removed ``Vars=Locals(); Expect...; var=pvl\_tools.Parse(Vars,Expect);`` pattern. Very few tests of input validitity remain. Garbage in, garbage or ``nan`` out.
36-
* Removing unnecssary and sometimes undesired behavior such as setting maximum zenith=90 or airmass=0. Instead, we make extensive use of ``nan`` values.
37-
* Changing function and module names so that they do not conflict.
38-
* Added ``/pvlib/data`` for lookup tables, test, and tutorial data.
52+
Other differences
53+
~~~~~~~~~~~~~~~~~
3954

40-
41-
More specific changes
42-
~~~~~~~~~~~~~~~~~~~~~
43-
44-
* Add PyEphem option to solar position calculations.
45-
* ``irradiance.py`` has more AOI, projection, and irradiance sum and calculation functions
46-
* Locations are now ``pvlib.location.Location`` objects, not structs.
47-
* 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.
48-
* ``clearsky.ineichen`` supports interpolating monthly Linke Turbidities to daily resolution.
55+
* Very few tests of input validitity exist in the Python code.
56+
We believe that the vast majority of these tests were not necessary.
57+
We also make use of Python's robust support for raising and catching
58+
exceptions.
59+
* Removed unnecessary and sometimes undesired behavior such as setting
60+
maximum zenith=90 or airmass=0. Instead, we make extensive use of
61+
``nan`` values in returned arrays.
62+
* Implemented the NREL solar position calculation algorithm.
63+
Also added a PyEphem option to solar position calculations.
64+
* Specify time zones using a string from the standard IANA Time Zone
65+
Database naming conventions or using a pytz.timezone instead of an
66+
integer GMT offset.
67+
* ``clearsky.ineichen`` supports interpolating monthly
68+
Linke Turbidities to daily resolution.
4969
* Instead of requiring effective irradiance as an input, ``pvsystem.sapm``
5070
calculates and returns it based on input POA irradiance, AM, and AOI.
71+
* pvlib-python does not come with as much example data.
72+
* pvlib-python does not currently implement as many algorithms as
73+
PVLIB MATLAB.
5174

5275
Documentation
5376
~~~~~~~~~~~~~
5477

55-
* Using readthedocs for documentation hosting.
56-
* Many typos and formatting errors corrected.
57-
* Documentation source code and tutorials live in ``/`` rather than ``/pvlib/docs``.
58-
* Additional tutorials in ``/docs/tutorials``.
59-
60-
Testing
61-
~~~~~~~
62-
63-
* Tests are cleaner and more thorough. They are still no where near complete.
64-
* Using Coveralls to measure test coverage.
65-
* Using TravisCI for automated testing.
66-
* Using ``nosetests`` for more concise test code.
78+
* Using Sphinx to build the documentation,
79+
including dynamically created inline examples.
80+
* Additional Jupyter tutorials in ``/docs/tutorials``.

docs/sphinx/source/conf.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def __getattr__(cls, name):
5050
'sphinx.ext.autodoc',
5151
'sphinx.ext.mathjax',
5252
'sphinx.ext.viewcode',
53+
'sphinx.ext.intersphinx',
5354
'sphinx.ext.extlinks',
5455
'numpydoc',
5556
'sphinx.ext.autosummary',
@@ -77,7 +78,7 @@ def __getattr__(cls, name):
7778
# |version| and |release|, also used in various other places throughout the
7879
# built documents.
7980
# Get the version from the version file
80-
version_file = os.path.join(os.path.dirname(__file__),
81+
version_file = os.path.join(os.path.dirname(__file__),
8182
'../../../pvlib/version.py')
8283
with open(version_file, 'r') as f:
8384
exec(f.read())
@@ -301,3 +302,11 @@ def __getattr__(cls, name):
301302

302303
# If true, do not generate a @detailmenu in the "Top" node's menu.
303304
#texinfo_no_detailmenu = False
305+
306+
# Example configuration for intersphinx: refer to the Python standard library.
307+
intersphinx_mapping = {
308+
'python': ('https://docs.python.org/3.5/', None),
309+
'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None),
310+
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
311+
}
312+

docs/sphinx/source/contributing.rst

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
.. _contributing:
2+
3+
Contributing
4+
============
5+
6+
Encouraging more people to help develop pvlib-python is essential to our
7+
success. Therefore, we want to make it easy and rewarding for you to
8+
contribute.
9+
10+
11+
Easy ways to contribute
12+
-----------------------
13+
14+
Here are a few ideas for you can contribute, even if you are new to
15+
pvlib-python, git, or Python:
16+
17+
* Make `GitHub issues <https://github.com/pvlib/pvlib-python/issues>`_
18+
and contribute to the conversation about how to resolve them.
19+
* Read issues and pull requests that other people created and
20+
contribute to the conversation about how to resolve them.
21+
* Improve the documentation and the unit tests.
22+
* Improve the IPython/Jupyter Notebook tutorials or write new ones that
23+
demonstrate how to use pvlib-python in your area of expertise.
24+
* If you have MATLAB experience, you can help us keep pvlib-python
25+
up to date with PVLIB_MATLAB or help us develop common unit tests.
26+
For more, see `Issue #2 <https://github.com/pvlib/pvlib-python/issues/2>`_
27+
and `Issue #3 <https://github.com/pvlib/pvlib-python/issues/3>`_.
28+
* Tell your friends and colleagues about pvlib-python.
29+
* Add your project to our
30+
`Projects and publications that use pvlib-python wiki
31+
<https://github.com/pvlib/pvlib-python/wiki/Projects-and-publications-
32+
that-use-pvlib-python>`_.
33+
34+
35+
How to contribute new code
36+
--------------------------
37+
38+
Contributors to pvlib-python use GitHub's pull requests to add/modify
39+
its source code. The GitHub pull request process can be intimidating for
40+
new users, but you'll find that it becomes straightforward once you use
41+
it a few times. Please let us know if you get stuck at any point in the
42+
process. Here's an outline of the process:
43+
44+
#. Create a GitHub issue and get initial feedback from users and
45+
maintainers. If the issue is a bug report, please include the
46+
code needed to reproduce the problem.
47+
#. Obtain the latest version of pvlib-python: Fork the pvlib-python
48+
project to your GitHub account, ``git clone`` your fork to your computer.
49+
#. Make some or all of your changes/additions and ``git commit`` them to
50+
your local repository.
51+
#. Share your changes with us via a pull request: ``git push`` your
52+
local changes to your GitHub fork, then go to GitHub make a pull
53+
request.
54+
55+
The Pandas project maintains an excellent `contributing page
56+
<https://github.com/pydata/pandas/wiki/Contributing>`_ that goes into
57+
detail on each of these steps. Also see GitHub's `Set Up Git
58+
<https://help.github.com/articles/set-up-git/>`_ and `Using Pull
59+
Requests <https://help.github.com/articles/using-pull-requests/>`_.
60+
61+
Note that you do not need to make all of your changes before creating a
62+
pull request. Your pull requests will automatically be updated when you
63+
commit new changes and push them to GitHub. This gives everybody an easy
64+
way to comment on the code and can make the process more efficient.
65+
66+
We strongly recommend using virtual environments for development.
67+
Virtual environments make it trivial to switch between different
68+
versions of software. This `astropy guide
69+
<http://astropy.readthedocs.org/en/latest/development/workflow/
70+
virtual_pythons.html>`_ is a good reference for virtual environments. If
71+
this is your first pull request, don't worry about using a virtual
72+
environment.
73+
74+
You must include documentation and unit tests for any new or improved
75+
code. We can provide help and advice on this after you start the pull
76+
request.
77+
78+
The maintainers will follow same procedures, rather than making direct
79+
commits to the main repo. Exceptions may be made for extremely minor
80+
changes, such as fixing documentation typos.
81+
82+
83+
This documentation
84+
------------------
85+
If this documentation is unclear, help us improve it! Consider looking
86+
at `IPython <https://github.com/ipython/ipython/wiki/Dev:-Index>`_,
87+
`pandas <https://github.com/pydata/pandas/wiki>`_, and
88+
`Sandia-Labs/PVLIB_Python#33 <https://github.com/Sandia-Labs/
89+
PVLIB_Python/issues/33>`_ for inspiration.

docs/sphinx/source/index.rst

Lines changed: 64 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,78 @@
1-
Welcome to pvlib-python's documentation!
1+
pvlib-python
22
========================================
33

4-
pvlib-python provides a set of documented functions for simulating
5-
the performance of photovoltaic energy systems.
6-
The toolbox was originally developed in MATLAB at
7-
Sandia National Laboratories and it implements many of the
8-
models and methods developed at the Labs.
9-
More information on Sandia Labs PV performance modeling programs
10-
can be found at https://pvpmc.sandia.gov/.
11-
12-
The source code for pvlib-python is hosted on
13-
`github <https://github.com/pvlib/pvlib-python>`_.
14-
15-
The github page also contains a valuable
16-
`wiki <https://github.com/pvlib/pvlib-python/wiki>`_
17-
with information on how you can contribute to pvlib-python development!
18-
19-
Please see the links above for details on the status of the pvlib-python
20-
project. We are at an early stage in the development of this project,
21-
so expect to see significant API changes in the next few releases.
22-
23-
This documentation focuses on providing a reference for all of
24-
the modules and functions available in pvlib-python.
25-
For examples of how to use pvlib-python, please see the
26-
`tutorials <http://nbviewer.ipython.org/github/pvlib/pvlib-python/tree/master/docs/tutorials/>`_.
27-
Some of the tutorials were written with older
28-
versions of pvlib-python and we would greatly appreciate your
29-
help updating them!
30-
31-
.. note::
32-
33-
This documentation assumes general familiarity with
34-
Python, NumPy, and Pandas. Google searches will yield many
35-
excellent tutorials for these packages.
36-
37-
Please see our
38-
`PVSC 2014 paper <http://energy.sandia.gov/wp/wp-content/gallery/uploads/PV_LIB_Python_final_SAND2014-18444C.pdf>`_
39-
and
40-
`PVSC 2015 paper <https://github.com/pvlib/pvsc2015/blob/master/pvlib_pvsc_42.pdf>`_
41-
(and the `notebook to reproduce the figures <http://nbviewer.ipython.org/github/pvlib/pvsc2015/blob/master/paper.ipynb>`_) for more information.
42-
43-
The GitHub wiki also has a page on `Projects and publications that use pvlib python <https://github.com/pvlib/pvlib-python/wiki/Projects-and-publications-that-use-pvlib-python>`_ for inspiration and listing of your application.
44-
45-
There is a :ref:`variable naming convention <variables_style_rules>` to ensure consistency throughout the library.
46-
47-
Installation
48-
============
49-
50-
1. Follow Pandas'
51-
`instructions <http://pandas.pydata.org/pandas-docs/stable/install.html>`_
52-
for installing the scientific python stack, including ``pip``.
53-
#. ``pip install pvlib-python``
4+
pvlib-python provides a set of documented functions for simulating the
5+
performance of photovoltaic energy systems. The toolbox was originally
6+
developed in MATLAB at Sandia National Laboratories and it implements
7+
many of the models and methods developed at the Labs. More information
8+
on Sandia Labs PV performance modeling programs can be found at
9+
https://pvpmc.sandia.gov/.
10+
11+
The source code for pvlib-python is hosted on `github
12+
<https://github.com/pvlib/pvlib-python>`_.
13+
14+
Please see the :ref:`installation` page for installation help.
15+
16+
For examples of how to use pvlib-python, please see
17+
:ref:`package_overview` and our `Jupyter Notebook tutorials
18+
<http://nbviewer.ipython.org/github/pvlib/pvlib-python/tree/master/docs/
19+
tutorials/>`_. The documentation assumes general familiarity with
20+
Python, NumPy, and Pandas. Google searches will yield many
21+
excellent tutorials for these packages.
22+
23+
The pvlib-python GitHub wiki has a `Projects and publications that use
24+
pvlib python
25+
<https://github.com/pvlib/pvlib-python/wiki/Projects-and-publications-
26+
that-use-pvlib-python>`_ page for inspiration and listing of your
27+
application.
28+
29+
There is a :ref:`variable naming convention <variables_style_rules>` to
30+
ensure consistency throughout the library.
31+
32+
Citing pvlib-python
33+
===================
34+
35+
Many of the contributors to pvlib-python work in institutions where
36+
citation metrics are used in performance or career evaluations. If you
37+
use pvlib-python in a published work, please cite the most appropriate
38+
of:
39+
40+
* J. S. Stein, “The photovoltaic performance modeling
41+
collaborative (PVPMC),” in Photovoltaic Specialists Conference, 2012.
42+
* R.W. Andrews, J.S. Stein, C. Hansen, and D. Riley, “Introduction
43+
to the open source pvlib for python photovoltaic system
44+
modelling package,” in 40th IEEE Photovoltaic Specialist
45+
Conference, 2014.
46+
(`paper
47+
<http://energy.sandia.gov/wp/wp-content/gallery/uploads/PV_LIB_Python_final_SAND2014-18444C.pdf>`_)
48+
* W.F. Holmgren, R.W. Andrews, A.T. Lorenzo, and J.S. Stein,
49+
“PVLIB Python 2015,” in 42nd Photovoltaic Specialists Conference, 2015.
50+
(`paper
51+
<https://github.com/pvlib/pvsc2015/blob/master/pvlib_pvsc_42.pdf>`_ and
52+
the `notebook to reproduce the figures
53+
<http://nbviewer.ipython.org/github/pvlib/pvsc2015/blob/master/paper.ipynb>`_)
54+
* J.S. Stein, W.F. Holmgren, J. Forbess, and C.W. Hansen,
55+
"PVLIB: Open Source Photovoltaic Performance Modeling Functions
56+
for Matlab and Python," in 43rd Photovoltaic Specialists Conference, 2016.
57+
* W.F. Holmgren and D.G. Groenendyk,
58+
"An Open Source Solar Power Forecasting Tool Using PVLIB-Python,"
59+
in 43rd Photovoltaic Specialists Conference, 2016.
60+
61+
Specific released versions of pvlib-python can be cited using their
62+
`Zenodo DOI <https://zenodo.org/search?ln=en&p=pvlib&action_search=>`_.
5463

5564

5665
Contents
5766
========
5867

5968
.. toctree::
6069
:maxdepth: 2
61-
62-
self
70+
6371
package_overview
6472
whatsnew
73+
installation
74+
contributing
75+
timetimezones
6576
modules
6677
classes
6778
comparison_pvlib_matlab
@@ -72,6 +83,4 @@ Indices and tables
7283
==================
7384

7485
* :ref:`genindex`
75-
* :ref:`modindex`
7686
* :ref:`search`
77-

0 commit comments

Comments
 (0)