Skip to content

add extras_require complete and test options #566

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

Merged
merged 9 commits into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 17 additions & 6 deletions docs/sphinx/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ non-editable way, use one of the following commands to install pvlib-python::
# best option if you know what you are doing
pip install pvlib

# get pvlib and optional dependencies from the Python Package Index
# another option if you know what you are doing
pip install pvlib[optional]

If your system complains that you don't have access privileges or asks
for a password then you're probably trying to install pvlib into your
system's Python distribution. This is usually a bad idea and you should
Expand Down Expand Up @@ -163,9 +167,9 @@ referred to as *conda environments*, but they're the same for our purposes.
#. **Create** a new conda environment for pvlib and pre-install
the required packages into the environment:
``conda create --name pvlibdev python pandas scipy``
#. **Activate** the new conda environment: ``source activate pvlibdev``
#. **Activate** the new conda environment: ``conda activate pvlibdev``
#. **Install** additional packages into your development environment:
``conda install jupyter ipython matplotlib seaborn pytest nose flake8``
``conda install jupyter ipython matplotlib pytest nose flake8``

The `conda documentation <https://conda.io/docs/index.html>`_ has more
information on how to use conda virtual environments. You can also add
Expand All @@ -181,10 +185,12 @@ Good news -- installing the source code is the easiest part!
With your conda/virtual environment still active...

#. **Install** pvlib-python in "development mode" by running
``pip install -e /path/to/your/pvlib-python``.
You remember this path from the clone step, right? It's probably
something like ``C:\Users\%USER%\Documents\GitHub\pvlib-python``
(Windows) or ``/Users/%USER%/Documents/pvlib-python`` (Mac).
``pip install -e .`` from within the directory you previously cloned.
Consider installing pvlib using ``pip install -e .[all]`` so that
you can run the unit tests and build the documentation.
Your clone directory is probably similar to
``C:\Users\%USER%\Documents\GitHub\pvlib-python``(Windows) or
``/Users/%USER%/Documents/pvlib-python`` (Mac).
#. **Test** your installation by running ``python -c 'import pvlib'``.
You're good to go if it returns without an exception.

Expand Down Expand Up @@ -229,6 +235,11 @@ include:

The Anaconda distribution includes most of the above packages.

Alternatively, users may install all optional dependencies using

pip install pvlib[optional]


.. _nrelspa:

NREL SPA algorithm
Expand Down
7 changes: 6 additions & 1 deletion docs/sphinx/source/whatsnew/v0.6.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,13 @@ Enhancements
* Add irradiance.clearness_index_zenith_independent function. (:issue:`396`)
* Add checking for consistency between module_parameters and dc_model. (:issue:`417`)
* Add DC model methods ``'desoto'`` and ``'pvsyst'`` to ModelChain (:issue:`487`)
* Add the CEC module model in `pvsystem.calcparams_cec` and `ModelChain.cec`. (:issue:`463`)
* Add the CEC module model in `pvsystem.calcparams_cec` and `ModelChain.cec`. (:issue:`463`)
* Add DC model methods desoto and pvsyst to ModelChain (:issue:`487`)
* pvlib now ships with a pvlib[optional] installation option to automatically
install packages needed to support additional pvlib features:
``pip install pvlib[optional]``. Additional installation options include
`doc` (requirements for minimal documentation build), `test` (requirements
for testing), and `all` (optional + doc + test). (:issue:`553`, :issue:`483`)
* Set default alpha to 1.14 in :func:`~pvlib.atmosphere.angstrom_aod_at_lambda` (:issue:`563`)


Expand Down
9 changes: 5 additions & 4 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
conda:
file: docs/environment.yml
python:
version: 2
setup_py_install: true
version: 3
use_system_site_packages: true
pip_install: true
extra_requirements:
- all
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@
'pytz',
'six',
]
TESTS_REQUIRE = ['pytest', 'nose']
TESTS_REQUIRE = ['pytest', 'pytest-cov', 'pytest-mock', 'nose']
EXTRAS_REQUIRE = {
'optional': ['scipy', 'tables', 'numba', 'siphon', 'netcdf4', 'ephem'],
'doc': ['sphinx', 'ipython', 'sphinx_rtd_theme', 'numpydoc',
'matplotlib'],
'test': TESTS_REQUIRE
}
EXTRAS_REQUIRE['all'] = sorted(set(sum(EXTRAS_REQUIRE.values(), [])))

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand Down Expand Up @@ -94,6 +101,7 @@
cmdclass=versioneer.get_cmdclass(),
packages=PACKAGES,
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
tests_require=TESTS_REQUIRE,
ext_modules=extensions,
description=DESCRIPTION,
Expand Down