Skip to content

Commit 7448f80

Browse files
author
Meghan Jones
authored
Merge branch 'main' into remove-grdinfo/grdproject
2 parents 41e1463 + 2acfe4d commit 7448f80

21 files changed

+368
-252
lines changed

CODE_OF_CONDUCT.md

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
66
community a harassment-free experience for everyone, regardless of age, body
77
size, visible or invisible disability, ethnicity, sex characteristics, gender
88
identity and expression, level of experience, education, socio-economic status,
9-
nationality, personal appearance, race, religion, or sexual identity
10-
and orientation.
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
1111

1212
We pledge to act and interact in ways that contribute to an open, welcoming,
1313
diverse, inclusive, and healthy community.
@@ -22,17 +22,17 @@ community include:
2222
* Giving and gracefully accepting constructive feedback
2323
* Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
26-
overall community
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
31-
advances of any kind
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
3232
* Trolling, insulting or derogatory comments, and personal or political attacks
3333
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
35-
address, without their explicit permission
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
3636
* Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

@@ -61,7 +61,7 @@ representative at an online or offline event.
6161
Instances of abusive, harassing, or otherwise unacceptable behavior may be
6262
reported to the community leaders responsible for enforcement
6363
by contacting [Leonardo Uieda](http://www.leouieda.com) (preferred) or
64-
[Paul Wessel](http://www.soest.hawaii.edu/wessel).
64+
[Meghan Jones](https://www.soest.hawaii.edu/soestwp/about/directory/meghan-jones/).
6565
All complaints will be reviewed and investigated promptly and fairly.
6666

6767
All community leaders are obligated to respect the privacy and security of the
@@ -83,15 +83,15 @@ behavior was inappropriate. A public apology may be requested.
8383

8484
### 2. Warning
8585

86-
**Community Impact**: A violation through a single incident or series
87-
of actions.
86+
**Community Impact**: A violation through a single incident or series of
87+
actions.
8888

8989
**Consequence**: A warning with consequences for continued behavior. No
9090
interaction with the people involved, including unsolicited interaction with
9191
those enforcing the Code of Conduct, for a specified period of time. This
9292
includes avoiding interactions in community spaces as well as external channels
93-
like social media. Violating these terms may lead to a temporary or
94-
permanent ban.
93+
like social media. Violating these terms may lead to a temporary or permanent
94+
ban.
9595

9696
### 3. Temporary Ban
9797

@@ -107,23 +107,28 @@ Violating these terms may lead to a permanent ban.
107107
### 4. Permanent Ban
108108

109109
**Community Impact**: Demonstrating a pattern of violation of community
110-
standards, including sustained inappropriate behavior, harassment of an
110+
standards, including sustained inappropriate behavior, harassment of an
111111
individual, or aggression toward or disparagement of classes of individuals.
112112

113-
**Consequence**: A permanent ban from any sort of public interaction within
114-
the community.
113+
**Consequence**: A permanent ban from any sort of public interaction within the
114+
community.
115115

116116
## Attribution
117117

118118
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119-
version 2.0, available at
120-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
119+
version 2.1, available at
120+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121121

122-
Community Impact Guidelines were inspired by [Mozilla's code of conduct
123-
enforcement ladder](https://github.com/mozilla/diversity).
122+
Community Impact Guidelines were inspired by
123+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124+
125+
For answers to common questions about this code of conduct, see the FAQ at
126+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127+
[https://www.contributor-covenant.org/translations][translations].
124128

125129
[homepage]: https://www.contributor-covenant.org
130+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131+
[Mozilla CoC]: https://github.com/mozilla/diversity
132+
[FAQ]: https://www.contributor-covenant.org/faq
133+
[translations]: https://www.contributor-covenant.org/translations
126134

127-
For answers to common questions about this code of conduct, see the FAQ at
128-
https://www.contributor-covenant.org/faq. Translations are available at
129-
https://www.contributor-covenant.org/translations.

README.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PyGMT
3131
.. image:: https://zenodo.org/badge/DOI/10.5281/3781524.svg
3232
:alt: Digital Object Identifier for the Zenodo archive
3333
:target: https://doi.org/10.5281/zenodo.3781524
34-
.. image:: https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg
34+
.. image:: https://img.shields.io/badge/Contributor%20Covenant-v2.1%20adopted-ff69b4.svg
3535
:alt: Contributor Code of Conduct
3636
:target: CODE_OF_CONDUCT.md
3737

@@ -73,8 +73,9 @@ Project goals
7373
* Interface with the GMT C API directly using ctypes (no system calls).
7474
* Support for rich display in the Jupyter notebook.
7575
* Integration with the `PyData <https://pydata.org/>`__ ecosystem:
76-
``numpy.ndarray`` or ``pandas.DataFrame`` for data tables and
77-
``xarray.DataArray`` for grids.
76+
``numpy.ndarray`` or ``pandas.DataFrame`` for data tables,
77+
``xarray.DataArray`` for grids and ``geopandas.GeoDataFrame``
78+
for geographical data.
7879

7980

8081
Quickstart

examples/gallery/histograms/blockm.py

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

1212
# Load sample data
13-
data = pygmt.datasets.load_japan_quakes()
13+
data = pygmt.datasets.load_sample_data(name="japan_quakes")
1414
# Select only needed columns
1515
data = data[["longitude", "latitude", "depth_km"]]
1616

examples/gallery/histograms/rose.py

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

1111
# Load sample compilation of fracture lengths and azimuth as
1212
# hypothetically digitized from geological maps
13-
data = pygmt.datasets.load_fractures_compilation()
13+
data = pygmt.datasets.load_sample_data(name="fractures")
1414

1515
fig = pygmt.Figure()
1616

examples/gallery/images/track_sampling.py

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

1919
# Load sample grid and point datasets
2020
grid = pygmt.datasets.load_earth_relief()
21-
points = pygmt.datasets.load_ocean_ridge_points()
21+
points = pygmt.datasets.load_sample_data(name="ocean_ridge_points")
2222
# Sample the bathymetry along the world's ocean ridges at specified track
2323
# points
2424
track = pygmt.grdtrack(points=points, grid=grid, newcolname="bathymetry")

examples/tutorials/basics/plot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
###############################################################################
1616
# For example, let's load the sample dataset of tsunami generating earthquakes
17-
# around Japan (:func:`pygmt.datasets.load_japan_quakes`). The data is loaded
18-
# as a :class:`pandas.DataFrame`.
17+
# around Japan (:func:`pygmt.datasets.load_sample_data(name="japan_quakes")`).
18+
# The data is loaded as a :class:`pandas.DataFrame`.
1919

20-
data = pygmt.datasets.load_japan_quakes()
20+
data = pygmt.datasets.load_sample_data(name="japan_quakes")
2121

2222
# Set the region for the plot to be slightly larger than the data bounds.
2323
region = [

pygmt/src/blockm.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@ def blockmean(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
147147
is not set.
148148
- None if ``outfile`` is set (filtered output will be stored in file
149149
set by ``outfile``).
150+
151+
Example
152+
-------
153+
>>> import pygmt # doctest: +SKIP
154+
>>> # Load a table of ship observations of bathymetry off Baja California
155+
>>> data = pygmt.datasets.load_sample_data(
156+
... name="bathymetry"
157+
... ) # doctest: +SKIP
158+
>>> # Calculate block mean values within 5 by 5 minute bins
159+
>>> data_bmean = pygmt.blockmean(
160+
... data=data, region=[245, 255, 20, 30], spacing="5m"
161+
... ) # doctest: +SKIP
150162
"""
151163
return _blockm(
152164
block_method="blockmean", data=data, x=x, y=y, z=z, outfile=outfile, **kwargs
@@ -225,6 +237,18 @@ def blockmedian(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
225237
is not set.
226238
- None if ``outfile`` is set (filtered output will be stored in file
227239
set by ``outfile``).
240+
241+
Example
242+
-------
243+
>>> import pygmt # doctest: +SKIP
244+
>>> # Load a table of ship observations of bathymetry off Baja California
245+
>>> data = pygmt.datasets.load_sample_data(
246+
... name="bathymetry"
247+
... ) # doctest: +SKIP
248+
>>> # Calculate block median values within 5 by 5 minute bins
249+
>>> data_bmedian = pygmt.blockmedian(
250+
... data=data, region=[245, 255, 20, 30], spacing="5m"
251+
... ) # doctest: +SKIP
228252
"""
229253
return _blockm(
230254
block_method="blockmedian", data=data, x=x, y=y, z=z, outfile=outfile, **kwargs
@@ -303,6 +327,18 @@ def blockmode(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
303327
is not set.
304328
- None if ``outfile`` is set (filtered output will be stored in file
305329
set by ``outfile``).
330+
331+
Example
332+
-------
333+
>>> import pygmt # doctest: +SKIP
334+
>>> # Load a table of ship observations of bathymetry off Baja California
335+
>>> data = pygmt.datasets.load_sample_data(
336+
... name="bathymetry"
337+
... ) # doctest: +SKIP
338+
>>> # Calculate block mode values within 5 by 5 minute bins
339+
>>> data_bmode = pygmt.blockmode(
340+
... data=data, region=[245, 255, 20, 30], spacing="5m"
341+
... ) # doctest: +SKIP
306342
"""
307343
return _blockm(
308344
block_method="blockmode", data=data, x=x, y=y, z=z, outfile=outfile, **kwargs

pygmt/src/grdgradient.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,21 @@ def grdgradient(grid, **kwargs):
148148
- :class:`xarray.DataArray` if ``outgrid`` is not set
149149
- None if ``outgrid`` is set (grid output will be stored in file set by
150150
``outgrid``)
151+
152+
153+
Example
154+
-------
155+
>>> import pygmt # doctest: +SKIP
156+
>>> # Load a grid of @earth_relief_30m data, with an x-range of 10 to 30,
157+
>>> # and a y-range of 15 to 25
158+
>>> grid = pygmt.datasets.load_earth_relief(
159+
... resolution="30m", region=[10, 30, 15, 25]
160+
... ) # doctest: +SKIP
161+
>>> # Create a new grid from an input grid, set the azimuth to 10 degrees,
162+
>>> # and the direction to "c" for Cartesian coordinates
163+
>>> new_grid = pygmt.grdgradient(
164+
... grid=grid, azimuth=10, direction="c"
165+
... ) # doctest: +SKIP
151166
"""
152167
with GMTTempFile(suffix=".nc") as tmpfile:
153168
if "Q" in kwargs and "N" not in kwargs:

pygmt/src/grdlandmask.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ def grdlandmask(**kwargs):
9292
- :class:`xarray.DataArray` if ``outgrid`` is not set
9393
- None if ``outgrid`` is set (grid output will be stored in file set by
9494
``outgrid``)
95+
96+
Example
97+
-------
98+
>>> import pygmt # doctest: +SKIP
99+
>>> # Create a landmask grid with an x-range of 125 to 130,
100+
>>> # and a y-range of 30 to 35
101+
>>> landmask = pygmt.grdlandmask(
102+
... spacing=1, region=[125, 130, 30, 35]
103+
... ) # doctest: +SKIP
95104
"""
96105
if "I" not in kwargs or "R" not in kwargs:
97106
raise GMTInvalidInput("Both 'region' and 'spacing' must be specified.")

pygmt/src/grdproject.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,21 @@ def grdproject(grid, **kwargs):
9595
- :class:`xarray.DataArray` if ``outgrid`` is not set
9696
- None if ``outgrid`` is set (grid output will be stored in file set by
9797
``outgrid``)
98+
99+
Example
100+
-------
101+
>>> import pygmt # doctest: +SKIP
102+
>>> # Load a grid of @earth_relief_30m data, with an x-range of 10 to 30,
103+
>>> # and a y-range of 15 to 25
104+
>>> grid = pygmt.datasets.load_earth_relief(
105+
... resolution="30m", region=[10, 30, 15, 25]
106+
... ) # doctest: +SKIP
107+
>>> # Create a new grid from the input grid, set the projection to
108+
>>> # Mercator, and set inverse to "True" to change from "geographic"
109+
>>> # to "rectangular"
110+
>>> new_grid = pygmt.grdproject(
111+
... grid=grid, projection="M10c", inverse=True
112+
... ) # doctest: +SKIP
98113
"""
99114
if "J" not in kwargs:
100115
raise GMTInvalidInput("The projection must be specified.")

0 commit comments

Comments
 (0)