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 Apr 8, 2024
1 parent f7fe562 commit 1667a0a
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 @@ -174,7 +174,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 1667a0a

Please sign in to comment.