Skip to content

[wip] Doc cleanup for examples/color/color_cycle and examples/animation/animated_histogram #8890

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

Closed
wants to merge 759 commits into from
Closed

Conversation

johnh2o2
Copy link
Contributor

@johnh2o2 johnh2o2 commented Jul 15, 2017

PR Summary

Scipy 2017 sprint! Working on improving the documentation with better
sphinx-gallery integration. I've added some more documentation to
the examples/animation/animated_histogram and the examples/color/color_cycle sections. I've also moved the color_cycle from examples/color to tutorials/02_Intermediate, since it seemed more like something users would be interested in doing regularly, and I've worded it more like a tutorial. Not sure how people feel about that.

PR Checklist

  • [n/a] Has Pytest style unit tests
  • Code is PEP 8 compliant
  • [n/a] New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • [n/a] Added an entry to doc/users/whats_new.rst if major new feature
  • [n/a] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@johnh2o2
Copy link
Contributor Author

johnh2o2 commented Jul 15, 2017

This also addresses the doc issues in #8885 @choldgraf

@choldgraf
Copy link
Contributor

choldgraf commented Jul 16, 2017

Nice! I'll give it a look when I'm back in Berkeley and will give some comments!

(if you're looking for something to work on quickly, I noticed that you use single tickmarks for comments, while rST uses double backticks (``). Also make sure that you've always got whitespace around operators (e.g.,a = 2 + 2, not a = 2+2)

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Jul 16, 2017
# it to keep the codes aligned with the vertices
###############################################################################
# Here comes the tricky part -- we have to set up the vertex and path codes
# arrays using `plt.Path.MOVETO`, `plt.Path.LINETO` and `plt.Path.CLOSEPOLY`
Copy link
Contributor

Choose a reason for hiding this comment

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

`` double backticks for rST (do this here and in all subsequent uses of backticks)

# v4 to our initial vertex (the `MOVETO` vertex), in order to close the
# polygon.
#
# Note: the vertex for `CLOSEPOLY` is ignored, but we still need a placeholder
Copy link
Contributor

Choose a reason for hiding this comment

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

this could be .. note::

# First we'll generate some sample data, in this case, four offset sine
# curves.
x = np.linspace(0, 2 * np.pi, 50)
offsets = np.linspace(0, 2*np.pi, 4, endpoint=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

spaces around the *

print(yy.shape)

###############################################################################
# So `yy[:,i]` will give you the `i`-th offset sine curve. Let's set the
Copy link
Contributor

Choose a reason for hiding this comment

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

space after :, (sorry I'm being persnickety about this)


###############################################################################
# So `yy[:,i]` will give you the `i`-th offset sine curve. Let's set the
# default prop_cycle using `plt.rc`. We'll combine a color cycler and a
Copy link
Contributor

@choldgraf choldgraf Jul 21, 2017

Choose a reason for hiding this comment

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

here could you try linking to rc with an rST :func: (or maybe just a :ref: since I believe rc isn't actually a function)? I think that'll make it link nicely in the docs

ax0.plot(yy)
ax0.set_title('Set default color cycle to rgby')

###############################################################################
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably don't want the line of ###### here since we're plotting on the same figure

Copy link
Contributor

Choose a reason for hiding this comment

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

just to clarify, in general we shouldn't split a single figure between two ####### blocks of code

@choldgraf
Copy link
Contributor

Just had a closer look - it looks really nice. A few styling comments to take care of and then once the tests pass I'm +1. Lemme know when you take care of that @johnh2o2

@choldgraf choldgraf mentioned this pull request Jul 21, 2017
4 tasks
@WeatherGod
Copy link
Member

Ping! This definitely would be a nice improvement to have. Let us know if you are having difficulties with rebasing.

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Aug 29, 2017
efiring and others added 13 commits September 18, 2017 15:08
Remove start_event_loop_default.  Let pause() run the event loop for all backends.
 - put draw_idle in the base canvas resize event
 - re-order our resize handling and Qt's resize handling (let Qt go
   first)
 - do not call processEvents from inside of the paint event (this
   maybe the critical fix)
CI: Tweak conda installation on appveyor
Convert tick-setting methods to docstrings
Don't fail on empty autoscale_None.
Convert tick-setting methods to docstrings
@choldgraf
Copy link
Contributor

pinging @johnh2o2 :-)

anntzer and others added 22 commits October 9, 2017 11:01
* deleted circled in green

* deleted space

* removed blue box
DOC: Add descriptions for remaining event handling examples
Fix typo of pixels in legend_handler.py
Update descriptions for images_contours_and_fields
FIX: poorly done deprecation in image.py.
Fix edgecolor being only applied to first bar.
…ow. Edited whats_new_1.5.rst to reflect changed location of the color_cycle.py from color/ to tutorials/02_intermediate
@johnh2o2
Copy link
Contributor Author

Hey @choldgraf , so I'm not sure that I've done things correctly with the rebasing....I apologize if I've caused more problems...

(I THINK) I've rebased with the upstream/master branch, but now running python make.py --allowsphinxwarnings html gives me a number of warnings about unreferenced documentation:

checking consistency... /Users/jah5/Documents/scipy2017/sprints/matplotlib/doc/gallery/lines_bars_and_markers/scatter_profile.rst: WARNING: document isn't included in any toctree
/Users/jah5/Documents/scipy2017/sprints/matplotlib/doc/gallery/pylab_examples/agg_buffer.rst: WARNING: document isn't included in any toctree
/Users/jah5/Documents/scipy2017/sprints/matplotlib/doc/gallery/pylab_examples/agg_buffer_to_array.rst: WARNING: document isn't included in any toctree
/Users/jah5/Documents/scipy2017/sprints/matplotlib/doc/gallery/pylab_examples/anchored_artists.rst: WARNING: document isn't included in any toctree
/Users/jah5/Documents/scipy2017/sprints/matplotlib/doc/gallery/pylab_examples/anscombe.rst: WARNING: document isn't included in any toctree
/Users/jah5/Documents/scipy2017/sprints/matplotlib/doc/gallery/pylab_examples/arctest.rst: WARNING: document isn't included in any toctree
/Users/jah5/Documents/scipy2017/sprints/matplotlib/doc/gallery/pylab_examples/arrow_demo.rst: WARNING: document isn't included in any toctree
/Users/jah5/Documents/scipy2017/sprints/matplotlib/doc/gallery/pylab_examples/arrow_simple_demo.rst: WARNING: document isn't included in any toctree
...

Not sure if this is a result of failed rebasing or if these are acceptable warnings or what. Let me know what I should (or shouldn't) do on my end.

Thanks!

John

@choldgraf
Copy link
Contributor

whoah! it looks like there are now 636 files changed so that is almost certainly not correct haha. To be honest I think your best bet is to copy the test from the example that you've added (AKA the changes that were part of this initial PR), and start from scratch. I know that's a pain but it sounds like something very strange happened with the rebase.

How did you do the rebase? The correct commands from your fork would have been:

git checkout master
git pull upstream master
git checkout doc-improvements
git rebase master

@choldgraf
Copy link
Contributor

closed via #9408 ...thanks @johnh2o2 !!!

@choldgraf choldgraf closed this Oct 15, 2017
@QuLogic QuLogic modified the milestones: v2.2, v2.1.0-doc Oct 15, 2017
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.