Skip to content

Commit 3b751c1

Browse files
authored
Merge branch 'main' into refactor-meca
2 parents bc70e2e + f605b68 commit 3b751c1

File tree

8 files changed

+131
-19
lines changed

8 files changed

+131
-19
lines changed

.github/workflows/ci_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080

8181
# Download cached remote files (artifacts) from GitHub
8282
- name: Download remote data from GitHub
83-
uses: dawidd6/action-download-artifact@v2.20.0
83+
uses: dawidd6/action-download-artifact@v2.21.0
8484
with:
8585
workflow: cache_data.yaml
8686
workflow_conclusion: success

.github/workflows/ci_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105

106106
# Download cached remote files (artifacts) from GitHub
107107
- name: Download remote data from GitHub
108-
uses: dawidd6/action-download-artifact@v2.20.0
108+
uses: dawidd6/action-download-artifact@v2.21.0
109109
with:
110110
workflow: cache_data.yaml
111111
workflow_conclusion: success

.github/workflows/ci_tests_dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137

138138
# Download cached remote files (artifacts) from GitHub
139139
- name: Download remote data from GitHub
140-
uses: dawidd6/action-download-artifact@v2.20.0
140+
uses: dawidd6/action-download-artifact@v2.21.0
141141
with:
142142
workflow: cache_data.yaml
143143
workflow_conclusion: success

doc/external_resources.md

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,91 @@ to submit a pull request with your recommended addition to the
1010

1111
## Tutorials
1212

