Skip to content

Commit

Permalink
Improve the data_kind function to support multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Mar 22, 2024
1 parent 401b4f4 commit 9fb52d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pygmt/helpers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ def data_kind(data=None, x=None, y=None, z=None, required_z=False, required_data
'image'
"""
# determine the data kind
if isinstance(data, str | pathlib.PurePath):
if isinstance(data, str | pathlib.PurePath) or (
isinstance(data, list | tuple)
and all(isinstance(_file, str | pathlib.PurePath) for _file in data)
):
# One or more files
kind = "file"
elif isinstance(data, bool | int | float) or (data is None and not required_data):
kind = "arg"
Expand Down

0 comments on commit 9fb52d6

Please sign in to comment.