[jupyter] Create beautiful reactive GUIs for Python packages using Markdown and a few custom HTML elements

2018-02-12 Thread Simon Biggs
Scripted Forms


https://github.com/SimonBiggs/scriptedforms


Quickly create beautiful reactive GUIs for Python packages using Markdown 
and a few custom HTML elements. Under the hood it uses the Jupyter Notebook 
server, Angular, Angular Material, Phosphor and JupyterLab.


Display is based upon the cell output within JupyterLab's notebook so most 
items that display within the notebook should work here.


To quickly take it for a spin write:


pip install scriptedforms


Then open a python prompt (not an ipython prompt) and copy in the following:


import scriptedforms as sf
# workaround for https://github.com/SimonBiggs/scriptedforms/issues/24def 
create_file(filename, contents):
with open(filename, 'w') as f:
f.write(contents)

filename = 'quick-start.md'
markdown_contents = """# An 
exampleyour_name`print('Hello 
{}!'.format(your_name))`"""

create_file(filename, markdown_contents)
sf.load(filename)


See https://github.com/SimonBiggs/scriptedforms for how you can then edit 
the resulting markdown file and how you can use Scripted Forms to quickly 
make GUIs for your python package utilities.


Cheers,

Simon



-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/e066392b-9997-4184-8e8e-5b6865f31b91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] An example of what can be built with the JupyterLab ecosystem

2018-02-12 Thread Simon Biggs
Hi Fernando,

Thank you for the encouragement. Really chuffed that you want to include 
what I have done as an example in the talk you are giving. Puts a huge 
smile on my face. My supervisor was also quite impressed.

I shall re-post the link with a bit more prominent detail.

Thanks again :).
Cheers,
Simon


On Tuesday, 13 February 2018 08:32:33 UTC+11, Fernando Perez wrote:
>
> On Fri, Feb 9, 2018 at 7:27 PM, Simon Biggs  > wrote:
>
>> Is it okay if I resubmit this with a more informative title and more 
>> prominent link? I realised the way I presented it, it was very easy to pass 
>> over on the digest email...
>>
>
> No prob from me, always good to highlight how folks are adopting the JLab 
> architecture for new and productive uses (I'll actually try to include this 
> as a great example of this practice in an upcoming talk of mine where I'll 
> spend some time on JLab as a modular architecture that we want wide 
> adoption for :)
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/58a33bc5-0e8c-4a18-b2f7-195d3a5b3ae0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] Creating a new notebook inconsistent between home screen and within active notebook.

2018-02-12 Thread Fernando Perez
On Mon, Feb 12, 2018 at 5:08 PM, Mark Murphy  wrote:

> So normally when I try to create a new notebook I will go to the directory
> that I want the notebook and select "New" on the right side of the screen
> and "Python 3" for a new notebook.
>
> However after several updates I have noticed that when I do this the new
> notebook is created in the Jupyter start directory rather than the
> directory I am currently showing in the home page. No matter what folding I
> am in, it will always just create the new untitled document in the base
> directory. This is not just for Python but R NBs as well.
>
> There is a second way to make a new notebook. And this is from an already
> opened notebook. "File" -> "New Notebook" if I do this, then the new
> notebook is created in the same folder as the current notebook.
>
>
> Any ideas why the "New" option on the Home screen wont use the current
> directory? Any ideas how to reset this?
>

You're most likely experiencing this:

- https://github.com/jupyter/notebook/issues/3248
- https://github.com/jupyter/notebook/issues/3263

with notebook 5.3.1, sorry.  If so, an upgrade to 5.4.0 will solve the
issue:  https://github.com/jupyter/notebook/pull/3264.

Cheers,

f

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAHAreOrEPvMTqHtROLdHZWoOLHf7M6ix2VRF4gsuQtsnjxssMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[jupyter] Creating a new notebook inconsistent between home screen and within active notebook.

2018-02-12 Thread Mark Murphy
So normally when I try to create a new notebook I will go to the directory 
that I want the notebook and select "New" on the right side of the screen 
and "Python 3" for a new notebook.

However after several updates I have noticed that when I do this the new 
notebook is created in the Jupyter start directory rather than the 
directory I am currently showing in the home page. No matter what folding I 
am in, it will always just create the new untitled document in the base 
directory. This is not just for Python but R NBs as well.  

There is a second way to make a new notebook. And this is from an already 
opened notebook. "File" -> "New Notebook" if I do this, then the new 
notebook is created in the same folder as the current notebook. 


