From 88711a6303aacdfbcdff22094e271f126bd53fe4 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sat, 20 Apr 2024 18:33:01 +0800 Subject: [PATCH 1/3] Deprecate the build_arg_string function in v0.12.0 (will be removed in v0.14.0) and use build_arg_list instead --- pygmt/helpers/utils.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pygmt/helpers/utils.py b/pygmt/helpers/utils.py index 0fcd61d6673..856cb09cb61 100644 --- a/pygmt/helpers/utils.py +++ b/pygmt/helpers/utils.py @@ -10,6 +10,7 @@ import subprocess import sys import time +import warnings import webbrowser from collections.abc import Iterable, Sequence from typing import Any @@ -439,6 +440,10 @@ def build_arg_string(kwdict, confdict=None, infile=None, outfile=None): strings (e.g. "+proj=longlat +datum=WGS84") will have their spaces removed. See https://github.com/GenericMappingTools/pygmt/pull/1487 for more info. + .. deprecated:: 0.12.0 + + Use :func:`build_arg_list` instead. + Parameters ---------- kwdict : dict @@ -513,8 +518,13 @@ def build_arg_string(kwdict, confdict=None, infile=None, outfile=None): ... ) input.txt -A0 -B -Crainbow --FORMAT_DATE_MAP="o dd" ->output.txt """ - gmt_args = [] + msg = ( + "Utility function `build_arg_string()' is deprecated in v0.12.0 and will be " + "removed in v0.14.0. Uease `build_arg_list()' instead." + ) + warnings.warn(msg, category=FutureWarning, stacklevel=2) + gmt_args = [] for key in kwdict: if len(key) > 2: # raise an exception for unrecognized options raise GMTInvalidInput(f"Unrecognized parameter '{key}'.") From 3ad88f562d98b9c2e3c2a6a7b557afb229264034 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 21 Apr 2024 20:44:05 +0800 Subject: [PATCH 2/3] Typo Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com> --- pygmt/helpers/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/helpers/utils.py b/pygmt/helpers/utils.py index 856cb09cb61..39c3a56a01e 100644 --- a/pygmt/helpers/utils.py +++ b/pygmt/helpers/utils.py @@ -520,7 +520,7 @@ def build_arg_string(kwdict, confdict=None, infile=None, outfile=None): """ msg = ( "Utility function `build_arg_string()' is deprecated in v0.12.0 and will be " - "removed in v0.14.0. Uease `build_arg_list()' instead." + "removed in v0.14.0. Use `build_arg_list()' instead." ) warnings.warn(msg, category=FutureWarning, stacklevel=2) From b720fd02a2912b6c9d3ce965ff1c9f4dbcd79cfc Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 22 Apr 2024 06:28:02 +0800 Subject: [PATCH 3/3] Update pygmt/helpers/utils.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com> --- pygmt/helpers/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/helpers/utils.py b/pygmt/helpers/utils.py index 39c3a56a01e..1732dfb4e3f 100644 --- a/pygmt/helpers/utils.py +++ b/pygmt/helpers/utils.py @@ -519,8 +519,8 @@ def build_arg_string(kwdict, confdict=None, infile=None, outfile=None): input.txt -A0 -B -Crainbow --FORMAT_DATE_MAP="o dd" ->output.txt """ msg = ( - "Utility function `build_arg_string()' is deprecated in v0.12.0 and will be " - "removed in v0.14.0. Use `build_arg_list()' instead." + "Utility function 'build_arg_string()' is deprecated in v0.12.0 and will be " + "removed in v0.14.0. Use 'build_arg_list()' instead." ) warnings.warn(msg, category=FutureWarning, stacklevel=2)