Skip to content

Commit 543c3b8

Browse files
authored
Merge branch 'master' into test-grdimage-dvc
2 parents 291590f + 04630ff commit 543c3b8

Some content is hidden

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

57 files changed

+307
-243
lines changed

.github/workflows/cache_data.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
# Setup Miniconda
2121
- name: Setup Miniconda
22-
uses: conda-incubator/[email protected].0
22+
uses: conda-incubator/[email protected].1
2323
with:
2424
channels: conda-forge
2525
miniconda-version: "latest"

.github/workflows/ci_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656

5757
# Setup Miniconda
5858
- name: Setup Miniconda
59-
uses: conda-incubator/[email protected].0
59+
uses: conda-incubator/[email protected].1
6060
with:
6161
activate-environment: pygmt
6262
python-version: ${{ matrix.python-version }}
@@ -68,7 +68,7 @@ jobs:
6868
run: |
6969
conda install gmt=6.1.1 numpy pandas xarray netCDF4 packaging \
7070
ipython make myst-parser \
71-
sphinx sphinx-copybutton sphinx-gallery sphinx_rtd_theme=0.5.1
71+
sphinx sphinx-copybutton sphinx-gallery sphinx_rtd_theme
7272
7373
# Show installed pkg information for postmortem diagnostic
7474
- name: List installed packages

.github/workflows/ci_tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676

7777
# Setup Miniconda
7878
- name: Setup Miniconda
79-
uses: conda-incubator/[email protected].0
79+
uses: conda-incubator/[email protected].1
8080
with:
8181
activate-environment: pygmt
8282
python-version: ${{ matrix.python-version }}
@@ -140,7 +140,7 @@ jobs:
140140

141141
# Upload coverage to Codecov
142142
- name: Upload coverage to Codecov
143-
uses: codecov/[email protected].1
143+
uses: codecov/[email protected].2
144144
with:
145145
file: ./coverage.xml # optional
146146
env_vars: OS,PYTHON,NUMPY

.github/workflows/ci_tests_dev.yaml

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

7474
# Setup Miniconda
7575
- name: Setup Miniconda
76-
uses: conda-incubator/[email protected].0
76+
uses: conda-incubator/[email protected].1
7777
with:
7878
activate-environment: pygmt
7979
python-version: ${{ matrix.python-version }}

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,11 @@ When editing documentation, use the following standards to demonstrate the examp
187187
(two asterisks) on both sides. The argument description should be in *italicized*
188188
with \* (single asterisk) on both sides.
189189
Examples: `**+l**\ *label*` results in **+l***label*, `**05m**` results in **05m**.
190-
3. Optional arguments are placed wrapped with [ ] (square brackets).
190+
3. Optional arguments are wrapped with [ ] (square brackets).
191191
4. Arguments that are mutually exclusive are separated with a | (bar) to denote "or".
192+
5. Default arguments for parameters and configuration settings are wrapped
193+
with [ ] (square brackers) with the prefix "Default is". Example: [Default is
194+
**p**].
192195

193196
## Contributing Code
194197

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ exclude .gitignore
77
exclude .pylintrc
88
exclude AUTHORSHIP.md
99
exclude CONTRIBUTING.md
10-
exclude MAINTENANCE.md
1110
exclude Makefile
1211
exclude environment.yml
1312
exclude package.json

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test:
3636
@echo ""
3737
@cd $(TESTDIR); python -c "import $(PROJECT); $(PROJECT).show_versions()"
3838
@echo ""
39-
cd $(TESTDIR); pytest $(PYTEST_COV_ARGS) $(PROJECT)
39+
cd $(TESTDIR); PYGMT_USE_EXTERNAL_DISPLAY="false" pytest $(PYTEST_COV_ARGS) $(PROJECT)
4040
cp $(TESTDIR)/coverage.xml .
4141
cp -r $(TESTDIR)/htmlcov .
4242
rm -r $(TESTDIR)

doc/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ html: api
3131
@echo
3232
@echo "Building HTML files."
3333
@echo
34-
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
34+
# Set PYGMT_USE_EXTERNAL_DISPLAY to "false" to disable external display
35+
PYGMT_USE_EXTERNAL_DISPLAY="false" $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
3536
@echo
3637
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
3738

doc/_static/style.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,32 @@ p {
8989
max-width: 1000px;
9090
}
9191

