File tree 2 files changed +7
-11
lines changed
2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 5
5
6
6
from packaging .version import Version
7
7
from pygmt .clib import Session , __gmt_version__
8
- from pygmt .helpers import build_arg_string , is_nonstr_iter
8
+ from pygmt .helpers import build_arg_string , kwargs_to_strings
9
9
10
10
__doctest_skip__ = ["timestamp" ]
11
11
12
12
13
+ @kwargs_to_strings (offset = "sequence" )
13
14
def timestamp (
14
15
self ,
15
16
text = None ,
@@ -83,14 +84,11 @@ def timestamp(
83
84
kwdict ["U" ] += f"{ label } "
84
85
kwdict ["U" ] += f"+j{ justification } "
85
86
86
- if is_nonstr_iter (offset ): # given a tuple
87
- kwdict ["U" ] += "+o" + "/" .join (f"{ item } " for item in offset )
88
- elif "/" not in offset and Version (__gmt_version__ ) <= Version ("6.4.0" ):
87
+ if "/" not in offset and Version (__gmt_version__ ) <= Version ("6.4.0" ):
89
88
# Giving a single offset doesn't work in GMT <= 6.4.0.
90
89
# See https://github.com/GenericMappingTools/gmt/issues/7107.
91
- kwdict ["U" ] += f"+o{ offset } /{ offset } "
92
- else :
93
- kwdict ["U" ] += f"+o{ offset } "
90
+ offset = f"{ offset } /{ offset } "
91
+ kwdict ["U" ] += f"+o{ offset } "
94
92
95
93
# The +t modifier was added in GMT 6.5.0.
96
94
# See https://github.com/GenericMappingTools/gmt/pull/7127.
Original file line number Diff line number Diff line change 6
6
GMTTempFile ,
7
7
build_arg_string ,
8
8
fmt_docstring ,
9
- is_nonstr_iter ,
9
+ kwargs_to_strings ,
10
10
use_alias ,
11
11
)
12
12
13
13
14
14
@fmt_docstring
15
15
@use_alias (G = "download" , V = "verbose" )
16
+ @kwargs_to_strings (fname = "sequence_space" )
16
17
def which (fname , ** kwargs ):
17
18
r"""
18
19
Find the full path to specified files.
@@ -62,9 +63,6 @@ def which(fname, **kwargs):
62
63
FileNotFoundError
63
64
If the file is not found.
64
65
"""
65
- if is_nonstr_iter (fname ): # Got a list of files
66
- fname = " " .join (fname )
67
-
68
66
with GMTTempFile () as tmpfile :
69
67
with Session () as lib :
70
68
lib .call_module (
You can’t perform that action at this time.
0 commit comments