Skip to content

Commit 7e0940c

Browse files
committed
Merge branch 'master' into data_version_control
2 parents 567c967 + b2b3d1f commit 7e0940c

40 files changed

+57
-48
lines changed

.github/workflows/cache_data.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
gmt_cache:
1313
name: Cache GMT artifacts
1414
runs-on: macOS-latest
15+
defaults:
16+
run:
17+
shell: bash -l {0}
1518

1619
steps:
1720
# Setup Miniconda
@@ -23,21 +26,19 @@ jobs:
2326

2427
# Install GMT
2528
- name: Install GMT
26-
shell: bash -l {0}
2729
run: conda install -c conda-forge gmt=6.1.1
2830

2931
# Download remote files
3032
- name: Download remote data
31-
shell: bash -l {0}
3233
run: |
3334
gmt which -Ga @earth_relief_10m_p @earth_relief_10m_g \
3435
@earth_relief_30m_p @earth_relief_30m_g \
3536
@earth_relief_01d_p @earth_relief_01d_g \
3637
@earth_relief_05m_p @earth_relief_05m_g
3738
# Download one tile of the 03s srtm data.
3839
# @N35E135.earth_relief_03s_g.nc is for internal use only.
39-
# The naming scheme may change.
40-
# DO NOT USE IT IN SCRIPTS.
40+
# The naming scheme may change.
41+
# DO NOT USE IT IN SCRIPTS.
4142
gmt which -Ga @N35E135.earth_relief_03s_g.nc
4243
gmt which -Ga @ridge.txt @Table_5_11.txt @test.dat.nc \
4344
@tut_bathy.nc @tut_quakes.ngdc @tut_ship.xyz \

.github/workflows/ci_tests.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
- os: ubuntu-latest
4646
python-version: 3.8
4747
isDraft: true
48+
defaults:
49+
run:
50+
shell: bash -l {0}
4851

4952
# environmental variables used in coverage
5053
env:
@@ -76,12 +79,10 @@ jobs:
7679

7780
# Install GMT and other required dependencies from conda-forge
7881
- name: Install dependencies
79-
shell: bash -l {0}
8082
run: conda env update --file environment.yml
8183

8284
# Show installed pkg information for postmortem diagnostic
8385
- name: List installed packages
84-
shell: bash -l {0}
8586
run: conda list
8687

8788
# Download cached remote files (artifacts) from GitHub
@@ -95,7 +96,6 @@ jobs:
9596

