newbie how to reflow comments?

979 views
Skip to first unread message

Andy Davidson

unread,
Apr 18, 2017, 3:18:55 PM4/18/17
to 'Ryan Blue' via Project Jupyter
Hi 

One features I mis from R-studio is the ability to reflow comments. For example lets say I paste the following comment in a code cell

"This dataset checks that your code always picks the first-occurring Profile-most Probable k-mer in a given sequence of Dna. In the first sequence (“GCCCAA”), “GCC” and “CCA” are both Profile-most Probable k-mers. However, you must return “GCC” since it occurs earlier than “CCA”. Thus, if the first sequence of your output is “CCA”, this test case fails your code.”

After “reflow” the comment looks like

# test data set 1
# This dataset checks that your code always picks the first-occurring 
# Profile-most Probable k-mer in a given sequence of Dna. In the first 
# sequence (“GCCCAA”), “GCC” and “CCA” are both Profile-most Probable 
# k-mers. However, you must return “GCC” since it occurs earlier than
# “CCA”. Thus, if the first sequence of your output is “CCA”, this test 
# case fails your code.


Now if I go through and edit the commented section all I have to is ‘re-flow’ and it will reformat my comments so that no line is more than a fixed length

Kind regards

Andy

P.s. I am using a mac. Hopefully their is a keyboard short cut


Brian Granger

unread,
Apr 19, 2017, 12:27:55 AM4/19/17
to Project Jupyter
+1 fully agree!

I have opened an issue on the JupyterLab repo where we would implement this:

https://github.com/jupyterlab/jupyterlab/issues/2056
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+u...@googlegroups.com.
> To post to this group, send email to jup...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/D51BB4A3.572D9%25Andy%40SantaCruzIntegration.com.
> For more options, visit https://groups.google.com/d/optout.



--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgra...@calpoly.edu and elli...@gmail.com

Jonathan Whitmore

unread,
Apr 19, 2017, 12:40:07 AM4/19/17
to Project Jupyter
So, I don't know a command that'll automatically take a long string and make it a fixed-width, but a Jupyter Notebook shortcut to quickly comment a block of code is to type: 

⌘/

command + slash will toggle comment/uncomment a block of code. This works in both python and R flavors of the notebook. (type ESC while in a notebook to get to command mode, then "H" for a longer list of shortcuts).
Reply all
Reply to author
Forward
0 new messages