@@ -587,9 +587,9 @@ def build_arg_list( # noqa: PLR0912
587
587
return gmt_args
588
588
589
589
590
- def is_nonstr_iter (value ) :
590
+ def is_nonstr_iter (value : Any ) -> bool :
591
591
"""
592
- Check if the value is not a string but is iterable (list, tuple, array)
592
+ Check if the value is iterable (e.g., list, tuple, array) but not a string.
593
593
594
594
Parameters
595
595
----------
@@ -598,12 +598,11 @@ def is_nonstr_iter(value):
598
598
599
599
Returns
600
600
-------
601
- is_iterable : bool
601
+ is_iterable
602
602
Whether it is a non-string iterable or not.
603
603
604
604
Examples
605
605
--------
606
-
607
606
>>> is_nonstr_iter("abc")
608
607
False
609
608
>>> is_nonstr_iter(10)
@@ -662,32 +661,29 @@ def launch_external_viewer(fname: str, waiting: float = 0) -> None:
662
661
time .sleep (waiting )
663
662
664
663
665
- def args_in_kwargs (args , kwargs ) :
664
+ def args_in_kwargs (args : Sequence [ str ] , kwargs : dict [ str , Any ]) -> bool :
666
665
"""
667
- Take a list and a dictionary, and determine if any entries in the list are keys in
668
- the dictionary.
666
+ Take a sequence and a dictionary, and determine if any entries in the sequence are
667
+ keys in the dictionary.
669
668
670
- This function is used to determine if at least one of the required
671
- arguments is passed to raise a GMTInvalidInput Error.
669
+ This function is used to determine if at least one of the required arguments is
670
+ passed to raise a GMTInvalidInput Error.
672
671
673
672
Parameters
674
673
----------
675
- args : list
676
- List of required arguments, using the GMT short-form aliases.
677
-
678
- kwargs : dict
679
- The dictionary of kwargs is the format returned by the _preprocess
680
- function of the BasePlotting class. The keys are the GMT
681
- short-form aliases of the parameters.
674
+ args
675
+ Sequence of required arguments, using the GMT short-form aliases.
676
+ kwargs
677
+ The dictionary of GMT options and arguments. The keys are the GMT short-form
678
+ aliases of the parameters.
682
679
683
680
Returns
684
681
-------
685
682
bool
686
- If one of the required arguments is in ``kwargs``.
683
+ Whether one of the required arguments is in ``kwargs``.
687
684
688
685
Examples
689
686
--------
690
-
691
687
>>> args_in_kwargs(args=["A", "B"], kwargs={"C": "xyz"})
692
688
False
693
689
>>> args_in_kwargs(args=["A", "B"], kwargs={"B": "af"})
0 commit comments