Skip to content

Commit da664bc

Browse files
seismanmichaelgrundyvonnefroehlich
authored
Deprecate the build_arg_string function in v0.12.0 (will be removed in v0.14.0) and use build_arg_list instead (#3184)
Co-authored-by: Michael Grund <[email protected]> Co-authored-by: Yvonne Fröhlich <[email protected]>
1 parent 4786110 commit da664bc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pygmt/helpers/utils.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import subprocess
1111
import sys
1212
import time
13+
import warnings
1314
import webbrowser
1415
from collections.abc import Iterable, Sequence
1516
from typing import Any
@@ -439,6 +440,10 @@ def build_arg_string(kwdict, confdict=None, infile=None, outfile=None):
439440
strings (e.g. "+proj=longlat +datum=WGS84") will have their spaces removed.
440441
See https://github.com/GenericMappingTools/pygmt/pull/1487 for more info.
441442
443+
.. deprecated:: 0.12.0
444+
445+
Use :func:`build_arg_list` instead.
446+
442447
Parameters
443448
----------
444449
kwdict : dict
@@ -513,8 +518,13 @@ def build_arg_string(kwdict, confdict=None, infile=None, outfile=None):
513518
... )
514519
input.txt -A0 -B -Crainbow --FORMAT_DATE_MAP="o dd" ->output.txt
515520
"""
516-
gmt_args = []
521+
msg = (
522+
"Utility function 'build_arg_string()' is deprecated in v0.12.0 and will be "
523+
"removed in v0.14.0. Use 'build_arg_list()' instead."
524+
)
525+
warnings.warn(msg, category=FutureWarning, stacklevel=2)
517526

527+
gmt_args = []
518528
for key in kwdict:
519529
if len(key) > 2: # raise an exception for unrecognized options
520530
raise GMTInvalidInput(f"Unrecognized parameter '{key}'.")

0 commit comments

Comments
 (0)