Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions pygmt/helpers/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,15 +757,12 @@ def new_module(*args, **kwargs):
else:
continue

issequence = fmt in separators
if issequence and is_nonstr_iter(value):
if fmt in separators and is_nonstr_iter(value):
for index, item in enumerate(value):
try:
if " " in str(item):
# Check if there is a space " " when converting
# a pandas.Timestamp/xr.DataArray to a string.
# If so, use np.datetime_as_string instead.
assert " " not in str(item)
except AssertionError:
Comment on lines +762 to -768
Copy link
Member

@weiji14 weiji14 Dec 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, looking back at #562 (comment), not sure why I went with try-except instead of just an if-then check 😅

# Convert datetime-like item to ISO 8601
# string format like YYYY-MM-DDThh:mm:ss.ffffff.
value[index] = np.datetime_as_string(
Expand Down