Skip to content

Doc: Update timeline example #13719

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

Conversation

ImportanceOfBeingErnest
Copy link
Member

PR Summary

Update timeline example to fetch data from the github API. This will allow the example to update itself once new matplotlib versions are released.
Unlike in its initial proposal in #11403, this is embaced in a try.. except, such that the doc build will not fail in case no internet connection can be established.
Also it now uses a stem (and is hence useful to show stem usage).

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

if 'rc' not in item['tag_name'] and 'b' not in item['tag_name']:
dates.append(item['published_at'].split("T")[0])
names.append(item['tag_name'])
except:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
except:
except Exception:

No bare except (see last paragraph of https://docs.python.org/2/howto/doanddont.html#except). Not that it really matters here, but we shouldn't use bad style.

use_line_collection=True)

plt.setp(markerline, mec="k", mfc="w", zorder=3)
markerline.set_ydata(np.zeros(len(dates)))
Copy link
Member

Choose a reason for hiding this comment

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

This is a hack on the original purpose of stem. Not sure I like it, but OTOH, the loop before wasn't good either. At least, this needs explanation.

@ImportanceOfBeingErnest ImportanceOfBeingErnest force-pushed the doc-timeline-example-update branch from 6c1dcb5 to 34c4d4b Compare March 23, 2019 23:18
@ImportanceOfBeingErnest
Copy link
Member Author

@timhoffm Do the new changes reflect the points you raised?

The docbuild fails for no apparent (to me) reason. Any idea what the problem is?

@timhoffm
Copy link
Member

Doc failure might be due to the warnings to be fixed by #13743 which first needs #13745.

@jklymak jklymak merged commit b9bb208 into matplotlib:master Mar 25, 2019
@QuLogic
Copy link
Member

QuLogic commented Mar 25, 2019

@meeseeksdev backport to v3.1.x

meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Mar 25, 2019
@QuLogic QuLogic modified the milestones: v3.1-doc, v3.1.0 Mar 25, 2019
timhoffm added a commit that referenced this pull request Mar 26, 2019
…719-on-v3.1.x

Backport PR #13719 on branch v3.1.x (Doc: Update timeline example)
@ImportanceOfBeingErnest ImportanceOfBeingErnest deleted the doc-timeline-example-update branch August 2, 2019 22:14
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