Skip to content

clearsky.py requires PyTables but setup.py doesn't list it as install_requires #553

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

Closed
tadatoshi opened this issue Sep 4, 2018 · 5 comments
Milestone

Comments

@tadatoshi
Copy link

Getting clearsky from Location causes an error
I tried the rdtools' excample, which used pvlib.
At the first line under section "Clear Sky 0: Preliminary Calculations", executing
clearsky = loc.get_clearsky(df.index, solar_position = sun)
causes an error:
ImportError: The Linke turbidity lookup table requires tables. You can still use clearsky.ineichen if you supply your own turbidities.
Looking at the code found that it requires PyTables package.
Installing PyTables by pip "pip install tables" solved the problem.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Location. e.g.
    loc = pvlib.location.Location(latitude, longitude, tz = timezone)
  2. Get clearsky from loc. e.g.
    clearsky = loc.get_clearsky(df.index, solar_position = sun)
  3. Execute the code

Expected behavior
The problem is that PyTables package is required but this is not documented, nor written in setup.py.
This should be documented and PyTables should be lisetd as install_requires in setup.py.

Versions:

  • pvlib.__version__: 0.5.2
  • pandas.__version__: 0.23.4
  • python: 3.6.4

Additional context
This is not necessarily a bug. But other categories didn't seem to fit thus I put this as a Bug report.

@wholmgren
Copy link
Member

Thanks for posting. The base pvlib installation does not require packages such as pytables and scipy that are only used in a handful of functions. See Installation/Compatibility.

See #483 for related discussion about making scipy a requirement.

@cwhanse
Copy link
Member

cwhanse commented Sep 4, 2018

I think something else is amiss in your code @tadatoshi

This runs without error for me:

`
import pvlib
import pandas as pd

dt = pd.DatetimeIndex(start='2018-08-30', end='2018-08-31', freq='1H')

df = pd.DataFrame(index=dt)

latitude = -23.762
longitude = 133.874886
timezone = 'Australia/North'
df.index.tz_localize(timezone)

loc = pvlib.location.Location(latitude, longitude, tz = timezone)

sun = loc.get_solarposition(df.index)

clearsky = loc.get_clearsky(df.index, solar_position = sun)
`

@wholmgren
Copy link
Member

@cwhanse I believe you are using the base Anaconda environment which already includes pytables. It sounds like @tadatoshi uses pvlib in an environment that is not prepopulated with pytables, scipy, etc. If I understand correctly, @tadatoshi expects that pip install pvlib will automatically install pytables if it's not already installed.

@cwhanse
Copy link
Member

cwhanse commented Sep 4, 2018

@wholmgren you are correct

@tadatoshi
Copy link
Author

tadatoshi commented Sep 5, 2018

Thank you for prompt responses.
I appreciate it very much.

I write the context that led me to use pip instead of Anaconda.
I was trying to use RdTools in Jupyter Notebook started in Anaconda environment.
However, "conda install rdtools" failed because it was not found in the default Anaconda repositories.
I couldn't find their documentation about how to install it in Anaconda.
Hence, I decided to run Jupyter Notebook from Virtual Environment based on pip.
I installed all the packages specified in setup.py of pvlib-python and jupyter, matplotlib and rdtools in the virtual environment.
Then encountered the error because I didn't install PyTables because I didn't know that it was required.

Maybe this is a special case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants