Skip to content

Commit c44205b

Browse files
authored
Update install instructions (#430)
- Add conda install instructions - PyGMT now works well with GMT on Windows - Fixes a few documentation issues. - List netcdf4 as a dependency
1 parent e018f21 commit c44205b

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

doc/install.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,16 @@ Which GMT?
3030

3131
PyGMT requires Generic Mapping Tools (GMT) version 6 as a minimum, which is the latest
3232
released version that can be found at
33-
`this website <https://www.generic-mapping-tools.org>`__.
34-
33+
the `GMT official site <https://www.generic-mapping-tools.org>`__.
3534
We need the latest GMT (>=6.0.0) since there are many changes being made to GMT itself in
3635
response to the development of PyGMT, mainly the new
3736
`modern execution mode <https://docs.generic-mapping-tools.org/latest/cookbook/introduction.html#modern-and-classic-mode>`__.
3837

39-
Compiled conda packages of GMT for Linux and Mac are provided through
38+
Compiled conda packages of GMT for Linux, macOS and Windows are provided through
4039
`conda-forge <https://anaconda.org/conda-forge/gmt>`__.
4140
Advanced users can also
4241
`build GMT from source <https://github.com/GenericMappingTools/gmt/blob/master/BUILDING.md>`__
4342
instead, which is not so recommended but we would love to get feedback from anyone who tries.
44-
For Windows, conda GMT packages are available, but they do not currently work with PyGMT,
45-
so users will need to build from source or use the Windows Subsystem for Linux, see
46-
`here <https://github.com/GenericMappingTools/pygmt/pull/313>`__ for more details.
4743

4844
We recommend following the instructions further on to install GMT 6.
4945

@@ -55,6 +51,7 @@ PyGMT requires the following libraries:
5551
* `numpy <http://www.numpy.org/>`__
5652
* `pandas <https://pandas.pydata.org/>`__
5753
* `xarray <http://xarray.pydata.org/>`__
54+
* `netCDF4 <https://github.com/Unidata/netcdf4-python>`__
5855
* `packaging <https://pypi.org/project/packaging/>`__
5956

6057
The following are optional (but recommended) dependencies:
@@ -79,7 +76,7 @@ First, we must configure conda to get packages from the
7976
Now we can create a new conda environment with Python and all our dependencies installed
8077
(we'll call it ``pygmt`` but you can change it to whatever you want)::
8178

82-
conda create --name pygmt python=3.6 pip numpy pandas xarray packaging gmt=6.0.0
79+
conda create --name pygmt python=3.8 pip numpy pandas xarray netcdf4 packaging gmt
8380

8481
Activate the environment by running::
8582

@@ -88,17 +85,16 @@ Activate the environment by running::
8885
From now on, all commands will take place inside the conda virtual environment and won't
8986
affect your default installation.
9087

91-
.. note::
92-
93-
**Currently, this has only been tested to work on Linux and macOS.**
94-
We don't have tests running on Windows yet, so things might be broken.
95-
Please report any errors by `creating an issue on Github <https://github.com/GenericMappingTools/pygmt/issues>`__.
9688

9789
Installing PyGMT
9890
----------------
9991

100-
Now that you have GMT installed and your conda environment activated,
101-
use ``pip`` to install the latest release of PyGMT from `PyPI <https://pypi.org/project/pygmt>`__::
92+
Now that you have GMT installed and your conda environment activated, you can
93+
use ``conda`` to install the latest release of PyGMT from `conda-forge <https://anaconda.org/conda-forge/pygmt>`__::
94+
95+
conda install pygmt
96+
97+
or use ``pip`` to install from `PyPI <https://pypi.org/project/pygmt>`__::
10298

10399
pip install pygmt
104100

@@ -134,7 +130,11 @@ This can happen if you have multiple versions of GMT installed.
134130
You can tell PyGMT exactly where to look for ``libgmt`` by setting the
135131
``GMT_LIBRARY_PATH`` environment variable.
136132
This should be set to the directory where ``libgmt.so``, ``libgmt.dylib`` or ``gmt.dll``
137-
can be found for Linux, MacOS and Windows respectively.
133+
can be found for Linux, macOS and Windows respectively.
138134
e.g. in a terminal run::
139135

140-
export GMT_LIBRARY_PATH=$HOME/anaconda3/envs/pygmt/lib
136+
# Linux/macOS
137+
export GMT_LIBRARY_PATH=$HOME/anaconda3/envs/pygmt/lib
138+
# Windows
139+
set "GMT_LIBRARY_PATH=C:\Users\USERNAME\Anaconda3\envs\pygmt\Library\bin\"
140+

pygmt/base_plotting.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ def grdview(self, grid, **kwargs):
349349
350350
Full option list at :gmt-docs:`grdview.html`
351351
352+
{aliases}
353+
352354
Parameters
353355
----------
354356
grid : str or xarray.DataArray
@@ -399,7 +401,6 @@ def grdview(self, grid, **kwargs):
399401
``'[x|y|z]azim[/elev[/zlevel]][+wlon0/lat0[/z0]][+vx0/y0]'``.
400402
Select perspective view.
401403
402-
{aliases}
403404
"""
404405
kwargs = self._preprocess(**kwargs)
405406
kind = data_kind(grid, None, None)

pygmt/sampling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def grdtrack(points, grid, newcolname=None, outfile=None, **kwargs):
5151
-------
5252
track: pandas.DataFrame or None
5353
Return type depends on whether the outfile parameter is set:
54+
5455
- pandas.DataFrame table with (x, y, ..., newcolname) if outfile is not
5556
set
5657
- None if outfile is set (track output will be stored in outfile)

0 commit comments

Comments
 (0)