9697
# Move downloaded files to ~/.gmt directory and list them
9798
- name: Move and list downloaded remote files
98-
shell: bash -l {0}
9999
run: |
100100
mkdir -p ~/.gmt
101101
mv .gmt/* ~/.gmt
@@ -105,21 +105,18 @@ jobs:
105105
106106
# Install the package that we want to test
107107
- name: Install the package
108-
shell: bash -l {0}
109108
run: |
110109
python setup.py sdist --formats=zip
111110
pip install dist/*
112111
113112
# Install data version control (dvc) and pull data from dvc remote
114113
- name: Install dvc and pull data from dvc remote
115-
shell: bash -l {0}
116114
run: |
117115
pip install dvc
118116
dvc pull
119117
120118
# Run the tests
121119
- name: Test with pytest
122-
shell: bash -l {0}
123120
run: make test PYTEST_EXTRA="-r P"
124121

125122
# Upload diff images on test failure
@@ -132,7 +129,6 @@ jobs:
132129

133130
# Build the documentation
134131
- name: Build the documentation
135-
shell: bash -l {0}
136132
run: make -C doc clean all
137133

138134
# Upload coverage to Codecov

.github/workflows/ci_tests_dev.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ jobs:
106106

107107
# Move downloaded files to ~/.gmt directory and list them
108108
- name: Move and list downloaded remote files
109-
shell: bash -l {0}
110109
run: |
111110
mkdir -p ~/.gmt
112111
mv .gmt/* ~/.gmt

doc/conf.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# isort: off
1010
from sphinx_gallery.sorting import ( # pylint: disable=no-name-in-module
1111
ExplicitOrder,
12-
FileNameSortKey,
12+
ExampleTitleSortKey,
1313
)
1414
from pygmt import __commit__, __version__
1515
from pygmt.sphinx_gallery import PyGMTScraper
@@ -71,10 +71,13 @@
7171
"gallery_dirs": ["gallery", "tutorials", "projections"],
7272
"subsection_order": ExplicitOrder(
7373
[
74-
"../examples/gallery/line",
75-
"../examples/gallery/coast",
76-
"../examples/gallery/plot",
77-
"../examples/gallery/grid",
74+
"../examples/gallery/maps",
75+
"../examples/gallery/lines",
76+
"../examples/gallery/symbols",
77+
"../examples/gallery/images",
78+
"../examples/gallery/3d_plots",
79+
"../examples/gallery/seismology",
80+
"../examples/gallery/embellishments",
7881
"../examples/projections/azim",
7982
"../examples/projections/conic",
8083
"../examples/projections/cyl",
@@ -88,7 +91,7 @@
8891
# Remove the "Download all examples" button from the top level gallery
8992
"download_all_examples": False,
9093
# Sort gallery example by file name instead of number of lines (default)
91-
"within_subsection_order": FileNameSortKey,
94+
"within_subsection_order": ExampleTitleSortKey,
9295
# directory where function granular galleries are stored
9396
"backreferences_dir": "api/generated/backreferences",
9497
# Modules for which function level galleries are created. In

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
tutorials/contour-map.rst
3939
tutorials/earth-relief.rst
4040
tutorials/3d-perspective-image.rst
41-
tutorials/inset.rst
41+
tutorials/insets.rst
4242
tutorials/subplots.rst
4343
tutorials/configuration.rst
4444

doc/install.rst

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ To activate the virtual environment, you can do::
2929
conda activate pygmt
3030

3131
After this, check that everything works by running the following in a Python
32-
interpreter (e.g. in a Jupyter notebook)::
32+
interpreter (e.g., in a Jupyter notebook)::
3333

3434
import pygmt
3535
pygmt.show_versions()
@@ -40,8 +40,8 @@ Start by looking at the tutorials on our sidebar, good luck!
4040
.. note::
4141

4242
The sections below provide more detailed, step by step instructions to
43-
installing and testing PyGMT for those who may have a slightly different
44-
setup.
43+
install and test PyGMT for those who may have a slightly different setup or
44+
want to install the latest development version.
4545

4646
Which Python?
4747
-------------
@@ -51,9 +51,10 @@ work, but there is no guarantee that PyGMT will behave as expected.
5151

5252
We recommend using the `Anaconda <https://www.anaconda.com/distribution>`__
5353
Python distribution to ensure you have all dependencies installed and the
54-
``conda`` package manager available.
55-
Installing Anaconda does not require administrative rights to your computer and
56-
doesn't interfere with any other Python installations in your system.
54+
`conda <https://docs.conda.io/projects/conda/en/latest/>`__
55+
package manager is available. Installing Anaconda does not require administrative
56+
rights to your computer and doesn't interfere with any other Python
57+
installations on your system.
5758

5859

5960
Which GMT?
@@ -110,14 +111,14 @@ Now we can create a new conda environment with Python and all our dependencies
110111
installed (we'll call it ``pygmt`` but feel free to change it to whatever you
111112
want)::
112113

113-
conda create --name pygmt python=3.9 pip numpy pandas xarray netcdf4 packaging gmt
114+
conda create --name pygmt python=3.9 numpy pandas xarray netcdf4 packaging gmt
114115

115116
Activate the environment by running the following (**do not forget this step!**)::
116117

117118
conda activate pygmt
118119

119120
From now on, all commands will take place inside the conda virtual environment
120-
called 'pygmt' and won't affect your default 'base' installation.
121+
called ``pygmt`` and won't affect your default ``base`` installation.
121122

122123

123124
Installing PyGMT
@@ -134,6 +135,10 @@ This installs the latest stable release of PyGMT from
134135

135136
conda install pygmt
136137

138+
This upgrades the installed PyGMT version to be the latest stable release::
139+
140+
conda update pygmt
141+
137142
Using pip
138143
~~~~~~~~~
139144

@@ -147,13 +152,11 @@ Alternatively, you can install the latest development version from
147152

148153
pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pygmt
149154

150-
or from PyGMT's `GitHub repository <https://github.com/GenericMappingTools/pygmt>`__
151-
(slower as it downloads the whole archive)::
152-
153-
pip install git+https://github.com/GenericMappingTools/pygmt.git#egg=pygmt
155+
To upgrade the installed stable release or development version to be the latest
156+
one, just add ``--upgrade`` to the corresponding command above.
154157

155-
Any of the above methods (conda/pip) should allow you to use the ``pygmt``
156-
library from Python.
158+
Any of the above methods (conda/pip) should allow you to use the PyGMT package
159+
from Python.
157160

158161

159162
Testing your install
@@ -182,7 +185,8 @@ dependencies as well (be sure to have your conda environment activated)::
182185

183186
conda install pytest pytest-mpl ipython
184187

185-
Test your installation by running the following inside a Python interpreter::
188+
Test your installation by running the following inside a Python interpreter
189+
(note that it may take a few minutes)::
186190

187191
import pygmt
188192
pygmt.show_versions()
@@ -193,14 +197,14 @@ Finding the GMT shared library
193197
------------------------------
194198

195199
Sometimes, PyGMT will be unable to find the correct version of the GMT shared
196-
library.
200+
library (``libgmt``).
197201
This can happen if you have multiple versions of GMT installed.
198202

199203
You can tell PyGMT exactly where to look for ``libgmt`` by setting the
200204
``GMT_LIBRARY_PATH`` environment variable.
201205
This should be set to the directory where ``libgmt.so``, ``libgmt.dylib`` or
202-
``gmt.dll`` can be found for Linux, macOS and Windows respectively.
203-
e.g. on a command line, run::
206+
``gmt.dll`` can be found for Linux, macOS and Windows, respectively.
207+
e.g., on a command line, run::
204208

205209
# Linux/macOS
206210
export GMT_LIBRARY_PATH=$HOME/anaconda3/envs/pygmt/lib

examples/gallery/3d_plots/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
3D Plots
2+
--------

examples/gallery/coast/README.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Plot embellishments
2+
-------------------

examples/gallery/grid/README.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/gallery/images/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Images, contours, and fields
2+
----------------------------
File renamed without changes.

examples/gallery/line/README.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/gallery/lines/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Lines and vectors
2+
-----------------

examples/gallery/line/vector-heads-tails.py renamed to examples/gallery/lines/vector_heads_tails.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
In the following we use the :meth:`pygmt.Figure.plot` method to plot vectors
2727
with individual heads and tails. We must specify the modifiers (together with
2828
the vector type, here ``v``, see also
29-
:doc:`Vector types documentation </gallery/line/vectors>`)
29+
:doc:`Vector types documentation </gallery/lines/vectors>`)
3030
by passing the corresponding shortcuts to the ``style`` parameter.
3131
3232
"""

examples/gallery/line/vectors.py renamed to examples/gallery/lines/vectors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The :meth:`pygmt.Figure.plot` method can plot Cartesian, circular, and geographic vectors.
66
The ``style`` parameter controls vector attributes. See also
7-
:doc:`Vector attributes documentation </gallery/line/vector-heads-tails>`.
7+
:doc:`Vector attributes documentation </gallery/lines/vector_heads_tails>`.
88
99
"""
1010
import numpy as np

examples/gallery/maps/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Maps and map elements
2+
---------------------
File renamed without changes.

examples/gallery/plot/README.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Seismology and geodesy
2+
----------------------
File renamed without changes.

examples/gallery/symbols/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Symbols and markers
2+
-------------------
File renamed without changes.
File renamed without changes.

examples/tutorials/lines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
# example below, the line width is set to ``7p``, the color is set to ``green``, and the
126126
# line style is ``-.-`` (*dash dot dash*).
127127
#
128-
# For a gallery showing other ``pen`` settings, see :doc:`/gallery/line/linestyles`.
128+
# For a gallery showing other ``pen`` settings, see :doc:`/gallery/lines/linestyles`.
129129

130130
fig = pygmt.Figure()
131131
fig.plot(

0 commit comments

Comments
 (0)