Add datetime testing skeleton#26859
Merged
story645 merged 3 commits intomatplotlib:mainfrom Sep 22, 2023
Merged
Conversation
Member
timedeltas though totally - thinking particularly of the American time use survey |
Member
Author
|
put pie back |
ksunden
approved these changes
Sep 21, 2023
Member
Author
|
If we merge this I will write up a tracking issue with checklist of the methods + links etc for tomorrow. |
QuLogic
reviewed
Sep 21, 2023
| N = 6 | ||
| fig, ax = plt.subplots() | ||
| x = np.array([datetime.datetime(2023, 1, n) for n in range(1, N)]) | ||
| ax.plot(x, range(1, N)) |
Member
There was a problem hiding this comment.
Should you also test ax.plot(range(1, N), x) and/or ax.plot(x, x)? It might be good to give an example of what to do when multiple arguments accept units.
timedeltas make sense
d6f8f16 to
604152e
Compare
Member
Author
Member
|
I think we can skip psd etc. I cannot really see a way to use dates there. |
604152e to
de6919c
Compare
Member
Author
64 tasks
This was referenced Oct 7, 2023
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This is prep work for the 2023 GHC OSD event.
Although we nominally support units through all of our plotting APIs, this is not actually tested. As the most common "unitful" data is likely datetime, this is using datetime as the vehicle to exhaustively test which of the methods correctly handle units.
The ask of the volunteers will be to pick a method and write/find an example that passes
datetime64ortimedelta64arrays to as many of the inputs as make sense. Thenax.piemakes no sense with dates as the input so I pre-emptively removed it...although maybe with timedelta?) open a PR removing that stub testUnfortunately I did not get the test image overhaul done in time so I want to avoid adding test images for now, but smoke tests are still an improvement and once that lands it should be possible to "just" add a decorator to the tests to generate the images in the future.