-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix example links #11547
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 example links #11547
Conversation
How come our tests didn't pick this up? |
They are either used as I've changed some of them to |
Ok, good to know. Thanks for doing this work! I started reviewing, but got distracted in the middle. |
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.
Looks good.
@@ -358,7 +358,7 @@ class bytespdate2num(strpdate2num): | ||
""" | ||
Use this class to parse date strings to matplotlib datenums when | ||
you know the date format string of the date you are parsing. See | ||
:file:`examples/misc/load_converter.py`. | ||
:doc:`/gallery/misc/load_converter.py`. |
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 was not able to find this section in the rendered docs. I looked for it in
https://10869-1385122-gh.circle-artifacts.com/0/home/circleci/project/doc/build/html/api/dates_api.html#module-matplotlib.dates
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.
Yeah, I don't think these helper functions ever show up in the API... Maybe should have a separate issue?
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.
This and bytespdate2num are not included in __all__
and that's probably the reason they are not listed in the docs.
From a quick look in the code they are only used in an example https://matplotlib.org/gallery/ticks_and_spines/date_index_formatter.html?highlight=bytespdate2num and imported with pylab.
They seem to be a heavy way for what can also be achieved with a simple function and partial
:
def strdate2num(s, fmt)
and converter = partial(strdate2num, fmt='%y-%m-%d')
By me, they could be deprecated or left as is. But it's good that they are not advertised in the docs. But that would really be a discussion for a separate issue - if anyone wants to pick that up.
Thanks @timhoffm ! |
PR Summary
Fix a number of broken example links and related docs.