pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/ipython/ipython/pull/11671

ts/global-0bd78641c0a1f3e0.css" /> Add a -q parameter to %rerun magic by MatthewWilkes · Pull Request #11671 · ipython/ipython · GitHub
Skip to content

Add a -q parameter to %rerun magic#11671

Open
MatthewWilkes wants to merge 1 commit intoipython:mainfrom
MatthewWilkes:quiet-rerun
Open

Add a -q parameter to %rerun magic#11671
MatthewWilkes wants to merge 1 commit intoipython:mainfrom
MatthewWilkes:quiet-rerun

Conversation

@MatthewWilkes
Copy link
Copy Markdown

This allows the rerun magic to be run in quiet mode, which suppresses
the === Executing: === and === Output: === headings as well as the
text of the cell being re-run. This means that cells that print can
optionally be re-run as part of a larger control structure like a loop
without IPython-specific noise.


-g foo : Repeat the most recent line which contains foo

-q : Quiet mode: do not echo the cell contents back
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I like this change, but could you make it clearer in the help docs that quiet means to suppress the history lines specifically? A user will still see any output from the command, right? "Quiet" usually implies that all regular output will be suppressed (i.e. non-errors) or maybe just lower verbosity.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Documentation tone can often be the hardest part of a contribution. I've reworded this, but let me know if it's still not quite right, or feel free to specify wording yourself if you'd like.

with capture_output() as cap:
ip.run_cell("%rerun -q", store_history=True)
nt.assert_equal(ip.user_ns["a"], 12)
nt.assert_not_in("a += 1", cap.stdout)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice work on the tests!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, nice work on the support functions like capture_output! ;)

This allows the rerun magic to be run in quiet mode, which suppresses
the `=== Executing: ===` and `=== Output: ===` headings as well as the
text of the cell being re-run. This means that cells that print can
optionally be re-run as part of a larger control structure like a loop
without IPython-specific noise.
@MatthewWilkes
Copy link
Copy Markdown
Author

I'm struggling to fix the sphinx build issue on Py3.7 here. I can't seem to build the docs locally, but I tried adding a newline to the options section as the output suggested to no effect.

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.

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy