Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Jan 9, 2025

@seisman seisman added the bug Something isn't working label Jan 9, 2025
@seisman seisman added this to the 0.15.0 milestone Jan 9, 2025
@seisman seisman added the needs review This PR has higher priority and needs review. label Jan 9, 2025
weiji14
weiji14 previously approved these changes Jan 9, 2025
@weiji14 weiji14 dismissed their stale review January 9, 2025 18:08

Decided that #3758 (comment) might be worth adding

@weiji14
Copy link
Member

weiji14 commented Jan 9, 2025

Originally posted by @seisman in #3758 (comment)

Maybe we should extend the unit test to include pandas.Timestamp? E.g. adding these lines:

    # list of pandas.Timestamp
    x = [pd.Timestamp("2020-1-1"), pd.Timestamp("2021-1-1")]
    y = [10.5, 11.5]
    fig.plot(x=x, y=y, style="h0.2c", pen="1p")

See the explanations above. As long as _to_numpy can convert a datetime-like object into np.datetime64 array correctly, PyGMT should be able to plot/process it. So, I think the newly added tests are enough.

Still think we should have an integration test of some sort for Sequence[pd.Timestamp], or maybe Sequence[pyarrow.TimestampScalar]. We should cover both np.object_ and np.str_ type arrays, in case the internal virtualfile_from_vectors->vectors_to_arrays->_to_numpy logic ever changes.

@weiji14 weiji14 modified the milestones: 0.15.0, 0.14.1 Jan 9, 2025
@seisman
Copy link
Member Author

seisman commented Jan 10, 2025

OK, added a test in 892f444 / #3758.

@seisman seisman mentioned this pull request Jan 10, 2025
33 tasks
@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Jan 11, 2025
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Jan 13, 2025
@seisman seisman merged commit 8b9ec5a into main Jan 13, 2025
21 checks passed
@seisman seisman deleted the fix/datetime branch January 13, 2025 00:11
seisman added a commit that referenced this pull request Jan 17, 2025
…3760)

Convert unrecognized objects to datetime before converting to string dtype
seisman added a commit that referenced this pull request Jan 17, 2025
…3760) (#3773)

Convert unrecognized objects to datetime before converting to string dtype
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plot no longer accepts date/time data in pygmt 0.14

4 participants