92+
/* Format parameters section similar to sphinx_rtd_theme v4.x.x (not a grid) */
93+
html.writer-html5 .rst-content dl.field-list {
94+
display: initial;
95+
}
96+
97+
/* Add a grey box around parameters similar to sphinx_rtd_theme v4.x.x) */
98+
.rst-content dl:not(.docutils) dl dt {
99+
margin-bottom: 4px;
100+
border: none;
101+
border-left: solid 3px #ccc;
102+
background: #f0f0f0;
103+
color: #555;
104+
}
105+
106+
.rst-content dl:not(.docutils) dt {
107+
display: table;
108+
margin: 6px 0;
109+
font-size: 90%;
110+
line-height: normal;
111+
background: #e7f2fa;
112+
color: #2980B9;
113+
border-top: solid 3px #6ab0de;
114+
padding: 6px;
115+
position: relative;
116+
}
117+
92118
/* Remove the padding from the Parameters table */
93119
.rst-content table.field-list .field-name {
94120
padding-left: 0px;

doc/api/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ Saving and displaying the figure:
6060
Figure.show
6161
Figure.psconvert
6262

63+
Configuring the display settings:
64+
65+
.. autosummary::
66+
:toctree: generated
67+
68+
set_display
69+
6370

6471
Data Processing
6572
---------------

doc/conf.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"../examples/gallery/3d_plots",
7979
"../examples/gallery/seismology",
8080
"../examples/gallery/basemaps",
81+
"../examples/gallery/histograms",
8182
"../examples/gallery/embellishments",
8283
"../examples/projections/azim",
8384
"../examples/projections/conic",
@@ -150,7 +151,14 @@
150151
html_theme_options = {}
151152
repository = "GenericMappingTools/pygmt"
152153
repository_url = "https://github.com/GenericMappingTools/pygmt"
153-
commit_link = f'<a href="{repository_url}/commit/{ __commit__ }">{ __commit__[:8] }</a>'
154+
if __commit__:
155+
commit_link = (
156+
f'<a href="{repository_url}/commit/{ __commit__ }">{ __commit__[:8] }</a>'
157+
)
158+
else:
159+
commit_link = (
160+
f'<a href="{repository_url}/releases/tag/{ __version__ }">{ __version__ }</a>'
161+
)
154162
html_context = {
155163
"menu_links": [
156164
(

doc/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@
4949
:caption: Reference documentation
5050

5151
api/index.rst
52-
changes.rst
52+
changes.md
53+
maintenance.md

MAINTENANCE.md renamed to doc/maintenance.md

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,17 @@ This page contains instructions for project maintainers about how our setup work
44
making releases, creating packages, etc.
55

66
If you want to make a contribution to the project, see the
7-
[Contributing Guide](CONTRIBUTING.md) instead.
8-
9-
## Table of Contents
10-
* [Onboarding Access Checklist](#onboarding-access-checklist)
11-
* [Branches](#branches)
12-
* [Reviewing and Merging Pull Requests](#reviewing-and-merging-pull-requests)
13-
* [Continuous Integration](#continuous-integration)
14-
* [Continuous Documentation](#continuous-documentation)
15-
* [Dependencies Policy](#dependencies-policy)
16-
* [Making a Release](#making-a-release)
17-
- [Updating the Changelog](#updating-the-changelog)
18-
- [Check the README Syntax](#check-the-readme-syntax)
19-
- [Pushing to PyPI and Updating the Documentation](#pushing-to-pypi-and-updating-the-documentation)
20-
- [Archiving on Zenodo](#archiving-on-zenodo)
21-
- [Updating the Conda Package](#updating-the-conda-package)
7+
[Contributing Guide](https://github.com/GenericMappingTools/pygmt/blob/master/CONTRIBUTING.md)
8+
instead.
229

2310
## Onboarding Access Checklist
2411

25-
- [ ] Added to [python-maintainers](https://github.com/orgs/GenericMappingTools/teams/python-maintainers) team in the [GenericMappingTools](https://github.com/orgs/GenericMappingTools/teams/) organization on GitHub (gives 'maintain' permissions)
26-
- [ ] Added as collaborator on [DAGsHub](https://dagshub.com/GenericMappingTools/pygmt/settings/collaboration) (gives 'write' permission to dvc remote storage)
27-
- [ ] Added as moderator on [GMT forum](https://forum.generic-mapping-tools.org) (to see mod-only discussions)
28-
- [ ] Added as member on the [PyGMT devs Slack channel](https://pygmtdevs.slack.com) (for casual conversations)
29-
- [ ] Added as maintainer on [PyPI](https://pypi.org/project/pygmt/) and [Test PyPI](https://test.pypi.org/project/pygmt) [optional]
30-
- [ ] Added as member on [HackMD](https://hackmd.io/@pygmt) [optional]
12+
- Added to [python-maintainers](https://github.com/orgs/GenericMappingTools/teams/python-maintainers) team in the [GenericMappingTools](https://github.com/orgs/GenericMappingTools/teams/) organization on GitHub (gives 'maintain' permissions)
13+
- Added as collaborator on [DAGsHub](https://dagshub.com/GenericMappingTools/pygmt/settings/collaboration) (gives 'write' permission to dvc remote storage)
14+
- Added as moderator on [GMT forum](https://forum.generic-mapping-tools.org) (to see mod-only discussions)
15+
- Added as member on the [PyGMT devs Slack channel](https://pygmtdevs.slack.com) (for casual conversations)
16+
- Added as maintainer on [PyPI](https://pypi.org/project/pygmt/) and [Test PyPI](https://test.pypi.org/project/pygmt) [optional]
17+
- Added as member on [HackMD](https://hackmd.io/@pygmt) [optional]
3118

3219
## Branches
3320

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ dependencies:
3232
- sphinx
3333
- sphinx-copybutton
3434
- sphinx-gallery
35-
- sphinx_rtd_theme=0.5.1
35+
- sphinx_rtd_theme

examples/gallery/embellishments/logo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Logo
33
----
44
5-
The :meth:`pygmt.Figure.logo` method allows to place the GMT logo on a map.
5+
The :meth:`pygmt.Figure.logo` method allows to place the GMT logo on a map.
66
"""
77

88
import pygmt
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Histograms
2+
----------

examples/gallery/lines/linestyles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
99
A *pen* in GMT has three attributes: *width*, *color*, and *style*.
1010
The *style* attribute controls the appearance of the line.
11-
Giving dotted or “.” yields a dotted line, whereas a dashed pen is requested
12-
with dashed or “-”. Also combinations of dots and dashes, like “.-” for a
11+
Giving "dotted" or "." yields a dotted line, whereas a dashed pen is requested
12+
with "dashed" or "-". Also combinations of dots and dashes, like ".-" for a
1313
dot-dashed line, are allowed.
1414
1515
For more advanced *pen* attributes, see the GMT cookbook

examples/gallery/maps/borders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
* **3** = Marine boundaries
1212
* **a** = All boundaries (1-3)
1313
14-
For example, to draw national boundaries with a line thickness of 1p and black line
15-
color use ``borders="1/1p,black"``. You can draw multiple boundaries by passing in
14+
For example, to draw national boundaries with a line thickness of 1p and black line
15+
color use ``borders="1/1p,black"``. You can draw multiple boundaries by passing in
1616
a list to ``borders``.
1717
"""
1818
import pygmt

examples/gallery/maps/land_and_water.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Color land and water
33
--------------------
44
5-
The ``land`` and ``water`` parameters of :meth:`pygmt.Figure.coast` specify
5+
The ``land`` and ``water`` parameters of :meth:`pygmt.Figure.coast` specify
66
a color to fill in the land and water masses, respectively. There are many
77
:gmt-docs:`color codes in GMT <gmtcolors.html>`, including standard GMT color
88
names (like ``skyblue``), R/G/B levels (like ``0/0/255``), a hex value (like

examples/gallery/symbols/datetime_inputs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
- :class:`pandas.DatetimeIndex`
99
- :class:`xarray.DataArray`: datetimes included in a *xarray.DataArray*
1010
- raw datetime strings in `ISO format <https://en.wikipedia.org/wiki/ISO_8601>`__
11-
(e.g. ``"YYYY-MM-DD"``, ``"YYYY-MM-DDTHH"``, and ``"YYYY-MM-DDTHH:MM:SS"``)
11+
(e.g. ``"YYYY-MM-DD"``, ``"YYYY-MM-DDTHH"``, and ``"YYYY-MM-DDTHH:MM:SS"``)
1212
- Python built-in :class:`datetime.datetime` and :class:`datetime.date`
1313
14-
We can pass datetime inputs based on one of the types listed above directly to
14+
We can pass datetime inputs based on one of the types listed above directly to
1515
the ``x`` and ``y`` parameters of e.g. the :meth:`pygmt.Figure.plot` method.
1616
17-
The ``region`` parameter has to include the :math:`x` and :math:`y` axis limits
18-
in the form [*date_min*, *date_max*, *ymin*, *ymax*]. Here *date_min* and
17+
The ``region`` parameter has to include the :math:`x` and :math:`y` axis limits
18+
in the form [*date_min*, *date_max*, *ymin*, *ymax*]. Here *date_min* and
1919
*date_max* can be directly defined as datetime input.
2020
2121
"""

examples/projections/misc/misc_robinson.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Arthur H. Robinson in 1963, is a modified cylindrical projection that is neither
77
conformal nor equal-area. Central meridian and all parallels are straight lines; other
88
meridians are curved. It uses lookup tables rather than analytic expressions to make
9-
the world map look right 22. The scale is true along latitudes 38. The projection was
9+
the world map "look" right 22. The scale is true along latitudes 38. The projection was
1010
originally developed for use by Rand McNally and is currently used by the
1111
National Geographic Society.
1212

examples/projections/misc/misc_sinusoidal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The sinusoidal projection is one of the oldest known projections, is equal-area, and
66
has been used since the mid-16th century. It has also been called the
7-
Equal-area Mercator projection. The central meridian is a straight line; all other
7+
"Equal-area Mercator" projection. The central meridian is a straight line; all other
88
meridians are sinusoidal curves. Parallels are all equally spaced straight lines, with
99
scale being true along all parallels (and central meridian).
1010

examples/projections/misc/misc_winkel_tripel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
55
In 1921, the German mathematician Oswald Winkel a projection that was to strike a
66
compromise between the properties of three elements (area, angle and distance). The
7-
German word tripel refers to this junction of where each of these elements are least
7+
German word "tripel" refers to this junction of where each of these elements are least
88
distorted when plotting global maps. The projection was popularized when Bartholomew
9-
and Son started to use it in its world-renowned The Times Atlas of the World in the
9+
and Son started to use it in its world-renowned "The Times Atlas of the World" in the
1010
mid-20th century. In 1998, the National Geographic Society made the Winkel Tripel as
1111
its map projection of choice for global maps.
1212

examples/projections/nongeo/polar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
=====
44
55
Polar projections allow plotting polar coordinate data (e.g. angle
6-
:math:`\theta` and radius *r*).
6+
:math:`\theta` and radius *r*).
77
88
The full syntax for polar projections is:
99

examples/tutorials/vectors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251

252252
########################################################################################
253253
# Plot Circular Vectors
254-
# ----------
254+
# ---------------------
255255
#
256256
# When plotting circular vectors, all of the information for a single vector is
257257
# to be stored in a list. Each circular vector list is structured as:

pygmt/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# Import modules to make the high-level GMT Python API
2626
from pygmt import datasets
2727
from pygmt.accessors import GMTDataArrayAccessor
28-
from pygmt.figure import Figure
28+
from pygmt.figure import Figure, set_display
2929
from pygmt.session_management import begin as _begin
3030
from pygmt.session_management import end as _end
3131
from pygmt.src import (
@@ -47,7 +47,7 @@
4747

4848
# Get semantic version through setuptools-scm
4949
__version__ = f'v{get_distribution("pygmt").version}' # e.g. v0.1.2.dev3+g0ab3cd78
50-
__commit__ = __version__.split("+g")[-1] # 0ab3cd78
50+
__commit__ = __version__.split("+g")[-1] if "+g" in __version__ else "" # 0ab3cd78
5151

5252
# Start our global modern mode session
5353
_begin()

pygmt/datasets/earth_relief.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pygmt.src import grdcut, which
1111

1212

13-
@kwargs_to_strings(convert_bools=False, region="sequence")
13+
@kwargs_to_strings(region="sequence")
1414
def load_earth_relief(resolution="01d", region=None, registration=None, use_srtm=False):
1515
r"""
1616
Load Earth relief grids (topography and bathymetry) in various resolutions.

0 commit comments

Comments
 (0)