Skip to content

Commit

Permalink
Add tests for sequence of pd.Timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Jan 10, 2025
1 parent 8bb416d commit 892f444
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pygmt/tests/baseline/test_plot_datetime.png.dvc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
outs:
- md5: 583947facaa873122f0bf18137809cd4
size: 12695
- md5: 0a2eae0da1e3d5b71d7392de1c081346
size: 13124
path: test_plot_datetime.png
hash: md5
7 changes: 6 additions & 1 deletion pygmt/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,14 @@ def test_plot_datetime():
fig.plot(x=x, y=y, style="a0.2c", pen="1p")

# the Python built-in datetime and date
x = [datetime.date(2018, 1, 1), datetime.datetime(2019, 1, 1)]
x = [datetime.date(2018, 1, 1), datetime.datetime(2019, 1, 1, 0, 0, 0)]
y = [8.5, 9.5]
fig.plot(x=x, y=y, style="i0.2c", pen="1p")

# Python sequence of pd.Timestamp
x = [pd.Timestamp("2018-01-01"), pd.Timestamp("2019-01-01")]
y = [5.5, 6.5]
fig.plot(x=x, y=y, style="d0.2c", pen="1p")
return fig


Expand Down

0 comments on commit 892f444

Please sign in to comment.