Skip to content
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

capture rich output as well as stdout/err in capture_output #3744

Merged
merged 7 commits into from Aug 19, 2013

Conversation

minrk
Copy link
Member

@minrk minrk commented Jul 23, 2013

closes #3742

@ivanov
Copy link
Member

ivanov commented Jul 24, 2013

I provided this feedback verbally to Min, but it'd be nice to get the rich displays as an attribute of the capture variable in the same way we can already get stdout and stderr. Min said he could make them available.

%%capture the_output
display(...)
...

and then the same way you can already do the_output.stdout, the_output.stderr
you'll be able to do

the_output.display[0]

and get a handle on that image, or whatever it was.

Pinging @qili1g, who was interested in this issue.

@qili1g
Copy link

qili1g commented Jul 24, 2013

I want to stay updated

@qili1g
Copy link

qili1g commented Jul 25, 2013

Thank you for update the code for the function "grab rich output", we test it, it works

@qili1g
Copy link

qili1g commented Jul 25, 2013

we need to maybe understand how far out or a release this would be

@ivanov
Copy link
Member

ivanov commented Jul 25, 2013

it will be merged inside the code soon after we release 1.0, and will make the next stable release around December

@Carreau
Copy link
Member

Carreau commented Aug 10, 2013

can we merge now ?

@ivanov
Copy link
Member

ivanov commented Aug 13, 2013

let's not merge this without an update to the examples (see how I did the double negative there? I'm getting better not getting worse at this.

i'll cook something up and send Min a PR tonight

@ivanov
Copy link
Member

ivanov commented Aug 17, 2013

I sent @minrk a PR that documents this new features, and adds a --no-display flag to %%capture (to go along with the --no-stdout and --no-stderr flags which were already there. Also added docstrings to the properties and the CapturedIO object. minrk#7

@minrk
Copy link
Member Author

minrk commented Aug 17, 2013

Thanks, merged your PR and rebased. I will try to add a few tests, so that this can be merged.

@minrk
Copy link
Member Author

minrk commented Aug 17, 2013

added some tests

@ivanov
Copy link
Member

ivanov commented Aug 17, 2013

looks good - I was going to comment about how we decided a while back (scipy 2011?) that we shouldn't use generators in tests because nose would stop iterating on first failure, but by the looks of it, this issue has gone away (or never existed for the particular way in which you're using yield and nose). @fperez might remember better, maybe this only applied to the parametric tests?

they are very similar

add another test for good measure.
@minrk
Copy link
Member Author

minrk commented Aug 17, 2013

Yeah - I chatted with @fperez about that a week or two ago. I can remove the generators, but I like the visual feedback they provide about how much is actually tested, rather than how many functions I happen to have written.

@minrk
Copy link
Member Author

minrk commented Aug 17, 2013

@ivanov want to write an IPEP about removing test generators :)

ivanov added a commit that referenced this pull request Aug 19, 2013
capture rich output as well as stdout/err in capture_output
@ivanov ivanov merged commit e429a57 into ipython:master Aug 19, 2013
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
capture rich output as well as stdout/err in capture_output
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.

%%capture to grab rich display outputs
4 participants