Any ideas why the "New" option on the Home screen wont use the current 
directory? Any ideas how to reset this? 

Thanks

Mark M

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/12cafbe2-1875-4b06-aa78-b2e9c9ef8f3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] How to know which config file is being used?

2018-02-12 Thread Nate L.
It ended up being a chrome extension called Vimium, which seems to 
overwrite shortcuts for a lot of sites.

On Monday, February 12, 2018 at 2:58:47 PM UTC-5, Nate L. wrote:
>
> You are so right.  I tried using this with Safari and everything works as 
> expected. I'll look into what extension in Chrome is getting in the way and 
> report back if I find out what it is.
>
> Thanks, Takowl!
>
>
> On Monday, February 12, 2018 at 2:24:55 PM UTC-5, takowl wrote:
>>
>> Sorry, I've never seen it before. If you don't know you've installed an 
>> extension, chances are it's something built into your browser.
>>
>> On 12 February 2018 at 17:28, Nate L.  wrote:
>>
>>> I don't think the search bar is something from a browser extension, (I 
>>> don't think I ever added it), but if it is, I'd love to remove it so I can 
>>> get back to good ol' Jupyter shortcuts :'(
>>>
>>> Would you know how to inspect whether it's an extension or not, and how 
>>> I can remove it?
>>>
>>> Thanks, Takowl!!!
>>>
>>> Best,
>>> Nathan
>>>
>>>
>>> On Monday, February 12, 2018 at 11:39:32 AM UTC-5, takowl wrote:

 Reinstalling probably won't make a difference to issues in the browser 
 like that, though it's always possible.

 Is the search bar something from a browser extension? If it captures 
 the key event before we get it, there's not much we can do about that.

 On 12 February 2018 at 16:33, Nate L.  wrote:

> Hi Takowl,
>
> Yea, I'm in the *notebook* command mode. Upon uninstalling the Vim 
> extension, I can now add cells with 'a', but that's about it. When I 
> press 
> 'b', I get the search bar pop-up:
>
>
> 
>
>
> Not sure what's wrong. Maybe I should reinstall jupyter?  The problem 
> with reinstallation is that there are so many ways to uninstall it that I 
> don't know which would be optimal for my case.
>
>
> On Monday, February 12, 2018 at 9:40:31 AM UTC-5, takowl wrote:
>>
>> Are you getting into *notebook* command mode? I don't use the vim 
>> extension myself, but from what I've heard, you press esc once to go 
>> from 
>> edit mode to vim command mode, and then again to go to notebook command 
>> mode. The cell selection cursor on the left should turn from green to 
>> blue 
>> when you switch to notebook command mode.
>>
>> On 12 February 2018 at 14:37, Nate L.  wrote:
>>
>>> Hi all,
>>>
>>> Thanks for the responses! Yes, I meant that the actions are not 
>>> shown in jupyter.
>>>
>>> Ok so now I've gotten it to the point where the vim commands are 
>>> working (the custom.css file is changing the colors of my prompt), but 
>>> now 
>>> the Jupyter commands are not working, so when I type DD or 'a' or 'b', 
>>> it's 
>>> not deleting or adding any extra cells.
>>>
>>> I've read that the problem is the vim extension, but the vim 
>>> extension is so good I don't really want to do without it.  
>>>
>>> Any thoughts as to why it's happening? 
>>>
>>> This is in my custom.js:
>>>
>>>
>>> 1 // Configure CodeMirror Keymap
>>>   2 require([
>>>   3   'nbextensions/vim_binding/vim_binding',   // depends your 
>>> installation
>>>   4 ], function() {
>>>   5   // Map jj to 
>>>   6   CodeMirror.Vim.map("jk", "", "insert");
>>>   7   // Swap j/k and gj/gk (Note that  mappings)
>>>   8   CodeMirror.Vim.map("j", "(vim-binding-gj)", "normal");
>>>   9   CodeMirror.Vim.map("k", "(vim-binding-gk)", "normal");
>>>  10   CodeMirror.Vim.map("gj", "(vim-binding-j)", "normal");
>>>  11   CodeMirror.Vim.map("gk", "(vim-binding-k)", "normal");
>>>  12 });
>>>  13
>>>  14 // Configure Jupyter Keymap
>>>  15 require([
>>>  16   'nbextensions/vim_binding/vim_binding',
>>>  17   'base/js/namespace',
>>>  18 ], function(vim_binding, ns) {
>>>  19   // Add post callback
>>>  20   vim_binding.on_ready_callbacks.push(function(){
>>>  21 var km = ns.keyboard_manager;
>>>  22 // Allow Ctrl-1 to change the cell mode into code in Vim 
>>> normal mode
>>>  23 km.edit_shortcuts.add_shortcut('ctrl-1', 
>>> 'vim-binding:change-cell-to-code', true);
>>>  24 /// Allow Ctrl-2 to change the cell mode into Markdown in 
>>> Vim normal mode
>>>  25 km.edit_shortcuts.add_shortcut('ctrl-2', 
>>> 'vim-binding:change-cell-to-markdown', true);
>>>  26 /// Allow Ctrl-3 to change the cell mode into code in Vim 
>>> normal mode
>>>  27 km.edit_shortcuts.add_shortcut('ctrl-3', 
>>> 'vim-binding:change-cell-to-raw', true);
>>>  28 // Delete cell 

Re: [jupyter] An example of what can be built with the JupyterLab ecosystem

2018-02-12 Thread Fernando Perez
On Fri, Feb 9, 2018 at 7:27 PM, Simon Biggs  wrote:

> Is it okay if I resubmit this with a more informative title and more
> prominent link? I realised the way I presented it, it was very easy to pass
> over on the digest email...
>

No prob from me, always good to highlight how folks are adopting the JLab
architecture for new and productive uses (I'll actually try to include this
as a great example of this practice in an upcoming talk of mine where I'll
spend some time on JLab as a modular architecture that we want wide
adoption for :)

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAHAreOrftFQC0Q2j2JDJhFMdH%2BCNbFSN6_%3Dz-7iKH92EwHwb9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] How to know which config file is being used?

2018-02-12 Thread Nate L.
You are so right.  I tried using this with Safari and everything works as 
expected. I'll look into what extension in Chrome is getting in the way and 
report back if I find out what it is.

Thanks, Takowl!


On Monday, February 12, 2018 at 2:24:55 PM UTC-5, takowl wrote:
>
> Sorry, I've never seen it before. If you don't know you've installed an 
> extension, chances are it's something built into your browser.
>
> On 12 February 2018 at 17:28, Nate L.  
> wrote:
>
>> I don't think the search bar is something from a browser extension, (I 
>> don't think I ever added it), but if it is, I'd love to remove it so I can 
>> get back to good ol' Jupyter shortcuts :'(
>>
>> Would you know how to inspect whether it's an extension or not, and how I 
>> can remove it?
>>
>> Thanks, Takowl!!!
>>
>> Best,
>> Nathan
>>
>>
>> On Monday, February 12, 2018 at 11:39:32 AM UTC-5, takowl wrote:
>>>
>>> Reinstalling probably won't make a difference to issues in the browser 
>>> like that, though it's always possible.
>>>
>>> Is the search bar something from a browser extension? If it captures the 
>>> key event before we get it, there's not much we can do about that.
>>>
>>> On 12 February 2018 at 16:33, Nate L.  wrote:
>>>
 Hi Takowl,

 Yea, I'm in the *notebook* command mode. Upon uninstalling the Vim 
 extension, I can now add cells with 'a', but that's about it. When I press 
 'b', I get the search bar pop-up:


 


 Not sure what's wrong. Maybe I should reinstall jupyter?  The problem 
 with reinstallation is that there are so many ways to uninstall it that I 
 don't know which would be optimal for my case.


 On Monday, February 12, 2018 at 9:40:31 AM UTC-5, takowl wrote:
>
> Are you getting into *notebook* command mode? I don't use the vim 
> extension myself, but from what I've heard, you press esc once to go from 
> edit mode to vim command mode, and then again to go to notebook command 
> mode. The cell selection cursor on the left should turn from green to 
> blue 
> when you switch to notebook command mode.
>
> On 12 February 2018 at 14:37, Nate L.  wrote:
>
>> Hi all,
>>
>> Thanks for the responses! Yes, I meant that the actions are not shown 
>> in jupyter.
>>
>> Ok so now I've gotten it to the point where the vim commands are 
>> working (the custom.css file is changing the colors of my prompt), but 
>> now 
>> the Jupyter commands are not working, so when I type DD or 'a' or 'b', 
>> it's 
>> not deleting or adding any extra cells.
>>
>> I've read that the problem is the vim extension, but the vim 
>> extension is so good I don't really want to do without it.  
>>
>> Any thoughts as to why it's happening? 
>>
>> This is in my custom.js:
>>
>>
>> 1 // Configure CodeMirror Keymap
>>   2 require([
>>   3   'nbextensions/vim_binding/vim_binding',   // depends your 
>> installation
>>   4 ], function() {
>>   5   // Map jj to 
>>   6   CodeMirror.Vim.map("jk", "", "insert");
>>   7   // Swap j/k and gj/gk (Note that  mappings)
>>   8   CodeMirror.Vim.map("j", "(vim-binding-gj)", "normal");
>>   9   CodeMirror.Vim.map("k", "(vim-binding-gk)", "normal");
>>  10   CodeMirror.Vim.map("gj", "(vim-binding-j)", "normal");
>>  11   CodeMirror.Vim.map("gk", "(vim-binding-k)", "normal");
>>  12 });
>>  13
>>  14 // Configure Jupyter Keymap
>>  15 require([
>>  16   'nbextensions/vim_binding/vim_binding',
>>  17   'base/js/namespace',
>>  18 ], function(vim_binding, ns) {
>>  19   // Add post callback
>>  20   vim_binding.on_ready_callbacks.push(function(){
>>  21 var km = ns.keyboard_manager;
>>  22 // Allow Ctrl-1 to change the cell mode into code in Vim 
>> normal mode
>>  23 km.edit_shortcuts.add_shortcut('ctrl-1', 
>> 'vim-binding:change-cell-to-code', true);
>>  24 /// Allow Ctrl-2 to change the cell mode into Markdown in Vim 
>> normal mode
>>  25 km.edit_shortcuts.add_shortcut('ctrl-2', 
>> 'vim-binding:change-cell-to-markdown', true);
>>  26 /// Allow Ctrl-3 to change the cell mode into code in Vim 
>> normal mode
>>  27 km.edit_shortcuts.add_shortcut('ctrl-3', 
>> 'vim-binding:change-cell-to-raw', true);
>>  28 // Delete cell with dd
>>  29 km.edit_shortcuts.add_shortcut('d+d', 
>> 'jupyter-notebook:delete-cell', true);
>>  30 // Update Help
>>
>>
>>
>>
>> On Monday, February 12, 2018 at 5:35:33 AM UTC-5, takowl wrote:
>>>
>>> It can be tricky to get custom.js to load things at the 

Re: [jupyter] How to know which config file is being used?

2018-02-12 Thread Thomas Kluyver
Sorry, I've never seen it before. If you don't know you've installed an
extension, chances are it's something built into your browser.

On 12 February 2018 at 17:28, Nate L.  wrote:

> I don't think the search bar is something from a browser extension, (I
> don't think I ever added it), but if it is, I'd love to remove it so I can
> get back to good ol' Jupyter shortcuts :'(
>
> Would you know how to inspect whether it's an extension or not, and how I
> can remove it?
>
> Thanks, Takowl!!!
>
> Best,
> Nathan
>
>
> On Monday, February 12, 2018 at 11:39:32 AM UTC-5, takowl wrote:
>>
>> Reinstalling probably won't make a difference to issues in the browser
>> like that, though it's always possible.
>>
>> Is the search bar something from a browser extension? If it captures the
>> key event before we get it, there's not much we can do about that.
>>
>> On 12 February 2018 at 16:33, Nate L.  wrote:
>>
>>> Hi Takowl,
>>>
>>> Yea, I'm in the *notebook* command mode. Upon uninstalling the Vim
>>> extension, I can now add cells with 'a', but that's about it. When I press
>>> 'b', I get the search bar pop-up:
>>>
>>>
>>> 
>>>
>>>
>>> Not sure what's wrong. Maybe I should reinstall jupyter?  The problem
>>> with reinstallation is that there are so many ways to uninstall it that I
>>> don't know which would be optimal for my case.
>>>
>>>
>>> On Monday, February 12, 2018 at 9:40:31 AM UTC-5, takowl wrote:

 Are you getting into *notebook* command mode? I don't use the vim
 extension myself, but from what I've heard, you press esc once to go from
 edit mode to vim command mode, and then again to go to notebook command
 mode. The cell selection cursor on the left should turn from green to blue
 when you switch to notebook command mode.

 On 12 February 2018 at 14:37, Nate L.  wrote:

> Hi all,
>
> Thanks for the responses! Yes, I meant that the actions are not shown
> in jupyter.
>
> Ok so now I've gotten it to the point where the vim commands are
> working (the custom.css file is changing the colors of my prompt), but now
> the Jupyter commands are not working, so when I type DD or 'a' or 'b', 
> it's
> not deleting or adding any extra cells.
>
> I've read that the problem is the vim extension, but the vim extension
> is so good I don't really want to do without it.
>
> Any thoughts as to why it's happening?
>
> This is in my custom.js:
>
>
> 1 // Configure CodeMirror Keymap
>   2 require([
>   3   'nbextensions/vim_binding/vim_binding',   // depends your
> installation
>   4 ], function() {
>   5   // Map jj to 
>   6   CodeMirror.Vim.map("jk", "", "insert");
>   7   // Swap j/k and gj/gk (Note that  mappings)
>   8   CodeMirror.Vim.map("j", "(vim-binding-gj)", "normal");
>   9   CodeMirror.Vim.map("k", "(vim-binding-gk)", "normal");
>  10   CodeMirror.Vim.map("gj", "(vim-binding-j)", "normal");
>  11   CodeMirror.Vim.map("gk", "(vim-binding-k)", "normal");
>  12 });
>  13
>  14 // Configure Jupyter Keymap
>  15 require([
>  16   'nbextensions/vim_binding/vim_binding',
>  17   'base/js/namespace',
>  18 ], function(vim_binding, ns) {
>  19   // Add post callback
>  20   vim_binding.on_ready_callbacks.push(function(){
>  21 var km = ns.keyboard_manager;
>  22 // Allow Ctrl-1 to change the cell mode into code in Vim
> normal mode
>  23 km.edit_shortcuts.add_shortcut('ctrl-1',
> 'vim-binding:change-cell-to-code', true);
>  24 /// Allow Ctrl-2 to change the cell mode into Markdown in Vim
> normal mode
>  25 km.edit_shortcuts.add_shortcut('ctrl-2',
> 'vim-binding:change-cell-to-markdown', true);
>  26 /// Allow Ctrl-3 to change the cell mode into code in Vim
> normal mode
>  27 km.edit_shortcuts.add_shortcut('ctrl-3',
> 'vim-binding:change-cell-to-raw', true);
>  28 // Delete cell with dd
>  29 km.edit_shortcuts.add_shortcut('d+d',
> 'jupyter-notebook:delete-cell', true);
>  30 // Update Help
>
>
>
>
> On Monday, February 12, 2018 at 5:35:33 AM UTC-5, takowl wrote:
>>
>> It can be tricky to get custom.js to load things at the right point.
>> Have a look at the examples here to wait for promises:
>> https://github.com/jupyter/notebook/blob/master/notebook/sta
>> tic/custom/custom.js
>>
>> If you're having some trouble, scatter some console.log('A') calls
>> around (with different letters) and then look in your browser's 
>> Javascript
>> console to see which bits are getting run.
>>
>> On 9 February 2018 at 20:01, Nate L. 

Re: [jupyter] How to know which config file is being used?

2018-02-12 Thread Thomas Kluyver
Reinstalling probably won't make a difference to issues in the browser like
that, though it's always possible.

Is the search bar something from a browser extension? If it captures the
key event before we get it, there's not much we can do about that.

On 12 February 2018 at 16:33, Nate L.  wrote:

> Hi Takowl,
>
> Yea, I'm in the *notebook* command mode. Upon uninstalling the Vim
> extension, I can now add cells with 'a', but that's about it. When I press
> 'b', I get the search bar pop-up:
>
>
> 
>
>
> Not sure what's wrong. Maybe I should reinstall jupyter?  The problem with
> reinstallation is that there are so many ways to uninstall it that I don't
> know which would be optimal for my case.
>
>
> On Monday, February 12, 2018 at 9:40:31 AM UTC-5, takowl wrote:
>>
>> Are you getting into *notebook* command mode? I don't use the vim
>> extension myself, but from what I've heard, you press esc once to go from
>> edit mode to vim command mode, and then again to go to notebook command
>> mode. The cell selection cursor on the left should turn from green to blue
>> when you switch to notebook command mode.
>>
>> On 12 February 2018 at 14:37, Nate L.  wrote:
>>
>>> Hi all,
>>>
>>> Thanks for the responses! Yes, I meant that the actions are not shown in
>>> jupyter.
>>>
>>> Ok so now I've gotten it to the point where the vim commands are working
>>> (the custom.css file is changing the colors of my prompt), but now the
>>> Jupyter commands are not working, so when I type DD or 'a' or 'b', it's not
>>> deleting or adding any extra cells.
>>>
>>> I've read that the problem is the vim extension, but the vim extension
>>> is so good I don't really want to do without it.
>>>
>>> Any thoughts as to why it's happening?
>>>
>>> This is in my custom.js:
>>>
>>>
>>> 1 // Configure CodeMirror Keymap
>>>   2 require([
>>>   3   'nbextensions/vim_binding/vim_binding',   // depends your
>>> installation
>>>   4 ], function() {
>>>   5   // Map jj to 
>>>   6   CodeMirror.Vim.map("jk", "", "insert");
>>>   7   // Swap j/k and gj/gk (Note that  mappings)
>>>   8   CodeMirror.Vim.map("j", "(vim-binding-gj)", "normal");
>>>   9   CodeMirror.Vim.map("k", "(vim-binding-gk)", "normal");
>>>  10   CodeMirror.Vim.map("gj", "(vim-binding-j)", "normal");
>>>  11   CodeMirror.Vim.map("gk", "(vim-binding-k)", "normal");
>>>  12 });
>>>  13
>>>  14 // Configure Jupyter Keymap
>>>  15 require([
>>>  16   'nbextensions/vim_binding/vim_binding',
>>>  17   'base/js/namespace',
>>>  18 ], function(vim_binding, ns) {
>>>  19   // Add post callback
>>>  20   vim_binding.on_ready_callbacks.push(function(){
>>>  21 var km = ns.keyboard_manager;
>>>  22 // Allow Ctrl-1 to change the cell mode into code in Vim normal
>>> mode
>>>  23 km.edit_shortcuts.add_shortcut('ctrl-1',
>>> 'vim-binding:change-cell-to-code', true);
>>>  24 /// Allow Ctrl-2 to change the cell mode into Markdown in Vim
>>> normal mode
>>>  25 km.edit_shortcuts.add_shortcut('ctrl-2',
>>> 'vim-binding:change-cell-to-markdown', true);
>>>  26 /// Allow Ctrl-3 to change the cell mode into code in Vim normal
>>> mode
>>>  27 km.edit_shortcuts.add_shortcut('ctrl-3',
>>> 'vim-binding:change-cell-to-raw', true);
>>>  28 // Delete cell with dd
>>>  29 km.edit_shortcuts.add_shortcut('d+d',
>>> 'jupyter-notebook:delete-cell', true);
>>>  30 // Update Help
>>>
>>>
>>>
>>>
>>> On Monday, February 12, 2018 at 5:35:33 AM UTC-5, takowl wrote:

 It can be tricky to get custom.js to load things at the right point.
 Have a look at the examples here to wait for promises:
 https://github.com/jupyter/notebook/blob/master/notebook/sta
 tic/custom/custom.js

 If you're having some trouble, scatter some console.log('A') calls
 around (with different letters) and then look in your browser's Javascript
 console to see which bits are getting run.

 On 9 February 2018 at 20:01, Nate L.  wrote:

> I am using Jupyter on SSH, with the amazing VIM extension. However,
> when I try to modify the vim mappings in the config file, the actions are
> now shown in my jupyter notebook.  Does anyone know how I can see which
> config file is being used by my jupyter folder? My current config file is
> ~/.jupyter/custom/custom.js, but it's not loading on the Jupyter notebook 
> :(
>
> --
> 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
> 

Re: [jupyter] How to know which config file is being used?

2018-02-12 Thread Nate L.
Hi Takowl,

Yea, I'm in the *notebook* command mode. Upon uninstalling the Vim 
extension, I can now add cells with 'a', but that's about it. When I press 
'b', I get the search bar pop-up:




Not sure what's wrong. Maybe I should reinstall jupyter?  The problem with 
reinstallation is that there are so many ways to uninstall it that I don't 
know which would be optimal for my case.


On Monday, February 12, 2018 at 9:40:31 AM UTC-5, takowl wrote:
>
> Are you getting into *notebook* command mode? I don't use the vim 
> extension myself, but from what I've heard, you press esc once to go from 
> edit mode to vim command mode, and then again to go to notebook command 
> mode. The cell selection cursor on the left should turn from green to blue 
> when you switch to notebook command mode.
>
> On 12 February 2018 at 14:37, Nate L.  
> wrote:
>
>> Hi all,
>>
>> Thanks for the responses! Yes, I meant that the actions are not shown in 
>> jupyter.
>>
>> Ok so now I've gotten it to the point where the vim commands are working 
>> (the custom.css file is changing the colors of my prompt), but now the 
>> Jupyter commands are not working, so when I type DD or 'a' or 'b', it's not 
>> deleting or adding any extra cells.
>>
>> I've read that the problem is the vim extension, but the vim extension is 
>> so good I don't really want to do without it.  
>>
>> Any thoughts as to why it's happening? 
>>
>> This is in my custom.js:
>>
>>
>> 1 // Configure CodeMirror Keymap
>>   2 require([
>>   3   'nbextensions/vim_binding/vim_binding',   // depends your 
>> installation
>>   4 ], function() {
>>   5   // Map jj to 
>>   6   CodeMirror.Vim.map("jk", "", "insert");
>>   7   // Swap j/k and gj/gk (Note that  mappings)
>>   8   CodeMirror.Vim.map("j", "(vim-binding-gj)", "normal");
>>   9   CodeMirror.Vim.map("k", "(vim-binding-gk)", "normal");
>>  10   CodeMirror.Vim.map("gj", "(vim-binding-j)", "normal");
>>  11   CodeMirror.Vim.map("gk", "(vim-binding-k)", "normal");
>>  12 });
>>  13
>>  14 // Configure Jupyter Keymap
>>  15 require([
>>  16   'nbextensions/vim_binding/vim_binding',
>>  17   'base/js/namespace',
>>  18 ], function(vim_binding, ns) {
>>  19   // Add post callback
>>  20   vim_binding.on_ready_callbacks.push(function(){
>>  21 var km = ns.keyboard_manager;
>>  22 // Allow Ctrl-1 to change the cell mode into code in Vim normal 
>> mode
>>  23 km.edit_shortcuts.add_shortcut('ctrl-1', 
>> 'vim-binding:change-cell-to-code', true);
>>  24 /// Allow Ctrl-2 to change the cell mode into Markdown in Vim 
>> normal mode
>>  25 km.edit_shortcuts.add_shortcut('ctrl-2', 
>> 'vim-binding:change-cell-to-markdown', true);
>>  26 /// Allow Ctrl-3 to change the cell mode into code in Vim normal 
>> mode
>>  27 km.edit_shortcuts.add_shortcut('ctrl-3', 
>> 'vim-binding:change-cell-to-raw', true);
>>  28 // Delete cell with dd
>>  29 km.edit_shortcuts.add_shortcut('d+d', 
>> 'jupyter-notebook:delete-cell', true);
>>  30 // Update Help
>>
>>
>>
>>
>> On Monday, February 12, 2018 at 5:35:33 AM UTC-5, takowl wrote:
>>>
>>> It can be tricky to get custom.js to load things at the right point. 
>>> Have a look at the examples here to wait for promises:
>>>
>>> https://github.com/jupyter/notebook/blob/master/notebook/static/custom/custom.js
>>>
>>> If you're having some trouble, scatter some console.log('A') calls 
>>> around (with different letters) and then look in your browser's Javascript 
>>> console to see which bits are getting run.
>>>
>>> On 9 February 2018 at 20:01, Nate L.  wrote:
>>>
 I am using Jupyter on SSH, with the amazing VIM extension. However, 
 when I try to modify the vim mappings in the config file, the actions are 
 now shown in my jupyter notebook.  Does anyone know how I can see which 
 config file is being used by my jupyter folder? My current config file is 
 ~/.jupyter/custom/custom.js, but it's not loading on the Jupyter notebook 
 :(

 -- 
 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/a141af95-ed48-4f9d-9350-3ab3ddb0d703%40googlegroups.com
  
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Project Jupyter" group.

Re: [jupyter] How soon is too soon to send a message to the shell channel?

2018-02-12 Thread MinRK
On Thu, Feb 8, 2018 at 11:49 PM, Trevor Murphy 
wrote:

I'm playing around with a hand-rolled jupyter client, mainly to learn ZMQ
> and the jupyter messaging protocol.
>
> My "client" starts a jupyter console and then starts sending messages to
> the shell channel / receiving from the shell and iopub channels.
>
> I notice that, often, I'm unable to read from the shell and iopub channels
> if I send a message as soon as possible after the console program starts.
> Like, my code does:
>
>   1. shell out a jupyter console, wait for return
>   2. poll the shell socket's ZMQ_EVENTS option until ZMQ_POLLOUT is true
> (incidentally, this always succeeds on the first poll)
>   3. send a message to the shell socket
>   4. poll the shell and iopub sockets' ZMQ_EVENTS options until ZMQ_POLLIN
> is true (both polls spin forever).
>
> If I make the code wait for a few seconds, the send and receive roundtrip
> completes just fine, a/k/a the polls at (4) succeed and my code continues.
>
> Can anybody point me to debug this?  I tried starting the console with
> --log-level=DEBUG but none of the messages talk about what's going on at
> this level.
>
> Or, am I just doing the poll wrong?  I would've though it would be fine to
> send when ZMQ_POLLOUT is true, but it looks like the kernel isn't receiving
> my message in this case.
>
You’re doing everything right, there’s just some zmq magic that’s getting
in the way of things behaving clearly. The short answer to your question is
that it’s never to early to send a shell request. zmq is ‘connectionless’
which is the zmq way of saying that you can send messages even when the
other end hasn’t shown up yet. It will handle delivering the message when
the kernel shows up. This is why POLLOUT is true immediately. What you are
likely running into is a failure to propagate subscriptions on the PUB/SUB
channel. If a PUB socket sends a message and it has no registered
subscribers, it will discard those messages immediately. And propagating
those subscriptions takes a finite amount of time.

So the common failure is:

   1. request kernel start
   2. send request immediately
   3. kernel starts, binds, handles request, sends replies
   4. PUB/SUB subscriptions haven’t propagated, so PUB messages are
   discarded
   5. zmq PUB/SUB subscriptions finish propagating (too late!)

The way we deal with this is explicitly waiting for IOPub messages to be
delivered before sending requests. This is implemented in
BlockingKernelClient.wait_for_ready. But the logic is:

   1. send kernel_info_request
   2. wait for reply
   3. wait for status: idle on IOPub

if reply came and idle didn’t, IOPub subscriptions may not have propagated,
run again. This typically takes ~milliseconds, so the second try will
always work. Here’s a script
 that starts a
kernel and connects a client to it and runs a bit of code.

-Min

-- 
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/20e29f70-cb0f-4c11-84a6-a94866b72098%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
​

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAHNn8BXysJuMAg6kdOu7DwNmczuS_G8Vb1yKOxyhZwYGfJJpiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] Android Native FrontEnd for Jupyter Notebook

2018-02-12 Thread Thomas Kluyver
We have a 'powered by Jupyter' logo which we encourage projects to use, but
it doesn't lend itself to combining with other things. So if you want to
design an alternative Jupyter motif to use for such logos, go for it!

(Unfortunately, I don't know where you can get the 'powered by' logo except
by snipping it out of the brand guide PDF. Could someone who has it put it
into the jupyter/design repo?)

On 10 February 2018 at 20:50, Lawrence D’Oliveiro 
wrote:

> On Thursday, February 8, 2018 at 6:32:39 AM UTC+13, takowl wrote:
>>
>>
>> BTW, we're not keen on people combining the Jupyter logo with other
>> elements.
>>
>
> Do we need a community-developed logo motif, freely usable by related
> projects, that the Jupyter project does not own?
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/c906e0e7-a748-45dd-9f07-f342a1572eae%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAOvn4qir4qX9CJMc6-b-TVAbkPz-Bp3aDEEZkJgvtk%2BrJ6Hq%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] How to know which config file is being used?

2018-02-12 Thread Thomas Kluyver
It can be tricky to get custom.js to load things at the right point. Have a
look at the examples here to wait for promises:
https://github.com/jupyter/notebook/blob/master/notebook/static/custom/custom.js

If you're having some trouble, scatter some console.log('A') calls around
(with different letters) and then look in your browser's Javascript console
to see which bits are getting run.

On 9 February 2018 at 20:01, Nate L.  wrote:

> I am using Jupyter on SSH, with the amazing VIM extension. However, when I
> try to modify the vim mappings in the config file, the actions are now
> shown in my jupyter notebook.  Does anyone know how I can see which config
> file is being used by my jupyter folder? My current config file is
> ~/.jupyter/custom/custom.js, but it's not loading on the Jupyter notebook :(
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/a141af95-ed48-4f9d-9350-3ab3ddb0d703%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAOvn4qhN1bSsQEAH1u_UHg4y-uw1oGv5HGiY3xw22e2tEmQCZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.