Skip to content
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

Add a note to installation docs about dependencies #744

Merged
merged 4 commits into from
Jul 10, 2019
Merged

Add a note to installation docs about dependencies #744

merged 4 commits into from
Jul 10, 2019

Conversation

odow
Copy link
Contributor

@odow odow commented Jul 2, 2019

pvlib python pull request guidelines

  • Closes issue #xxxx
  • I am familiar with the contributing guidelines.
  • Fully tested. Added and/or modified tests to ensure correct behavior for all reasonable inputs. Tests (usually) must pass on the TravisCI and Appveyor testing services.
  • Updates entries to docs/sphinx/source/api.rst for API changes.
  • Adds description and name entries in the appropriate docs/sphinx/source/whatsnew file for all changes.
  • Code quality and style is sufficient. Passes LGTM and SticklerCI checks.
  • New code is fully documented. Includes sphinx/numpydoc compliant docstrings and comments in the code where necessary.
  • Pull request is nearly complete and ready for detailed review.

Brief description of the problem and proposed solution (if not already fully described in the issue linked to above):

Add extra documentation to installation as discussed in this Google group post: https://groups.google.com/forum/#!topic/pvlib-python/QtvHELYmrww

Here is a screenshot of the docs as compiled locally:
image

If you run into an error such as
`ModuleNotFoundError: No module named 'netCDF4'`
you can either add these manually with:
`pip install netCDF4`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. I'm concerned that users may also be using conda instead of or in addition to pip. What are the repercussions for a conda user if they read this and run pip install netCDF4, or put another way, should they take a different action?

  • There is an older version of netcdf4 on anaconda default channel, which still meets pvlib minimum requirments
  • WARNING there is also a conda-forge version of the current netcdf4 however, the netcdf4 conda-forge feedstock lists numpy as a dependent, so mixing with the default anaconda channel may corrupt your conda env, therefore probably better to use an env with conda-forge as default
  • the netCDF4 setup.py lists numpy and cftime as dependencies, so using pip install netcdf4 will install cftime from PyPI not anaconda. I am assuming that the wheels at the Cheeseshop already include the hdf5 and netcdf4 libraries, which are also available from the anaconda main channel.

So my recommendation would be to treat LIKE ALIKE.

  • if PyPI then use pip
  • if anaconda, then use conda
  • if conda-forge, then use conda -c conda-forge

Where this breaks down is for a few packages like siphon which AFAIK doesn't have a good version on the default anaconda channel. Search anaconda for siphon and you find conda-forge, Unidata, and a few others, each with different versions. Siphon setup.py lists numpy, protobuf, beautifulsoup4, requests, and pandas as dependencies, which are all available from the default anaconda channel or conda-forge. If they are installed first using conda, then siphon can be installed from PyPI using pip.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I didn't read the comments in the installation instructions carefully enough, particularly the # best option if using pvlib.forecast module line added in #533. This is my fault, but it would be nice to have a big orange box rather than an (obvious) line buried in a code comment.

Would you accept a change to

By default, pvlib will not install some infrequently used dependencies. 
If you run into an error such as  
`ModuleNotFoundError: No module named 'netCDF4'`
you can either install pvlib with all optional dependencies using
`pip install pvlib[optional]`, or you can install pvlib from conda-forge
`conda create -n pvlib -c conda-forge pvlib-python; conda activate pvlib`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a big orange box is appropriate for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the wording. Let me know if you want any changes.

@mikofski
Copy link
Member

mikofski commented Jul 3, 2019

Sure, lgtm

@cwhanse
Copy link
Member

cwhanse commented Jul 9, 2019

@odow please merge master, with #748 should fix the py35-min test failure.

@cwhanse cwhanse merged commit 695ec23 into pvlib:master Jul 10, 2019
@odow odow deleted the patch-1 branch July 10, 2019 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants