Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: suppress offset text in ConciseDateFormatter when largest scale is in years #19141

Merged
merged 3 commits into from
Dec 22, 2020

Conversation

harrymknight
Copy link
Contributor

@harrymknight harrymknight commented Dec 17, 2020

PR Summary

Currently ConciseDateFormatter includes redundant offset text when largest scale is in months or years. This PR suppresses this behaviour and closes #19118.

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@jklymak
Copy link
Member

jklymak commented Dec 17, 2020

Yeah I'd add a unit test, but it could just check that the offset text is suppressed rather than being an image test. Thanks!

… years

Add tests for offset text in ConciseDateFormatter
Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks a lot.

The only minor suggestion I would have is that you could do all the datetime stuff with datetime64, but that is really a matter of taste

@QuLogic QuLogic merged commit e164fbb into matplotlib:master Dec 22, 2020
@QuLogic
Copy link
Member

QuLogic commented Dec 22, 2020

Thanks @harrymknight! Congratulations on your first PR to Matplotlib 🎉 We hope to hear from you again.

@jklymak
Copy link
Member

jklymak commented Dec 22, 2020

Yes, thanks @harrymknight !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConciseDateFormatter should suppress offset text when largest scale is in years
3 participants