Skip to content

Commit da2cfec

Browse files
authored
Merge branch 'master' into windows
2 parents 197ebb8 + c5c332c commit da2cfec

7 files changed

Lines changed: 46 additions & 38 deletions

File tree

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ Manoa.
88
The following people have contributed code to the project (alphabetical by last name)
99
and are considered the "PyGMT Developers":
1010

11+
* [Wei Ji Leong](https://github.com/weiji14)
1112
* [Dongdong Tian](https://seisman.info/)
1213
* [Leonardo Uieda](http://www.leouieda.com/)

doc/install.rst

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Which Python?
1919

2020
You'll need **Python 3.6 or greater** to run PyGMT.
2121

22-
We recommend using the `Anaconda <http://continuum.io/downloads#all>`__ Python
22+
We recommend using the `Anaconda <https://www.anaconda.com/distribution>`__ Python
2323
distribution to ensure you have all dependencies installed and the ``conda``
2424
package manager available.
2525
Installing Anaconda does not require administrative rights to your computer and
@@ -29,14 +29,23 @@ doesn't interfere with any other Python installations in your system.
2929
Which GMT?
3030
----------
3131

32-
You'll need the latest development version available from
33-
`the GitHub repository <https://github.com/GenericMappingTools/gmt>`__.
34-
PyGMT is based on GMT 6, **which has not yet been officially released**.
32+
PyGMT requires GMT 6 as a minimum, which you can find the latest development version
33+
at `this GitHub repository <https://github.com/GenericMappingTools/gmt>`__.
3534

3635
We need the very latest GMT since there are many changes being made to GMT itself in
3736
response to the development of PyGMT, mainly the new
38-
`modern execution mode <http://gmt.soest.hawaii.edu/projects/gmt/wiki/Modernization>`__.
37+
`modern execution mode <https://gmt.soest.hawaii.edu/projects/gmt/wiki/Modernization>`__.
3938

39+
**GMT 6 has not been officially released yet**, but will be soon!
40+
In the meantime, GMT does provide compiled conda packages of their development version
41+
for Linux, Mac and Windows through
42+
`conda-forge <https://anaconda.org/conda-forge/gmt>`__.
43+
Advanced users can also
44+
`build GMT from source <https://github.com/GenericMappingTools/gmt/blob/master/BUILDING.md>`__
45+
instead, which is not so recommended but we would love to get feedback from anyone who
46+
tries.
47+
48+
We recommend following the instructions further on to install GMT 6.
4049

4150
Dependencies
4251
------------
@@ -53,44 +62,38 @@ The following are optional (but recommended) dependencies:
5362
* `IPython <https://ipython.org/>`__: For embedding the figures in Jupyter notebooks.
5463

5564

56-
Installing GMT
57-
--------------
58-
59-
Unfortunately, you'll have to build GMT from source in order to get PyGMT working.
60-
Please follow the `GMT Building Instructions <https://github.com/GenericMappingTools/gmt/blob/master/BUILDING.md>`__.
61-
62-
For Windows users, you can also try to install the binaries of
63-
GMT development version, available from http://w3.ualg.pt/~jluis/mirone/downloads/gmt.html.
64-
Currently, we don't have tests running on Windows yet, so things might be broken.
65-
Please report any errors by `creating an issue on Github <https://github.com/GenericMappingTools/pygmt/issues>`__.
66-
67-
.. note::
68-
69-
We used to maintain conda packages for the latest GMT. That caused many problems and
70-
was very difficult to maintain updated. We have opted to not do that anymore so that
71-
we can develop more quickly. Once GMT 6 is officially released, we'll have conda
72-
packages available again. Please bear with us.
73-
74-
Installing dependencies
75-
-----------------------
65+
Installing GMT and other dependencies
66+
-------------------------------------
7667

77-
Before installing PyGMT, we must install its dependencies.
68+
Before installing PyGMT, we must install GMT itself along with the other dependencies.
7869
The easiest way to do this is using the ``conda`` package manager.
7970
We recommend working in an isolated
80-
`conda environment <https://conda.io/docs/user-guide/tasks/manage-environments.html>`__
71+
`conda environment <https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`__
8172
to avoid issues with competing versions of its dependencies.
8273

83-
We can create a new conda environment with Python and all our dependencies installed
74+
First, we must configure conda to get packages from the
75+
`conda-forge channel <https://conda-forge.org/>`__ (the order is important)::
76+
77+
conda config --prepend channels conda-forge/label/dev
78+
conda config --prepend channels conda-forge
79+
80+
Now we can create a new conda environment with Python and all our dependencies installed
8481
(we'll call it ``pygmt`` but you can change it to whatever you want)::
8582

86-
conda create --name pygmt python=3.6 pip numpy pandas xarray packaging
83+
conda create --name pygmt python=3.6 pip numpy pandas xarray packaging gmt=6.0.0rc*
8784

8885
Activate the environment by running::
8986

90-
source activate pygmt
87+
conda activate pygmt
88+
89+
From now on, all commands will take place inside the conda virtual environment and won't
90+
affect your default installation.
91+
92+
.. note::
9193

92-
From now on, all commands will take place inside the environment and won't affect your
93-
default installation.
94+
**Currently, this has only been tested to work on Linux and macOS.**
95+
We don't have tests running on Windows yet, so things might be broken.
96+
Please report any errors by `creating an issue on Github <https://github.com/GenericMappingTools/pygmt/issues>`__.
9497

9598
Installing PyGMT
9699
----------------

pygmt/clib/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Session:
7373
library in the directory specified by it.
7474
7575
A ``GMTVersionError`` exception will be raised if the GMT shared library reports a
76-
version < 6.0.0rc1.
76+
version < 6.0.0rc4.
7777
7878
The ``session_pointer`` attribute holds a ctypes pointer to the currently open
7979
session.
@@ -112,7 +112,7 @@ class Session:
112112
"""
113113

114114
# The minimum version of GMT required
115-
required_version = "6.0.0rc1"
115+
required_version = "6.0.0rc4"
116116

117117
@property
118118
def session_pointer(self):
@@ -463,7 +463,7 @@ def call_module(self, module, args):
463463
Parameters
464464
----------
465465
module : str
466-
Module name (``'pscoast'``, ``'psbasemap'``, etc).
466+
Module name (``'coast'``, ``'basemap'``, etc).
467467
args : str
468468
String with the command line arguments that will be passed to the
469469
module (for example, ``'-R0/5/0/10 -JM'``).

pygmt/tests/test_clib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ def test_get_default():
740740
with clib.Session() as lib:
741741
assert lib.get_default("API_GRID_LAYOUT") in ["rows", "columns"]
742742
assert int(lib.get_default("API_CORES")) >= 1
743-
assert Version(lib.get_default("API_VERSION")) >= Version("6.0.0rc1")
743+
assert Version(lib.get_default("API_VERSION")) >= Version("6.0.0rc4")
744744

745745

746746
def test_get_default_fails():

pygmt/tests/test_session_management.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_begin_end():
1515
end() # Kill the global session
1616
begin()
1717
with Session() as lib:
18-
lib.call_module("psbasemap", "-R10/70/-3/8 -JX4i/3i -Ba")
18+
lib.call_module("basemap", "-R10/70/-3/8 -JX4i/3i -Ba")
1919
end()
2020
begin() # Restart the global session
2121
assert os.path.exists("pygmt-session.pdf")

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Requirements for installing with conda
2-
gmt==6.0.0rc3
2+
gmt=6.0.0rc4
33
numpy
44
pandas
55
xarray

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ tag_prefix = ''
88
[flake8]
99
ignore = E203, E266, E501, W503, F401, E741
1010
max-line-length = 88
11+
12+
[tool:pytest]
13+
markers =
14+
mpl_image_compare: compare generated plots with correct baseline version

0 commit comments

Comments
 (0)