Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/4-release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,16 @@ assignees: ''

- [ ] At the [PyGMT release page on GitHub](https://github.com/GenericMappingTools/pygmt/releases):
- [ ] Edit the draft release notes with the finalized changelog
- [ ] Set the tag version and release title to vX.Y.Z
- [ ] Set the tag version and release title to `vX.Y.Z`
- [ ] Make a release by clicking the 'Publish Release' button, this will automatically create a tag too
- [ ] Verify that [all workflows triggered by the release](https://github.com/GenericMappingTools/pygmt/actions?query=event%3Arelease) pass
- [ ] The latest version is correct on [PyPI](https://pypi.org/project/pygmt/)
- [ ] The latest version is correct on https://www.pygmt.org/latest/
- [ ] The [release page](https://github.com/GenericMappingTools/pygmt/releases) has five assets, including `baseline-images.zip`, `pygmt-docs.zip` and `pygmt-docs.pdf`
- [ ] Upload to Zenodo:
- [ ] Download pygmt-X.Y.Z.zip (listed as Source code (zip); rename it to pygmt-vX.Y.Z.zip) and baseline-images.zip from the release page, and upload the two zip files to https://zenodo.org/deposit
- [ ] Download pygmt-X.Y.Z.zip (listed as Source code (zip)) and baseline-images.zip from the release page, and upload the two zip files to https://zenodo.org/deposit
- [ ] Ensure they are filed under the correct reserved DOI
- [ ] Ensure the `version` field is `X.Y.Z` (without leading `v`)
- [ ] Update authorship information based on `CITATION.cff`

**After release**:
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
commit_link = f'<a href="{repository_url}/commit/{__commit__}">{__commit__[:8]}</a>'
else:
commit_link = (
f'<a href="{repository_url}/releases/tag/{__version__}">{__version__}</a>'
f'<a href="{repository_url}/releases/tag/v{__version__}">v{__version__}</a>'
)

# Projection information.
Expand Down
12 changes: 6 additions & 6 deletions doc/maintenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ patch release.
## Backwards Compatibility and Deprecation Policy

PyGMT is still undergoing rapid development. All of the API is subject to change until
the v1.0.0 release. Versioning in PyGMT is based on the
[semantic versioning specification](https://semver.org/spec/v2.0.0.html)
(i.e., v*MAJOR*.*MINOR*.*PATCH*). Basic policy for backwards compatibility:
the 1.0.0 release. Versioning in PyGMT is based on the
[semantic versioning specification](https://semver.org/spec/v2.0.0.html) (i.e.,
*MAJOR*.*MINOR*.*PATCH*). Basic policy for backwards compatibility:

- Any incompatible changes should go through the deprecation process below.
- Incompatible changes are only allowed in major and minor releases, not in patch releases.
Expand All @@ -175,15 +175,15 @@ Here is an example:
```python
# TODO(PyGMT>=0.6.0): Remove the deprecated "columns" parameter.
@fmt_docstring
@deprecate_parameter("columns", "incols", "v0.4.0", remove_version="v0.6.0")
@deprecate_parameter("columns", "incols", "0.4.0", remove_version="0.6.0")
@use_alias(J="projection", R="region", V="verbose", i="incols")
@kwargs_to_strings(R="sequence", i="sequence_comma")
def plot(self, x=None, y=None, data=None, size=None, direction=None, **kwargs):
pass
```

In this case, the old parameter name `columns` is deprecated since v0.4.0, and will be
fully removed in v0.6.0. The new parameter name is `incols`.
In this case, the old parameter name `columns` is deprecated since 0.4.0, and will be
fully removed in 0.6.0. The new parameter name is `incols`.

### TODO comments

Expand Down
12 changes: 6 additions & 6 deletions pygmt/_show_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from pygmt.clib import Session, __gmt_version__, required_gmt_version

# Get semantic version through setuptools-scm
__version__ = f"v{version('pygmt')}" # e.g. v0.1.2.dev3+g0ab3cd78
__version__ = version("pygmt") # e.g., 0.1.2.dev3+g0ab3cd78
__commit__ = ( # 0ab3cd78
__version__.rsplit(sep="+g", maxsplit=1)[-1] if "+g" in __version__ else ""
)
Comment on lines 19 to 23

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8cf07e4.

Expand Down Expand Up @@ -93,19 +93,19 @@ def _check_ghostscript_version(gs_version: str | None) -> str | None:
match Version(gs_version):
case v if v < Version("9.53"):
return (
f"Ghostscript v{gs_version} is too old and may have serious bugs. "
f"Ghostscript {gs_version} is too old and may have serious bugs. "
"Please consider upgrading your Ghostscript."
)
case v if Version("10.00") <= v < Version("10.02"):
return (
f"Ghostscript v{gs_version} has known bugs. "
"Please consider upgrading to version v10.02 or later."
f"Ghostscript {gs_version} has known bugs. "
"Please consider upgrading to Ghostscript 10.02 or later."
)
case v if v >= Version("10.02") and Version(__gmt_version__) < Version("6.5.0"):
return (
f"GMT v{__gmt_version__} doesn't support Ghostscript v{gs_version}. "
f"GMT {__gmt_version__} doesn't support Ghostscript {gs_version}. "
"Please consider upgrading to GMT>=6.5.0 or downgrading to Ghostscript "
"v9.56."
"9.56."
)
return None

Expand Down
4 changes: 2 additions & 2 deletions pygmt/clib/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,14 +645,14 @@ def call_module(self, module: str, args: str | list[str]) -> None:
# 'args' is a list of strings and each string contains a module argument.
# In this way, GMT can correctly handle option arguments with whitespaces or
# quotation marks. This is the preferred way to pass arguments to the GMT
# API and is used for PyGMT >= v0.12.0.
# API and is used for PyGMT>=0.12.0.
mode = len(args) # 'mode' is the number of arguments.
# Pass a null pointer if no arguments are specified.
argv = strings_to_ctypes_array(args) if mode != 0 else None
elif isinstance(args, str):
# 'args' is a single string that contains whitespace-separated arguments.
# In this way, we need to correctly handle option arguments that contain
# whitespaces or quotation marks. It's used in PyGMT <= v0.11.0 but is no
# whitespaces or quotation marks. It's used in PyGMT<=0.11.0 but is no
# longer recommended.
mode = self["GMT_MODULE_CMD"]
argv = args.encode()
Expand Down
4 changes: 2 additions & 2 deletions pygmt/datasets/tile_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def load_tile_map(
HTTP headers to include with requests to the tile server. This can be useful
for authentication or to set a custom User-Agent. When supported by
``contextily`` (>=1.7.0), PyGMT sets a default ``User-Agent`` header like
``PyGMT/vX.Y.Z (+https://www.pygmt.org)``.
``PyGMT/X.Y.Z (+https://www.pygmt.org)``.

.. note::
Requires ``contextily>=1.7.0``.
Expand Down Expand Up @@ -178,7 +178,7 @@ def load_tile_map(
}

# TODO(contextily>=1.7.0): Remove once contextily>=1.7.0 is required.
# The 'headers' parameter was added in contextily v1.7.0
# The 'headers' parameter was added in contextily 1.7.0.
if Version(contextily.__version__) < Version("1.7.0"):
Comment on lines 180 to 182

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 02dd66b.

if headers is not None:
raise GMTParameterError(
Expand Down
2 changes: 1 addition & 1 deletion pygmt/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def savefig(
)
kwargs["W"] = True

# pytest-mpl v0.17.0 added the "metadata" parameter to Figure.savefig, which is
# pytest-mpl 0.17.0 added the "metadata" parameter to Figure.savefig, which is
# not recognized. So remove it before calling Figure.psconvert.
kwargs.pop("metadata", None)
self.psconvert(prefix=prefix, fmt=fmts[ext], crop=crop, **kwargs)
Expand Down
18 changes: 9 additions & 9 deletions pygmt/helpers/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,29 +570,29 @@ def new_module(*args, **kwargs):
)
warnings.warn(msg, category=SyntaxWarning, stacklevel=2)

# timestamp (U) is deprecated since v0.9.0 and removed in v0.12.0.
# timestamp (U) is deprecated since 0.9.0 and removed in 0.12.0.
if "U" in kwargs or "timestamp" in kwargs:
raise GMTParameterError(
reason=(
"Parameters 'U' and 'timestamp' are no longer supported since v0.12.0. "
"Parameters 'U' and 'timestamp' are no longer supported since 0.12.0. "
"Use Figure.timestamp() instead."
)
)

# xshift (X) is deprecated since v0.8.0 and removed in v0.12.0.
# xshift (X) is deprecated since 0.8.0 and removed in 0.12.0.
if "X" in kwargs or "xshift" in kwargs:
raise GMTParameterError(
reason=(
"Parameters 'X' and 'xshift' are no longer supported since v0.12.0. "
"Parameters 'X' and 'xshift' are no longer supported since 0.12.0. "
"Use Figure.shift_origin(xshift=...) instead."
)
)

# yshift (Y) is deprecated since v0.8.0 and removed in v0.12.0.
# yshift (Y) is deprecated since 0.8.0 and removed in 0.12.0.
if "Y" in kwargs or "yshift" in kwargs:
raise GMTParameterError(
reason=(
"Parameters 'Y' and 'yshift' are no longer supported since v0.12.0. "
"Parameters 'Y' and 'yshift' are no longer supported since 0.12.0. "
"Use Figure.shift_origin(yshift=...) instead."
)
)
Expand Down Expand Up @@ -792,9 +792,9 @@ def deprecate_parameter(oldname, newname, deprecate_version, remove_version):

Examples
--------
>>> @deprecate_parameter("sizes", "size", "v0.0.0", "v9.9.9")
... @deprecate_parameter("colors", "color", "v0.0.0", "v9.9.9")
... @deprecate_parameter("infile", "data", "v0.0.0", "v9.9.9")
>>> @deprecate_parameter("sizes", "size", "0.0.0", "9.9.9")
... @deprecate_parameter("colors", "color", "0.0.0", "9.9.9")
... @deprecate_parameter("infile", "data", "0.0.0", "9.9.9")
... def module(data, size=0, **kwargs):
... "A module that prints the arguments it received"
... print(f"data={data}, size={size}, color={kwargs['color']}")
Expand Down
14 changes: 7 additions & 7 deletions pygmt/src/basemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def basemap(

.. note::

Parameters ``map_scale``, ``rose``, and ``compass`` are deprecated since
v0.19.0 in favor of the dedicated higher-level methods:
Parameters ``map_scale``, ``rose``, and ``compass`` are deprecated since 0.19.0
in favor of the dedicated higher-level methods:

- :meth:`pygmt.Figure.scalebar`: Add a scale bar on the plot.
- :meth:`pygmt.Figure.directional_rose`: Add a directional rose on the plot.
Expand Down Expand Up @@ -85,31 +85,31 @@ def basemap(
map_scale
Draw a map scale bar on the plot.

.. deprecated:: v0.19.0
.. deprecated:: 0.19.0

Use :meth:`pygmt.Figure.scalebar` instead. This parameter is maintained
for backward compatibility and accepts raw GMT CLI strings for the ``-L``
option.
compass
Draw a map magnetic rose on the map.

.. deprecated:: v0.19.0
.. deprecated:: 0.19.0

Use :meth:`pygmt.Figure.magnetic_rose` instead. This parameter is maintained
for backward compatibility and accepts raw GMT CLI strings for the ``-Tm``
option.
rose
Draw a map directional rose on the map.

.. deprecated:: v0.19.0
.. deprecated:: 0.19.0

Use :meth:`pygmt.Figure.directional_rose` instead. This parameter is
maintained for backward compatibility and accepts raw GMT CLI strings for
the ``-Td`` option.
box
Draw a background box behind the scalebar, directional rose, or magnetic rose.

.. deprecated:: v0.19.0
.. deprecated:: 0.19.0

Use the ``box`` parameter in :meth:`pygmt.Figure.scalebar`,
:meth:`pygmt.Figure.directional_rose`, or :meth:`pygmt.Figure.magnetic_rose`
Expand Down Expand Up @@ -147,7 +147,7 @@ def basemap(
):
if is_given(value):
warnings.warn(
f"The {name!r} parameter has been deprecated since v0.19.0. Use {recommendation!r} instead.",
f"The {name!r} parameter has been deprecated since 0.19.0. Use {recommendation!r} instead.",
category=FutureWarning,
stacklevel=2,
)
Expand Down
6 changes: 3 additions & 3 deletions pygmt/src/coast.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ def coast(
map_scale
Draw a map scale bar on the plot.

.. deprecated:: v0.19.0
.. deprecated:: 0.19.0

Use :meth:`pygmt.Figure.scalebar` instead. This parameter is maintained
for backward compatibility and accepts raw GMT CLI strings for the ``-L``
Use :meth:`pygmt.Figure.scalebar` instead. This parameter is maintained for
backward compatibility and accepts raw GMT CLI strings for the ``-L``
option.
box
Draw a background box behind the map scale or rose. If set to ``True``, a simple
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/grdsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# TODO(PyGMT>=0.21.0): Remove the deprecated "translate" parameter.
@fmt_docstring
@deprecate_parameter("translate", "toggle", "v0.18.0", remove_version="v0.21.0")
@deprecate_parameter("translate", "toggle", "0.18.0", remove_version="0.21.0")
@use_alias(f="coltypes", n="interpolation")
def grdsample(
grid: PathLike | xr.DataArray,
Expand Down
4 changes: 2 additions & 2 deletions pygmt/src/subplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def subplot(
autolabel
Specify automatic tag of each subplot.

.. deprecated:: v0.19.0
.. deprecated:: 0.19.0

Use the parameters ``tag``, ``tag_position``, ``tag_box``,
``tag_number_style``, ``tag_orientation``, and ``tag_font`` instead.
Expand Down Expand Up @@ -359,7 +359,7 @@ def subplot(
@fmt_docstring
@contextlib.contextmanager
# TODO(PyGMT>=0.23.0): Remove the deprecated 'fixedlabel' parameter.
@deprecate_parameter("fixedlabel", "tag", "v0.19.0", remove_version="v0.23.0")
@deprecate_parameter("fixedlabel", "tag", "0.19.0", remove_version="0.23.0")
@use_alias(C="clearance")
def set_panel(
self,
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/tilemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def tilemap(
HTTP headers to include with requests to the tile server. This can be useful
for authentication or to set a custom User-Agent. When supported by
``contextily`` (>=1.7.0), PyGMT sets a default ``User-Agent`` header like
``PyGMT/vX.Y.Z (+https://www.pygmt.org)``.
``PyGMT/X.Y.Z (+https://www.pygmt.org)``.

.. note::
Requires ``contextily>=1.7.0``.
Expand Down
2 changes: 1 addition & 1 deletion pygmt/tests/test_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_timestamp_unsupported_u_timestamp():
"""
Raise an exception when either U or timestamp is used.

Parameters U and timestamp are no longer supported since v0.12.0.
Parameters U and timestamp are no longer supported since 0.12.0.
"""
fig = Figure()
with pytest.raises(GMTParameterError):
Expand Down
Loading