Skip to content

[WIP/Experimental] Capturing objects. Bokeh test case#324

Closed
Titan-C wants to merge 19 commits intosphinx-gallery:masterfrom
Titan-C:bokeh
Closed

[WIP/Experimental] Capturing objects. Bokeh test case#324
Titan-C wants to merge 19 commits intosphinx-gallery:masterfrom
Titan-C:bokeh

Conversation

@Titan-C
Copy link
Copy Markdown
Member

@Titan-C Titan-C commented Dec 14, 2017

I gave it a try on how to capture objects. This takes on the work proposed PR#313

I would also like to have PR #311 dealing with encodings, and PR #239 which is only some refactoring of the functions in gen_rst dealing with the rst files generation merged first.

I base this PR on the idea that the object capturer shall return directly the rst representation for direct embedding in the HTML.
I have seen that a big problem with capturing arbitrary objects is that, unlike matplotlib or mayavi there is no state machine to know what is plotted. Thus scrapers of png images where proposed. In this PR I propose to allow the capture function to access the state dictionary of the executed example and the source code of the block. Then I allow myself to specify as a comment in the source code what has to be captured.

Comment thread CHANGES.rst

* Fix __future__ imports across cells. See `#308
<https://github.com/sphinx-gallery/sphinx-gallery/pull/308>` for more details.
<https://github.com/sphinx-gallery/sphinx-gallery/pull/308>`_ for more details.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

😞 the syntax for rst link is something I will never get right on the first attempt I am afraid. I have fixed that in master.

@lesteve lesteve force-pushed the master branch 3 times, most recently from 0c1f0d4 to 49d4f11 Compare June 13, 2018 18:18
larsoner and others added 10 commits August 6, 2018 18:23
[MRG] Add note at the beginning of the example to the download section at the bottom (sphinx-gallery#362)

* Note at the beginning of the example linking to download section

* Add class to download link note

Update misleading doc about `download_all_examples` (sphinx-gallery#377)

Support for custom default thumbnails in 'RGBA' space (sphinx-gallery#375)

PEP 8

API: Refactor image scraping

FIX: str

FIX: Revert tinybuild changes

FIX: Fix doc

FIX: Fix example
@codecov-io
Copy link
Copy Markdown

codecov-io commented Aug 10, 2018

Codecov Report

Merging #324 into master will decrease coverage by 1.57%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #324      +/-   ##
=========================================
- Coverage   95.38%   93.8%   -1.58%     
=========================================
  Files          27      24       -3     
  Lines        2013    2130     +117     
=========================================
+ Hits         1920    1998      +78     
- Misses         93     132      +39
Impacted Files Coverage Δ
sphinx_gallery/tests/test_gen_rst.py 98.15% <100%> (-0.57%) ⬇️
sphinx_gallery/utils.py 100% <100%> (ø) ⬆️
sphinx_gallery/gen_gallery.py 86.05% <74%> (-3.89%) ⬇️
sphinx_gallery/gen_rst.py 93.59% <86.9%> (-2.49%) ⬇️
sphinx_gallery/sphinx_compatibility.py 95.65% <0%> (-4.35%) ⬇️
sphinx_gallery/docs_resolv.py 80.71% <0%> (-3.14%) ⬇️
sphinx_gallery/binder.py 92.92% <0%> (-3.04%) ⬇️
sphinx_gallery/backreferences.py 95.9% <0%> (-0.82%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d6015c...c9e8c89. Read the comment docs.

@Titan-C
Copy link
Copy Markdown
Member Author

Titan-C commented Aug 10, 2018

This is working on my machine. Getting the dependencies installed correctly in CI is a kind of a pain. But you can test on your machine.

@Titan-C
Copy link
Copy Markdown
Member Author

Titan-C commented Aug 10, 2018

Dependencies on Circle CI are good. Don't understand why it doesn't work. I'll try other day.

@Titan-C
Copy link
Copy Markdown
Member Author

Titan-C commented Aug 13, 2018

@Titan-C Titan-C mentioned this pull request Aug 29, 2018
5 tasks
@larsoner
Copy link
Copy Markdown
Contributor

I think most of the necessary functionality now exists in master so I'll close, feel free to reopen if you want to come back to this. Though the rebase alone will be a nightmare

@larsoner larsoner closed this Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants