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

Appearance settings

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

Merged
merged 1 commit into from
Jul 3, 2018
Merged

Fix example links #11547

merged 1 commit into from
Jul 3, 2018

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Jul 1, 2018

PR Summary

Fix a number of broken example links and related docs.

@timhoffm timhoffm added this to the v3.0 milestone Jul 1, 2018
@NelleV
Copy link
Member

NelleV commented Jul 2, 2018

How come our tests didn't pick this up?

@timhoffm
Copy link
Member Author

timhoffm commented Jul 2, 2018

They are either used as :file: which is apparently only rendered as literal but not checked, or they are part of example code blocks and thus also just used literally.

I've changed some of them to :doc: to give a clickable link where appropriate.

@NelleV
Copy link
Member

NelleV commented Jul 2, 2018

Ok, good to know. Thanks for doing this work! I started reviewing, but got distracted in the middle.

Copy link
Member

@efiring efiring 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.

@@ -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`.
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

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?

Copy link
Member Author

@timhoffm timhoffm Jul 3, 2018

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.

@NelleV NelleV merged commit 50b1abf into matplotlib:master Jul 3, 2018
@NelleV
Copy link
Member

NelleV commented Jul 3, 2018

Thanks @timhoffm !

@timhoffm timhoffm deleted the example-links branch July 3, 2018 16:36
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.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.