Skip to content

Commit e24a6c2

Browse files
committed
Merge branch 'main' into uv/resolution-lowest
2 parents 4733bda + 9b53043 commit e24a6c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+565
-334
lines changed

.github/ISSUE_TEMPLATE/1-bug_report.yaml

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
name: Bug report
2-
description: Report a problem/bug to help us improve
2+
description: Report a problem/bug to help us improve.
33
labels: bug
44
body:
55
- type: markdown
66
attributes:
7-
value: |
7+
value: >
88
Thanks for taking the time to fill out this bug report!
99
- type: textarea
1010
attributes:
1111
label: "Description of the problem"
12-
description: |
12+
description: >
1313
Please be as detailed as you can when describing an issue.
1414
The more information we have, the easier it will be for us to track this down.
1515
validations:
1616
required: true
1717
- type: textarea
1818
attributes:
1919
label: "Minimal Complete Verifiable Example"
20-
description: |
20+
description: >
2121
So that we can understand and fix the issue quickly and efficiently, please provide
2222
a minimal, self-contained copy-pastable example that demonstrates the issue.
23+
2324
For more details, check out:
2425
2526
- [Minimal Complete Verifiable Examples](https://stackoverflow.com/help/mcve)
27+
2628
- [Craft Minimal Bug Reports](https://matthewrocklin.com/minimal-bug-reports)
2729
2830
placeholder: "PASTE CODE HERE"
@@ -40,9 +42,11 @@ body:
4042
- type: textarea
4143
attributes:
4244
label: "System information"
43-
description: |
44-
Please paste the output of `python -c "import pygmt; pygmt.show_versions()"`
45-
If this command is not successful, please describe your operating system, how you installed PyGMT, how you installed GMT, and paste the full error message.
45+
description: >
46+
Please paste the output of `python -c "import pygmt; pygmt.show_versions()"`.
47+
48+
If this command is not successful, please describe your operating system,
49+
how you installed PyGMT, how you installed GMT, and paste the full error message.
4650
placeholder: "PASTE THE OUTPUT HERE"
4751
render: bash
4852
validations:

.github/ISSUE_TEMPLATE/2-feature_request.yaml

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ body:
55
- type: textarea
66
attributes:
77
label: "Description of the desired feature"
8-
description: |
9-
Please be as detailed as you can in your description.
10-
If possible, include an example of how you would like to use this feature (even better if it's a code example).
8+
description: >
9+
Please be as detailed as you can in your description. If possible, include
10+
an example of how you would like to use this feature (even better if it's a code example).
1111
- type: dropdown
1212
id: help
1313
attributes:
1414
label: Are you willing to help implement and maintain this feature?
15-
description: |
16-
Every feature we add is code that we will have to maintain and keep updated. This takes a lot of effort.
17-
If you are willing to be involved in the project and help maintain your feature, it will make it easier for us to accept it.
15+
description: >
16+
Every feature we add is code that we will have to maintain and keep updated.
17+
This takes a lot of effort. If you are willing to be involved in the project and
18+
help maintain your feature, it will make it easier for us to accept it.
1819
options:
1920
- "No"
2021
- "Yes"

.github/ISSUE_TEMPLATE/3-module_request.yaml

+16-9
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,29 @@ labels: ["feature request"]
55
body:
66
- type: markdown
77
attributes:
8-
value: |
9-
Please replace `<module-name>` in the issue title and the description with the name of the requested module and add the description of the module.
8+
value: >
9+
Please replace `<module-name>` in the issue title and the description with the
10+
name of the requested module and add the description of the module.
1011
- type: textarea
1112
id: which-module
1213
attributes:
1314
label: Description of the desired module
14-
description: Please be as detailed as you can in your description. If possible, include an example of how you would like to use this feature (even better if it's a code example).
15-
placeholder: Implement [`<module-name>`](https://docs.generic-mapping-tools.org/latest/<module-name>.html) which `<insert description of the GMT module>`.
15+
description: >
16+
Please be as detailed as you can in your description. If possible, include
17+
an example of how you would like to use this feature (even better if it's a code example).
18+
placeholder: >
19+
Implement [`<module-name>`](https://docs.generic-mapping-tools.org/latest/<module-name>.html)
20+
which `<insert description of the GMT module>`.
1621
validations:
1722
required: true
1823
- type: dropdown
1924
id: help
2025
attributes:
2126
label: Are you willing to help implement and maintain this feature?
22-
description: |
23-
Every feature we add is code that we will have to maintain and keep updated. This takes a lot of effort.
24-
If you are willing to be involved in the project and help maintain your feature, it will make it easier for us to accept it.
27+
description: >
28+
Every feature we add is code that we will have to maintain and keep updated.
29+
This takes a lot of effort. If you are willing to be involved in the project and
30+
help maintain your feature, it will make it easier for us to accept it.
2531
options:
2632
- "No"
2733
- "Yes"
@@ -30,5 +36,6 @@ body:
3036
required: true
3137
- type: markdown
3238
attributes:
33-
value: |
34-
Progress on wrapping the module will be tracked in the [project board](https://github.com/GenericMappingTools/pygmt/projects/9).
39+
value: >
40+
Progress on wrapping the module will be tracked in the
41+
[project board](https://github.com/orgs/GenericMappingTools/projects/3).

.github/workflows/benchmarks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
# Install Micromamba with conda-forge dependencies
4747
- name: Setup Micromamba
48-
uses: mamba-org/[email protected].1
48+
uses: mamba-org/[email protected].2
4949
with:
5050
environment-name: pygmt
5151
condarc: |

.github/workflows/cache_data.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343

4444
# Install Micromamba with conda-forge dependencies
4545
- name: Setup Micromamba
46-
uses: mamba-org/[email protected].1
46+
uses: mamba-org/[email protected].2
4747
with:
4848
environment-name: pygmt
4949
condarc: |

.github/workflows/ci_docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080

8181
# Install Micromamba with conda-forge dependencies
8282
- name: Setup Micromamba
83-
uses: mamba-org/[email protected].1
83+
uses: mamba-org/[email protected].2
8484
with:
8585
environment-name: pygmt
8686
condarc: |

.github/workflows/ci_doctests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
# Install Micromamba with conda-forge dependencies
4444
- name: Setup Micromamba
45-
uses: mamba-org/[email protected].1
45+
uses: mamba-org/[email protected].2
4646
with:
4747
environment-name: pygmt
4848
condarc: |

.github/workflows/ci_tests.yaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113

114114
# Install Micromamba with conda-forge dependencies
115115
- name: Setup Micromamba
116-
uses: mamba-org/[email protected].1
116+
uses: mamba-org/[email protected].2
117117
with:
118118
environment-name: pygmt
119119
condarc: |
@@ -142,7 +142,6 @@ jobs:
142142
pytest-doctestplus
143143
pytest-mpl
144144
pytest-rerunfailures
145-
pytest-xdist
146145
147146
# Download cached remote files (artifacts) from GitHub
148147
- name: Download remote data from GitHub
@@ -165,7 +164,7 @@ jobs:
165164

166165
# Run the regular tests
167166
- name: Run tests
168-
run: make test PYTEST_EXTRA="-r P -n auto --reruns 2"
167+
run: make test PYTEST_EXTRA="-r P --reruns 2"
169168

170169
# Upload diff images on test failure
171170
- name: Upload diff images if any test fails
@@ -177,7 +176,7 @@ jobs:
177176

178177
# Upload coverage to Codecov
179178
- name: Upload coverage to Codecov
180-
uses: codecov/[email protected].3
179+
uses: codecov/[email protected].7
181180
if: success() || failure()
182181
with:
183182
use_oidc: true

.github/workflows/ci_tests_dev.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757

5858
# Install Micromamba with conda-forge dependencies
5959
- name: Setup Micromamba
60-
uses: mamba-org/[email protected].1
60+
uses: mamba-org/[email protected].2
6161
with:
6262
environment-name: pygmt
6363
condarc: |
@@ -153,7 +153,7 @@ jobs:
153153
--extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
154154
numpy pandas xarray netCDF4 packaging \
155155
build contextily dvc geopandas ipython pyarrow rioxarray \
156-
pytest pytest-cov pytest-doctestplus pytest-mpl pytest-rerunfailures pytest-xdist\
156+
pytest pytest-cov pytest-doctestplus pytest-mpl pytest-rerunfailures \
157157
sphinx-gallery
158158
159159
# Show installed pkg information for postmortem diagnostic
@@ -181,7 +181,7 @@ jobs:
181181

182182
# Run the tests
183183
- name: Test with pytest
184-
run: make test PYTEST_EXTRA="-r P -n auto --reruns 2"
184+
run: make test PYTEST_EXTRA="-r P --reruns 2"
185185
env:
186186
GMT_LIBRARY_PATH: ${{ runner.temp }}/gmt-install-dir/lib
187187

.github/workflows/ci_tests_legacy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151

5252
# Install Micromamba with conda-forge dependencies
5353
- name: Setup Micromamba
54-
uses: mamba-org/[email protected].1
54+
uses: mamba-org/[email protected].2
5555
with:
5656
environment-name: pygmt
5757
condarc: |

doc/Makefile

+2-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,5 @@ server:
5555
clean:
5656
rm -rf $(BUILDDIR)
5757
rm -rf api/generated
58-
rm -rf intro
59-
rm -rf tutorials
60-
rm -rf gallery
61-
rm -rf projections
58+
rm -rf intro tutorials gallery projections
59+
rm -rf sg_execution_times.rst

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies:
2727
# Dev dependencies (style checks)
2828
- codespell
2929
- pre-commit
30-
- ruff>=0.3.0
30+
- ruff>=0.8.0
3131
# Dev dependencies (unit testing)
3232
- matplotlib-base
3333
- pytest>=6.0

examples/gallery/histograms/scatter_and_histograms.py

+42-37
Original file line numberDiff line numberDiff line change
@@ -2,70 +2,75 @@
22
Scatter plot with histograms
33
============================
44
5-
To create a scatter plot with histograms at the sides of the plot one
6-
can use :meth:`pygmt.Figure.plot` in combination with
7-
:meth:`pygmt.Figure.histogram`. The positions of the histograms are plotted
8-
by offsetting them from the main scatter plot figure using
9-
:meth:`pygmt.Figure.shift_origin`.
5+
To create a scatter plot with histograms at the sides of the plot one can use
6+
:meth:`pygmt.Figure.plot` in combination with :meth:`pygmt.Figure.histogram`. The
7+
positions of the histograms are plotted by offsetting them from the main scatter plot
8+
using :meth:`pygmt.Figure.shift_origin`.
109
"""
1110

1211
# %%
1312
import numpy as np
1413
import pygmt
1514

16-
# Generate random data from a standard normal distribution centered on 0
17-
# with a standard deviation of 1
18-
rng = np.random.default_rng(seed=19680801)
15+
# Generate random x, y coordinates from a standard normal distribution.
16+
# x values are centered on 0 with a standard deviation of 1, and y values are centered
17+
# on 30 with a standard deviation of 2.
18+
rng = np.random.default_rng()
1919
x = rng.normal(loc=0, scale=1, size=1000)
20-
y = rng.normal(loc=0, scale=1, size=1000)
20+
y = rng.normal(loc=30, scale=2, size=1000)
2121

22-
# Get axis limits
23-
xymax = max(np.max(np.abs(x)), np.max(np.abs(y)))
22+
# Get axis limits from the data limits. Extend the limits by 0.5 to add some margin.
23+
xmin = np.floor(x.min()) - 0.5
24+
xmax = np.ceil(x.max()) + 0.5
25+
ymin = np.floor(y.min()) - 0.5
26+
ymax = np.ceil(y.max()) + 0.5
2427

28+
# Set fill color for symbols and bars.
29+
fill = "seagreen"
30+
31+
# Set the dimensions of the scatter plot.
32+
width, height = 10, 8
2533

2634
fig = pygmt.Figure()
2735
fig.basemap(
28-
region=[-xymax - 0.5, xymax + 0.5, -xymax - 0.5, xymax + 0.5],
29-
projection="X10c/10c",
30-
frame=["WSrt", "a1"],
36+
region=[xmin, xmax, ymin, ymax],
37+
projection=f"X{width}/{height}",
38+
frame=["WSrt", "af"],
3139
)
3240

33-
fillcol = "seagreen"
34-
35-
# Plot data points as circles with a diameter of 0.15 centimeters
36-
fig.plot(x=x, y=y, style="c0.15c", fill=fillcol, transparency=50)
41+
# Plot data points as circles with a diameter of 0.15 centimeters and set transparency
42+
# level for all circles to deal with overplotting.
43+
fig.plot(x=x, y=y, style="c0.15c", fill=fill, transparency=50)
3744

38-
# Shift the plot origin and add top margin histogram
39-
fig.shift_origin(yshift="10.25c")
45+
# Shift the plot origin and add top margin histogram.
46+
fig.shift_origin(yshift=height + 0.25)
4047

4148
fig.histogram(
42-
projection="X10c/2c",
43-
frame=["Wsrt", "xf1", "y+lCounts"],
44-
# Give the same value for ymin and ymax to have ymin and ymax
45-
# calculated automatically
46-
region=[-xymax - 0.5, xymax + 0.5, 0, 0],
49+
projection=f"X{width}/3",
50+
frame=["Wsrt", "xf", "yaf+lCounts"],
51+
# Give the same value for ymin and ymax to have them calculated automatically.
52+
region=[xmin, xmax, 0, 0],
4753
data=x,
48-
fill=fillcol,
54+
fill=fill,
4955
pen="0.1p,white",
5056
histtype=0,
51-
series=0.1,
57+
series=0.2,
5258
)
5359

54-
# Shift the plot origin and add right margin histogram
55-
fig.shift_origin(yshift="-10.25c", xshift="10.25c")
60+
# Shift the plot origin and add right margin histogram.
61+
fig.shift_origin(yshift=-height - 0.25, xshift=width + 0.25)
5662

63+
# Plot the horizontal histogram.
5764
fig.histogram(
5865
horizontal=True,
59-
projection="X2c/10c",
60-
# Note that the y-axis annotation "Counts" is shown in x-axis direction
61-
# due to the rotation caused by horizontal=True
62-
frame=["wSrt", "xf1", "y+lCounts"],
63-
region=[-xymax - 0.5, xymax + 0.5, 0, 0],
66+
projection=f"X3/{height}",
67+
# Note that the x- and y-axis are flipped, with the y-axis plotted horizontally.
68+
frame=["wSrt", "xf", "yaf+lCounts"],
69+
region=[ymin, ymax, 0, 0],
6470
data=y,
65-
fill=fillcol,
71+
fill=fill,
6672
pen="0.1p,white",
6773
histtype=0,
68-
series=0.1,
74+
series=0.2,
6975
)
70-
7176
fig.show()

examples/gallery/images/cross_section.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
# Add a colorbar for the elevation
3939
fig.colorbar(
40-
# Place the colorbar inside the plot (lower-case "j") in the Botton Right (BR)
40+
# Place the colorbar inside the plot (lower-case "j") in the Bottom Right (BR)
4141
# corner with an offset ("+o") of 0.7 centimeters and 0.3 centimeters in x or y
4242
# directions, respectively; move the x label above the horizontal colorbar ("+ml")
4343
position="jBR+o0.7c/0.8c+h+w5c/0.3c+ml",

examples/tutorials/advanced/cartesian_histograms.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@
7979
fill="red3",
8080
pen="1p,darkgray,solid",
8181
histtype=0,
82-
# Use horizontal bars
83-
# Please note the flip of the x and y axes regarding annotations, ticks, gridlines,
84-
# and labels
82+
# Use horizontal bars. Note that the x- and y-axis are flipped, with the x-axis
83+
# plotted vertically and the y-axis plotted horizontally.
8584
horizontal=True,
8685
)
8786

@@ -134,7 +133,7 @@
134133
# ----------------------------
135134
#
136135
# By default, a histogram showing the counts in each bin is created (``histtype=0``).
137-
# To show the frequency percent set the ``histtpye`` parameter to ``1``. For further
136+
# To show the frequency percent set the ``histtype`` parameter to ``1``. For further
138137
# options please have a look at the documentation of :meth:`pygmt.Figure.histogram`.
139138

140139
fig = pygmt.Figure()

0 commit comments

Comments
 (0)