GenericMappingTools / pygmt

A Python interface for the Generic Mapping Tools.
https://www.pygmt.org
BSD 3-Clause "New" or "Revised" License
758 stars 220 forks source link

Some potential improvements of the installation instructions #3371

Closed seisman closed 2 weeks ago

seisman commented 3 months ago

Looking at the Installation Instructions, currently four optional dependencies are listed

  • IPython: For embedding the figures in Jupyter notebooks (recommended).
  • Contextily: For retrieving tile maps from the internet.
  • GeoPandas: For using and plotting GeoDataFrame objects.
  • RioXarray: For saving multi-band rasters to GeoTIFFs.

Here are my thoughts:

  1. Install the optional dependencies in the Installing GMT and other dependencies step to have a full-feature PyGMT. There are two options: (1) add optional dependencies when creating the virtual environment; (2) add a separate command: mamba install ipython contextily geopandas rioxarray to install the optional packages after creating the virtual environment.

  2. Are IPython and GeoPandas considered optional dependencies? (1) PyGMT supports GeoPandas objects as inputs but GeoPandas is not imported anywhere in the PyGMT source codes; (2) IPython is needed for embedding figures in Jupyter Notebooks, but as long as users are in a Notebook environment, IPython is always available since it's a dependency of Jupyter.

  3. Some packages like GeoPandas/Shapely/PyArrow, are not directly used in PyGMT, but it's good to let users know that PyGMT supports them.

seisman commented 2 months ago

Ping @GenericMappingTools/pygmt-maintainers

weiji14 commented 1 month ago
  1. ... (2) add a separate command: mamba install ipython contextily geopandas rioxarray to install the optional packages after creating the virtual environment.

Sure, we can add a tip admonition to show this, similar to how we're showing pip install pygmt[all] here:

https://github.com/GenericMappingTools/pygmt/blob/89021cdb1bfea805780612e52ced974e1afdc216/doc/install.md?plain=1#L218-L221

3. Some packages like GeoPandas/Shapely/PyArrow, are not directly used in PyGMT, but it's good to let users know that PyGMT supports them.

Maybe we could add a section under the Technical References page or somewhere else to mention these integrations? Some of these are hiding in old issues:

Examples of others around the Scientific Python Ecosystem: