Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add datetime testing skeleton#26859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
story645 merged 3 commits intomatplotlib:mainfromtacaswell:tst/dt_skel
Sep 22, 2023
Merged

Conversation

tacaswell
Copy link
Member

@tacaswelltacaswell commentedSep 21, 2023
edited
Loading

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 passesdatetime64 ortimedelta64 arrays to as many of the inputs as make sense. Then

  1. if this works, open a PR adding the implementation as a test to this file + the output of the example when run as an image
  2. if this fails decide if:
    1. it should not work (for exampleax.pie makes no sense with dates as the input so I pre-emptively removed it...although maybe with timedelta?) open a PR removing that stub test
    2. if it should work open an issue with the failing example

Unfortunately 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.

@tacaswelltacaswell added this to thev3.9.0 milestoneSep 21, 2023
@story645
Copy link
Member

ax.pie makes no sense with dates as the input so I pre-emptively removed it...although

timedeltas though totally - thinking particularly of theAmerican time use survey

@tacaswell
Copy link
MemberAuthor

put pie back

story645 reacted with thumbs up emoji

@tacaswell
Copy link
MemberAuthor

If we merge this I will write up a tracking issue with checklist of the methods + links etc for tomorrow.

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))
Copy link
Member

Choose a reason for hiding this comment

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

Should you also testax.plot(range(1, N), x) and/orax.plot(x, x)? It might be good to give an example of what to do when multiple arguments accept units.

story645 reacted with thumbs up emoji
timedeltas make sense
@tacaswell
Copy link
MemberAuthor

so

which....looks not great

@oscargus
Copy link
Member

I think we can skip psd etc. I cannot really see a way to use dates there.

@tacaswell
Copy link
MemberAuthor

so

That looks better.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@ksundenksundenksunden approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.9.0
Development

Successfully merging this pull request may close these issues.

5 participants
@tacaswell@story645@oscargus@QuLogic@ksunden

[8]ページ先頭

©2009-2025 Movatter.jp