-
Notifications
You must be signed in to change notification settings - Fork 225
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 netCDF4 as a dependency and install netcdf4 #429
Conversation
xarray needs the netCDF4 package for reading (perhaps also writing) netCDF files. However, netCDF4 isn't installed by default since it's an optional dependency of xarray. Although pygmt doesn't import netCDF4 package explicitely, some features won't work without the package. See #239 for past discussions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @seisman, was surprised that netcdf4
wasn't listed! Just one minor comment on whether we should streamline the conda install instructions once #430 is merged in.
I do wonder whether we should list netcdf
as a strict dependency, or have it as a (strongly) recommended one. For sure that conda users should install it and get it. But I wonder if there are advanced users that might not want to install it because of GPL issues (see intake/intake-xarray#41), though that would need to fixed on our setup.py.
@@ -79,7 +80,7 @@ First, we must configure conda to get packages from the | |||
Now we can create a new conda environment with Python and all our dependencies installed | |||
(we'll call it ``pygmt`` but you can change it to whatever you want):: | |||
|
|||
conda create --name pygmt python=3.6 pip numpy pandas xarray packaging gmt=6.0.0 | |||
conda create --name pygmt python=3.6 pip numpy pandas xarray netcdf4 packaging gmt=6.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once #430 is merged, would it be better to just instruct users to conda install pygmt
since it'll pull in all the side dependencies as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, perhaps we should merge conda-forge/pygmt-feedstock#2 first, then instruct users to install pygmt with:
conda create --name pygmt pygmt
Then again, GMT is LGPL licensed, but PyGMT is BSD3 licensed, so I'm not sure if it matters. I'm not a lawyer though. |
Just a note that In the future, we might want to look into supporting other PyData 'array' type inputs (via some setting, e.g. as a kwargs) as an alternative to non- |
@weiji14 I just moved netcdf4 to an optional dependency, and remove it from the conda install command. |
If we're going to put this as optional, then maybe remove it from |
I personally prefer to have all dependencies installed. AFAIK, |
Yeah, better to have it as a non-optional dependency then. We could have a |
Done. |
Merged into PR #430. Closing. |
Description of proposed changes
xarray needs the netCDF4 package for reading (perhaps also writing) netCDF files. However, netCDF4 isn't installed by default since it's an optional dependency of xarray. Although pygmt doesn't import netCDF4 package explicitely, some features won't work without the package.
See #239 for past discussions.
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.