-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add tests for date module #23013
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
Add tests for date module #23013
Conversation
FWIW we already require dateutil>=2.7 (in setup.py). |
Then the only problem remaining is that none of the special handling is actually tested, so hard to say if something breaks when removed... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty confused by this. So far as I can tell we don't call date_ticker_factory
in the code base. Am I missing some magic somewhere? Its always better to test the user facing interface, rather than the helper (which should probably be private). So does this actually do anything for the user? If so, what is the example?
I was under the impression that it is used to return a suitable set of locator and formatter if one inputs a range in days. It is 17 years old, so I assume that someone uses it. But you are right that it is not used in the code base nor is it in the documentation. Personally, I stumbled upon it while trying to increase test coverage. |
My vote would be to not improve it, and to deprecate it. It doesn't make sense for us to maintain a different ticker algorithm that we don't use or test, and if someone is using it, they can vendor. |
|
Sure, I can deprecate it then. |
90d034c
to
e2a14ef
Compare
Removed the changes to |
Needs a rebase, but otherwise looks good. |
Rebased. |
Gah! Rebased the wrong version... Will continue when on the computer with the latest version... |
Rebased the correct version... |
PR Summary
Extendeddate_ticker_factory
to returnSecondLocator
andMicrosecondlocator
. The format strings can be discussed.Removed dead code.
Added tests for more cases in
dates
.Should we remove the special handling for dateutil <= 2.3? 2.4 appears to have been release 2014-2015 or so.
matplotlib/lib/matplotlib/dates.py
Lines 1526 to 1528 in 65e9620
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).