13-
- [2022 EGU SC5.2: Crafting beautiful maps with PyGMT](https://github.com/GenericMappingTools/egu22pygmt) by Wei Ji Leong, Leonardo Uieda, Max Jones, Andre Belem
14-
- [2021 PyGMT course at the UAF Geophysical Institute](https://github.com/liamtoney/gi-pygmt-2021) by Liam Toney
15-
- [2021 Remote Online Sessions for Emerging Seismologists (ROSES): Unit 5 - Mapping](https://www.youtube.com/watch?v=Zvcy7VDuhiw) by Liam Toney
16-
- [2020 Remote Online Sessions for Emerging Seismologists (ROSES): Unit 8 - PyGMT](https://www.iris.edu/hq/inclass/lesson/728) by Liam Toney
17-
- [PyGMT Tutorial in 2021](https://github.com/MIGG-NTU/PyGMT2021) by MIGG-NTU
18-
- [PyGMT Workshop at FOSS4G Oceania 2019](https://github.com/GenericMappingTools/foss4g2019oceania) by Wei Ji Leong
13+
:::::{grid} 1 2 2 3
14+
15+
::::{grid-item-card} 2022 EGU SC5.2: Crafting beautiful maps with PyGMT
16+
:link: https://www.generic-mapping-tools.org/egu22pygmt/
17+
:text-align: center
18+
:margin: 0 3 0 0
19+
20+
![](https://user-images.githubusercontent.com/3974108/171653272-efaceeb1-a253-44a1-bddc-36bc9498c19b.png)
21+
+++
22+
Wei Ji Leong, Leonardo Uieda, Max Jones, Andre Belem
23+
::::
24+
25+
::::{grid-item-card} 2021 PyGMT course at the UAF Geophysical Institute
26+
:link: https://github.com/liamtoney/gi-pygmt-2021
27+
:text-align: center
28+
:margin: 0 3 0 0
29+
30+
![](https://user-images.githubusercontent.com/3974108/172042115-3f700c16-0f78-49d3-9e8d-87c77e4c0444.png)
31+
+++
32+
Liam Toney
33+
::::
34+
35+
::::{grid-item-card} 2021 Remote Online Sessions for Emerging Seismologists (ROSES): Unit 5 - Mapping
36+
:link: https://www.youtube.com/watch?v=Zvcy7VDuhiw
37+
:text-align: center
38+
:margin: 0 3 0 0
39+
40+
![](https://user-images.githubusercontent.com/3974108/172055872-b81057b6-aef3-473f-8f42-1cc82a68d188.jpg)
41+
+++
42+
Liam Toney
43+
::::
44+
45+
::::{grid-item-card} 2020 Remote Online Sessions for Emerging Seismologists (ROSES): Unit 8 - PyGMT
46+
:link: https://www.iris.edu/hq/inclass/lesson/728
47+
:text-align: center
48+
:margin: 0 3 0 0
49+
50+
![](https://user-images.githubusercontent.com/3974108/172055922-8df68c00-4115-42f4-83ae-13a971fef846.png)
51+
+++
52+
Liam Toney
53+
::::
54+
55+
::::{grid-item-card} PyGMT Tutorial in 2021
56+
:link: https://github.com/MIGG-NTU/PyGMT2021
57+
:text-align: center
58+
:margin: 0 3 0 0
59+
60+
![](https://user-images.githubusercontent.com/23487320/172058757-9b68f7ae-7a3f-4f48-9df6-9a065d6cd448.png)
61+
+++
62+
MIGG-NTU
63+
::::
64+
65+
::::{grid-item-card} PyGMT Workshop at FOSS4G Oceania 2019
66+
:link: https://github.com/GenericMappingTools/foss4g2019oceania
67+
:text-align: center
68+
:margin: 0 3 0 0
69+
70+
![](https://github.com/GenericMappingTools/foss4g2019oceania/releases/download/v1/picton_3d_dsm_view.png)
71+
+++
72+
Wei Ji Leong
73+
::::
74+
:::::
1975

2076
## Examples from Publications and Posters
2177

22-
- [GMT and PyGMT plotting examples](https://github.com/michaelgrund/GMT-plotting) by Michael Grund
23-
- [NZ Antarctic Science Conference 2021 poster](https://github.com/weiji14/nzasc2021) by Wei Ji Leong
78+
:::::{grid} 1 2 2 3
79+
80+
::::{grid-item-card} GMT and PyGMT plotting examples
81+
:link: https://github.com/michaelgrund/GMT-plotting
82+
:text-align: center
83+
:margin: 0 3 0 0
84+
85+
![](https://user-images.githubusercontent.com/3974108/172055991-c0646f6c-d130-474f-b46a-5587483998cb.jpg)
86+
+++
87+
Michael Grund
88+
::::
89+
90+
::::{grid-item-card} NZ Antarctic Science Conference 2021 poster
91+
:link: https://github.com/weiji14/nzasc2021
92+
:text-align: center
93+
:margin: 0 3 0 0
94+
95+
![](https://user-images.githubusercontent.com/23487320/107176140-6aa4e580-6a33-11eb-8f30-1a7913788d6c.png)
96+
+++
97+
Wei Ji Leong
98+
::::
99+
100+
:::::

doc/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ This installs the latest stable release from
137137
Alternatively, you can install the latest development version from
138138
`TestPyPI <https://test.pypi.org/project/pygmt>`__::
139139

140-
pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pygmt
140+
pip install --pre --extra-index-url https://test.pypi.org/simple/ pygmt
141141

142142
To upgrade the installed stable release or development version to be the latest
143143
one, just add ``--upgrade`` to the corresponding command above.

examples/gallery/3d_plots/scatter3d.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,20 @@
1717
import pandas as pd
1818
import pygmt
1919

20-
# Load sample iris data and convert 'species' column to categorical dtype
20+
# Load sample iris data
2121
df = pd.read_csv("https://github.com/mwaskom/seaborn-data/raw/master/iris.csv")
22+
# Convert 'species' column to categorical dtype
23+
# By default, pandas sorts the individual categories in an alphabetical order.
24+
# For a non-alphabetical order, you have to manually adjust the list of
25+
# categories. For handling and manipulating categorical data in pandas,
26+
# have a look at:
27+
# https://pandas.pydata.org/docs/user_guide/categorical.html
2228
df.species = df.species.astype(dtype="category")
29+
# Make a list of the individual categories of the 'species' column
30+
# ['setosa', 'versicolor', 'virginica']
31+
# They are (corresponding to the categorical number code) by default in
32+
# alphabetical order and later used for the colorbar labels
33+
labels = list(df.species.cat.categories)
2334

2435
# Use pygmt.info to get region bounds (xmin, xmax, ymin, ymax, zmin, zmax)
2536
# The below example will return a numpy array [0.0, 3.0, 4.0, 8.0, 1.0, 7.0]
@@ -35,12 +46,18 @@
3546
fig = pygmt.Figure()
3647

3748
# Define a colormap to be used for three categories, define the range of the
38-
# new discrete CPT using series=(lowest_value, highest_value, interval), use
39-
# color_model="+cSetosa,Versicolor,Virginica" to write the discrete color
49+
# new discrete CPT using series=(lowest_value, highest_value, interval),
50+
# use color_model="+csetosa,versicolor,virginica" to write the discrete color
4051
# palette "cubhelix" in categorical format and add the species names as
4152
# annotations for the colorbar
4253
pygmt.makecpt(
43-
cmap="cubhelix", color_model="+cSetosa,Versicolor,Virginica", series=(0, 2, 1)
54+
cmap="cubhelix",
55+
# Use the minimum and maximum of the categorical number code
56+
# to set the lowest_value and the highest_value of the CPT
57+
series=(df.species.cat.codes.min(), df.species.cat.codes.max(), 1),
58+
# convert ['setosa', 'versicolor', 'virginica'] to
59+
# 'setosa,versicolor,virginica'
60+
color_model="+c" + ",".join(labels),
4461
)
4562

4663
fig.plot3d(

examples/gallery/symbols/points_categorical.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,20 @@
1414
import pandas as pd
1515
import pygmt
1616

17-
# Load sample penguins data and convert 'species' column to categorical dtype
17+
# Load sample penguins data
1818
df = pd.read_csv("https://github.com/mwaskom/seaborn-data/raw/master/penguins.csv")
19+
# Convert 'species' column to categorical dtype
20+
# By default, pandas sorts the individual categories in an alphabetical order.
21+
# For a non-alphabetical order, you have to manually adjust the list of
22+
# categories. For handling and manipulating categorical data in pandas,
23+
# have a look at:
24+
# https://pandas.pydata.org/docs/user_guide/categorical.html
1925
df.species = df.species.astype(dtype="category")
26+
# Make a list of the individual categories of the 'species' column
27+
# ['Adelie', 'Chinstrap', 'Gentoo']
28+
# They are (corresponding to the categorical number code) by default in
29+
# alphabetical order and later used for the colorbar labels
30+
labels = list(df.species.cat.categories)
2031

2132
# Use pygmt.info to get region bounds (xmin, xmax, ymin, ymax)
2233
# The below example will return a numpy array like [30.0, 60.0, 12.0, 22.0]
@@ -48,7 +59,14 @@
4859
# use color_model="+cAdelie,Chinstrap,Gentoo" to write the discrete color
4960
# palette "inferno" in categorical format and add the species names as
5061
# annotations for the colorbar
51-
pygmt.makecpt(cmap="inferno", series=(0, 2, 1), color_model="+cAdelie,Chinstrap,Gentoo")
62+
pygmt.makecpt(
63+
cmap="inferno",
64+
# Use the minimum and maximum of the categorical number code
65+
# to set the lowest_value and the highest_value of the CPT
66+
series=(df.species.cat.codes.min(), df.species.cat.codes.max(), 1),
67+
# convert ['Adelie', 'Chinstrap', 'Gentoo'] to 'Adelie,Chinstrap,Gentoo'
68+
color_model="+c" + ",".join(labels),
69+
)
5270

5371
fig.plot(
5472
# Use bill length and bill depth as x and y data input, respectively

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[tool.setuptools_scm]
66
local_scheme = "node-and-date"
7-
fallback_version = "unknown"
7+
fallback_version = "999.999.999+unknown"
88

99
[tool.coverage.run]
1010
omit = ["*/tests/*", "*pygmt/__init__.py"]

0 commit comments

Comments
 (0)