Skip to content

Commit 1667a0a

Browse files
committed
Improve the data_kind function to support multiple files
1 parent f7fe562 commit 1667a0a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pygmt/helpers/utils.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ def data_kind(data=None, x=None, y=None, z=None, required_z=False, required_data
174174
'image'
175175
"""
176176
# determine the data kind
177-
if isinstance(data, str | pathlib.PurePath):
177+
if isinstance(data, str | pathlib.PurePath) or (
178+
isinstance(data, list | tuple)
179+
and all(isinstance(_file, str | pathlib.PurePath) for _file in data)
180+
):
181+
# One or more files
178182
kind = "file"
179183
elif isinstance(data, bool | int | float) or (data is None and not required_data):
180184
kind = "arg"

0 commit comments

Comments
 (0)