-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Missing Module Dependency - Tables #1252
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
Comments
It is an optional dependency: https://github.com/pvlib/pvlib-python/blob/master/setup.py#L56 Should this be explained better in the online docs? Or maybe mention something about |
Is there a good reason that |
I ran into many problems yesterday building a new environment yesterday on Windows and they all seemed to revolve around getting I'll eventually figure out how to build the environment on Windows again since I prefer working with PyCharm and it's debugger, but if there is any advice you all can provide for the Windows environment build process that would be great. |
@kahemker can you post details about the commands you're running and the errors messages you got? I'm happy to help figure out a solution, but I can't seem to reproduce the issue myself -- I went to some effort in #1287 to make sure
It's just grabbing the wheel off PyPI:
|
Wow. Thank you @kanderso-nrel . I think the problem was trying to install the environment on python=3.9 and following these instructions on the documentation for setting up a virtual environment. The primary errors in building wheel for tables-3.6.1 on Python 3.9 seem to revolve around the lzo decompression libraries. There are a ton of link errors like this:
The error list gets very long and starts to revolve around Microsoft Visual Studio 2019 build tools I'll stick with Python 3.8 for now. Wish I would have found #1287 yesterday! I did learn a lot about WSL and it seems like a pretty solid option for developing on Linux OS without the overhead of VMs. |
Oh right, I should have asked if you were using python 3.9. At the moment For anyone running into an issue installing
|
I think we're likely to run into this many, many times. probably should do a stack overflow search for pvlib + tables or install. One constant source of confusion is that in conda it's called "pytables" but in pypi it's just "tables" |
All great ideas. For the sphinx docs, I think adding a short note with a link to this would be fine. It would make sense to do that before 0.9 is tagged. At the risk of issue scope creep, it's also worth considering if we should use a different format since this seems likely to repeat with python 3.10. |
I prefer h5py, it's a lot easier to use, more stable, better maintained imho, reuses the numpy api for structured arrays, and it's from the actual makers of the HDF5. But unfortunately, pandas chose to use tables which was unfortunate imo. It wouldn't be too hard to switch the raw linke turbidity data to use h5py. Once extracted, the numpy API makes it super easy to create a data frame by just passing the structured array directly to Another option is parquet, which is built into pandas and is quite popular. And of course, we're already using netcdf4, which seems like the obvious choice, but I don't believe there's a pandas |
I used to use pandas.to_hdf() all the time, and when I'm lazy I still do for short-term storage. For a brief time I thought h5py was the way to go for better sharing, but it's really pretty low level (e.g. you have to encode and parse timestamps and transpose 2d structures in matlab). Currently I'm a big fan of netcdf4 made easy by xarray. |
Here is some basic exploration comparing packages for reading the TL data stored as .h5 and .nc files: https://gist.github.com/kanderso-nrel/09c320d08ef8daac80f3302e4b11b1ac To summarize:
I did not try parquet. Does it support lazy loading/indexing like h5 and nc? I think |
OK, I just assumed that we were using tables because it works with pandas, but it turns out that the Since we already import netcdf4 and I believe we're about to start using xarray, I'm in favor of using one of those two. I'm slightly more in favor of using xarray, and wondering if we can replace netcdf4 everywhere with xarray, even tho it comes with extra latency, bc then it's just one package and it plays well with pandas. I'd also be happy to use h5py. Just not tables. Let's remove the tables dependency before we ship v0.9 so we don't have to make further changes. Tables and PyTables is an unnecessary headache in my book. |
BTW: I though TL data was originally available for download as an Anyone know are we using the 2003 or 2010 values? what's the difference? |
Thanks @kanderso-nrel for the careful comparisons! I think we should switch to Two things that people probably already know but I feel like are not really addressed in some of the discussion above:
Looks like we only went with pytables because that's what pandas used and we didn't put much more thought into it: #437 (comment).
|
In the pvlib.clearsky.lookup_linke_turbidity() function, you have the following error handling:
try:
import tables
except ImportError:
raise ImportError('The Linke turbidity lookup table requires tables. '
'You can still use clearsky.ineichen if you '
'supply your own turbidities.')
Unfortunately, the tables module has not been included as a dependency of the pvlib package.
The text was updated successfully, but these errors were encountered: