Skip to content

Commit 9fb52d6

Browse files
committed
Improve the data_kind function to support multiple files
1 parent 401b4f4 commit 9fb52d6

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
@@ -173,7 +173,11 @@ def data_kind(data=None, x=None, y=None, z=None, required_z=False, required_data
173173
'image'
174174
"""
175175
# determine the data kind
176-
if isinstance(data, str | pathlib.PurePath):
176+
if isinstance(data, str | pathlib.PurePath) or (
177+
isinstance(data, list | tuple)
178+
and all(isinstance(_file, str | pathlib.PurePath) for _file in data)
179+
):
180+
# One or more files
177181
kind = "file"
178182
elif isinstance(data, bool | int | float) or (data is None and not required_data):
179183
kind = "arg"

0 commit comments

Comments
 (0)