Skip to content

Commit a27e672

Browse files
Merge branch 'main' into inline-example/grdcut
2 parents bcbc5a9 + a67f268 commit a27e672

21 files changed

+448
-70
lines changed

.github/workflows/ci_tests.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ jobs:
4444
# - os: ubuntu-latest
4545
# python-version: 3.7
4646
# isDraft: true
47-
# Pair Python 3.8 with NumPy 1.19 and Python 3.9 with NumPy 1.21
48-
# Only install optional packages on Python 3.9/NumPy 1.21
47+
# Pair Python 3.8 with NumPy 1.19 and Python 3.9 with NumPy 1.22
48+
# Only install optional packages on Python 3.9/NumPy 1.22
4949
include:
5050
- python-version: '3.8'
5151
numpy-version: '1.19'
5252
optional-packages: ''
5353
- python-version: '3.9'
54-
numpy-version: '1.21'
54+
numpy-version: '1.22'
5555
optional-packages: 'geopandas ipython'
5656
timeout-minutes: 30
5757
defaults:
@@ -97,7 +97,7 @@ jobs:
9797
mamba install gmt=6.3.0 numpy=${{ matrix.numpy-version }} \
9898
pandas xarray netCDF4 packaging \
9999
${{ matrix.optional-packages }} \
100-
dvc make pytest>=6.0 \
100+
dvc=2.8.2 make pytest>=6.0 \
101101
pytest-cov pytest-mpl sphinx-gallery tomli
102102
103103
# Show installed pkg information for postmortem diagnostic
@@ -125,7 +125,7 @@ jobs:
125125
# Pull baseline image data from dvc remote (DAGsHub)
126126
- name: Pull baseline image data from dvc remote
127127
run: |
128-
dvc pull
128+
dvc pull --verbose
129129
ls -lhR pygmt/tests/baseline/
130130
131131
# Install the package that we want to test

.github/workflows/dvc-diff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: iterative/setup-dvc@v1.0.3
2323

2424
- name: Setup continuous machine learning (CML)
25-
uses: iterative/setup-cml@v1.1.0
25+
uses: iterative/setup-cml@v1.1.3
2626

2727
- name: Pull image data from cloud storage
2828
run: dvc pull --remote upstream

.github/workflows/publish-to-pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ jobs:
5353
ls -lh dist/
5454
5555
- name: Publish to Test PyPI
56-
uses: pypa/gh-action-pypi-publish@v1.4.2
56+
uses: pypa/gh-action-pypi-publish@v1.5.0
5757
with:
5858
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
5959
repository_url: https://test.pypi.org/legacy/
6060

6161
- name: Publish to PyPI
6262
if: startsWith(github.ref, 'refs/tags')
63-
uses: pypa/gh-action-pypi-publish@v1.4.2
63+
uses: pypa/gh-action-pypi-publish@v1.5.0
6464
with:
6565
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/release-baseline-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
shasum -a 256 baseline-images.zip
3535
3636
- name: Upload baseline image as a release asset
37-
uses: shogo82148/actions-upload-release-asset@v1.4.0
37+
uses: shogo82148/actions-upload-release-asset@v1.5.0
3838
with:
3939
upload_url: ${{ github.event.release.upload_url }}
4040
asset_path: baseline-images.zip

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
# Drafts your next Release notes as Pull Requests are merged into "main"
14-
- uses: release-drafter/release-drafter@v5.15.0
14+
- uses: release-drafter/release-drafter@v5.17.5
1515
with:
1616
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
1717
config-name: release-drafter.yml

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2017-2021 The PyGMT Developers
1+
Copyright (c) 2017-2022 The PyGMT Developers
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification,

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Related projects
196196
* `gmtmex <https://github.com/GenericMappingTools/gmtmex>`__: A Matlab/Octave wrapper
197197
for GMT.
198198

199-
Other Python wrappers for GMT:
199+
Other Python wrappers for GMT (not maintained):
200200

201201
* `gmtpy <https://github.com/emolch/gmtpy>`__ by `Sebastian Heimann <https://github.com/emolch>`__
202202
* `pygmt <https://github.com/ian-r-rose/pygmt>`__ by `Ian Rose <https://github.com/ian-r-rose>`__

doc/api/index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ Operations on tabular data
126126
surface
127127
xyz2grd
128128

129-
Operations on grids
130-
~~~~~~~~~~~~~~~~~~~
129+
Operations on raster data
130+
~~~~~~~~~~~~~~~~~~~~~~~~~
131131

