File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed
Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 55
66from packaging .version import Version
77from 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
99
1010__doctest_skip__ = ["timestamp" ]
1111
1212
13+ @kwargs_to_strings (offset = "sequence" )
1314def timestamp (
1415 self ,
1516 text = None ,
@@ -83,14 +84,11 @@ def timestamp(
8384 kwdict ["U" ] += f"{ label } "
8485 kwdict ["U" ] += f"+j{ justification } "
8586
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" ):
8988 # Giving a single offset doesn't work in GMT <= 6.4.0.
9089 # 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 } "
9492
9593 # The +t modifier was added in GMT 6.5.0.
9694 # See https://github.com/GenericMappingTools/gmt/pull/7127.
Original file line number Diff line number Diff line change 66 GMTTempFile ,
77 build_arg_string ,
88 fmt_docstring ,
9- is_nonstr_iter ,
9+ kwargs_to_strings ,
1010 use_alias ,
1111)
1212
1313
1414@fmt_docstring
1515@use_alias (G = "download" , V = "verbose" )
16+ @kwargs_to_strings (fname = "sequence_space" )
1617def which (fname , ** kwargs ):
1718 r"""
1819 Find the full path to specified files.
@@ -62,9 +63,6 @@ def which(fname, **kwargs):
6263 FileNotFoundError
6364 If the file is not found.
6465 """
65- if is_nonstr_iter (fname ): # Got a list of files
66- fname = " " .join (fname )
67-
6866 with GMTTempFile () as tmpfile :
6967 with Session () as lib :
7068 lib .call_module (
You can’t perform that action at this time.
0 commit comments