132132
.. autosummary::
133133
:toctree: generated
@@ -210,8 +210,10 @@ and store them in the GMT cache folder.
210210
.. autosummary::
211211
:toctree: generated
212212

213+
datasets.list_sample_data
213214
datasets.load_earth_age
214215
datasets.load_earth_relief
216+
datasets.load_sample_data
215217
datasets.load_fractures_compilation
216218
datasets.load_hotspots
217219
datasets.load_japan_quakes
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
"""
2+
Generate points along great circles
3+
-----------------------------------
4+
5+
The :meth:`pygmt.project` method can generate points along a great circle
6+
whose center and end points can be defined via the ``center`` and ``endpoint``
7+
parameters, respectively. Using the ``generate`` parameter allows to generate
8+
(*r*, *s*, *p*) points every *dist* units of *p* along a profile as
9+
output. By default all units (*r*, *s* and *p*) are set to degrees while
10+
``unit=True`` allows to set the unit for *p* to km.
11+
"""
12+
13+
import pygmt
14+
15+
fig = pygmt.Figure()
16+
17+
# generate points every 10 degrees along a great circle from 10N,50W to 30N,5W
18+
points1 = pygmt.project(center=[-50, 10], endpoint=[-5, 30], generate=10)
19+
# generate points every 750 km along a great circle from 10N,50W to 57.5N,90W
20+
points2 = pygmt.project(center=[-50, 10], endpoint=[-90, 57.5], generate=750, unit=True)
21+
# generate points every 350 km along a great circle from 10N,50W to 68N,5W
22+
points3 = pygmt.project(center=[-50, 10], endpoint=[-5, 68], generate=350, unit=True)
23+
24+
# create a plot with coast and Mercator projection (M)
25+
fig.basemap(region=[-100, 0, 0, 70], projection="M12c", frame=True)
26+
fig.coast(shorelines=True, area_thresh=5000)
27+
28+
# plot individual points of first great circle as seagreen line
29+
fig.plot(x=points1.r, y=points1.s, pen="2p,seagreen")
30+
# plot individual points as seagreen squares atop
31+
fig.plot(x=points1.r, y=points1.s, style="s.45c", color="seagreen", pen="1p")
32+
33+
# plot individual points of second great circle as orange line
34+
fig.plot(x=points2.r, y=points2.s, pen="2p,orange")
35+
# plot individual points as orange inverted triangles atop
36+
fig.plot(x=points2.r, y=points2.s, style="i.6c", color="orange", pen="1p")
37+
38+
# plot individual points of third great circle as red line
39+
fig.plot(x=points3.r, y=points3.s, pen="2p,red3")
40+
# plot individual points as red circles atop
41+
fig.plot(x=points3.r, y=points3.s, style="c.3c", color="red3", pen="1p")
42+
43+
fig.show()

examples/get-started/first_figure.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@
121121
# annotate the latitude and longitude of the region.
122122
#
123123
# The ``frame`` parameter is used to add a frame to the figure. For now, it
124-
# will be set to ``True`` to use default settings, but later tutorials will
125-
# show how ``frame`` can be used to customize the axes, gridlines, and titles.
124+
# will be set to ``"a"`` to **a**\ nnotate the axes automatically.
126125

127126
fig = pygmt.Figure()
128127
fig.coast(
@@ -131,7 +130,34 @@
131130
land="lightgreen",
132131
water="lightblue",
133132
projection="M10c",
134-
frame=True,
133+
frame="a",
134+
)
135+
fig.show()
136+
137+
###############################################################################
138+
# Add a title
139+
# -----------
140+
#
141+
# The ``frame`` parameter can be used to add a title to the figure. The title
142+
# is set with by passing ``"+t"`` followed by the title (e.g. setting the map
143+
# title to "Title" would be ``"+tTitle"``).
144+
#
145+
# To pass multiple arguments to ``frame``, a list can be used, as shown in the
146+
# example below. This format uses ``frame`` to set both the axes gridlines and
147+
# the figure title.
148+
#
149+
# If the figure title has any spaces, the string to set the title needs to
150+
# be wrapped in single-quotes, while the actual title is set in double quotes
151+
# (e.g. setting the title to "A Title" would use the syntax ``'+t"A Title"'``.
152+
153+
fig = pygmt.Figure()
154+
fig.coast(
155+
region=[-69, -68, 43.75, 44.75],
156+
shorelines=True,
157+
land="lightgreen",
158+
water="lightblue",
159+
projection="M10c",
160+
frame=["a", "+tMaine"],
135161
)
136162
fig.show()
137163

0 commit comments

Comments
 (0)