Re: Soon! valuespace and jupyter

2018-04-02 Thread Edward K. Ream
On Sat, Mar 31, 2018 at 10:15 AM, Thomas Passin  wrote:

I think we can go one better ... that is, to be able to put Leo organizer
> nodes between Jupyter nodes.
>

​That should happen automatically when writing the jupyter file. Retaining
"non-jupyter" nodes when reading jupyter files would be much harder.  It's
akin to the @persistence logic, which is not for the faint of heart.
​


> Another thing to bear in mind is that jupyter is an ecosystem that is
> evolving fast.
>

​Right.  However, we can expect the api's to change more slowly.
​


>  I strongly support trying to integrate with jupyter rather than to try to
> re-create its functionality.
>

​That's the idea.  I'll be studying pyzo/jupyter code with exactly this
goal in mind.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Soon! valuespace and jupyter

2018-03-31 Thread Thomas Passin
I think we can go one better ... that is, to be able to put Leo organizer 
nodes between Jupyter nodes.  The organizer nodes could contain Markdown, 
Rst, @file or @clean trees, or what have you.  That would give us the 
ability to further annotate or adapt jupyter nodes beyond what their 
authors had in mind.  

For jupyter code execution, the execution system would have to be able to 
ignore non-jupyter nodes, of course.

Another thing to bear in mind is that jupyter is an ecosystem that is 
evolving fast.  For example, I wouldn't be surprised if it turned out that 
most jupyter activity ends up runnng on jupyter Lab. We can't possibly play 
catch-up with it all.   So we'll have to pick and choose thoughtfully.

But I strongly support trying to integrate with jupyter rather than to try 
to re-create its functionality.

On Monday, March 26, 2018 at 2:26:25 PM UTC-4, Terry Brown wrote:
>
>
> > > True, fully integrated, support for Jupyter will require a *Jupyter 
> > > gui   
> > plugin*. 
> > 
> > Well, maybe not.  The jupyter.py plugin might just do the following: 
> > 
> > - Init one or more jupyter kernels in the background. 
> > - Enhance the execute-script command so that it passes 
> > code/expressions to a kernel. 
> > - Show the result in, say, the VR pane. 
> > - Define various commands in a Jupyter menu. 
>
> This is very much the directions I lean in for Jupyter integration. 
> The leo-edit-pane split view could work to represent cell input / 
> output, but isn't integral, your description above is equally good. 
> This seems the best route to the full power of whatever the Jupyter 
> server has to offer. 
>
> Cheers -Terry 
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Soon! valuespace and jupyter

2018-03-26 Thread Edward K. Ream
On Mon, Mar 26, 2018 at 3:33 PM, Terry Brown  wrote:

> On Mon, 26 Mar 2018 15:21:39 -0500
> "Edward K. Ream"  wrote:
>
> > There will be a natural back and forth between the vs- commands and
> > corresponding jupyter interface
>
> Just to clarify, while there can be jupyter aware vs-* commands, I
> argue for set of jupyter free vs-eval commands as part of Leo's core
> functionality, because I think that overall they're the best Python
> evaluation tools Leo has, and that should be something fundamental to
> Leo without any reference to jupyter.
>

​I agree completely.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Soon! valuespace and jupyter

2018-03-26 Thread Terry Brown
On Mon, 26 Mar 2018 15:21:39 -0500
"Edward K. Ream"  wrote:

> There will be a natural back and forth between the vs- commands and
> corresponding jupyter interface

Just to clarify, while there can be jupyter aware vs-* commands, I
argue for set of jupyter free vs-eval commands as part of Leo's core
functionality, because I think that overall they're the best Python
evaluation tools Leo has, and that should be something fundamental to
Leo without any reference to jupyter.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Soon! valuespace and jupyter

2018-03-26 Thread Edward K. Ream
> > I am thinking that these commands might move into the mod_scripting
> > plugin, or the jupyter plugin (see below).  There is lots of room for
>
> I'd argue for mod_scripting.  The vs-eval-* commands are basic Python
> centric functionality Leo should have uncomplicated by Juypyter /
> external code execution engines.
>

Yes.  Wherever they are they should be aware of jupyter kernels if they
have been started.
​


> The jupyter.py plugin might just do the following:
> >
> > - Init one or more jupyter kernels in the background.
> > - Enhance the execute-script command so that it passes
> > code/expressions to a kernel.
> > - Show the result in, say, the VR pane.
> > - Define various commands in a Jupyter menu.
>
> This is very much the directions I lean in for Jupyter integration.
>

​Glad we agree.  There seems to be no need to slavishly use jupyter widgets.

For example, the vs-commands could easily print In[6] before the next <<<
prompt.

It's easy, using Leo's existing api, which the vs-code already does, to
find the code to be evaluated.

That said, I want to support stuff like IPython % "magics" by send the
lines to be evaluated to the jupyter kernel.  Details vague, but they don't
involve jupyter *gui *code.

*Summary*

We can use Leo's gui & api as is, and interact with a "gui-less" jupyter
interface.  The startup code will only init the kernels and their
interface.  There will no need to init *any *gui code, a huge
simplification.

There will be a natural back and forth between the vs- commands and
corresponding jupyter interface.  We can make the vs-commands look and work
very much like "native" jupyter consoles.  We could even enhance syntax
coloring if we like to handle >>> and <<< sentinels.

To repeat, there is a real possibility that *all* of this can be done in a
week or three. It will be well worth doing no matter how long it does take.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Soon! valuespace and jupyter

2018-03-26 Thread Terry Brown
On Mon, 26 Mar 2018 10:55:36 -0700 (PDT)
"Edward K. Ream"  wrote:

> On Monday, March 26, 2018 at 11:50:15 AM UTC-5, Edward K. Ream wrote:
> 
> > There are several problems with the vs- commands.  
> 
> I am thinking that these commands might move into the mod_scripting
> plugin, or the jupyter plugin (see below).  There is lots of room for 

I'd argue for mod_scripting.  The vs-eval-* commands are basic Python
centric functionality Leo should have uncomplicated by Juypyter /
external code execution engines.

> > True, fully integrated, support for Jupyter will require a *Jupyter
> > gui   
> plugin*.
> 
> Well, maybe not.  The jupyter.py plugin might just do the following:
> 
> - Init one or more jupyter kernels in the background.
> - Enhance the execute-script command so that it passes
> code/expressions to a kernel.
> - Show the result in, say, the VR pane.
> - Define various commands in a Jupyter menu.

This is very much the directions I lean in for Jupyter integration.
The leo-edit-pane split view could work to represent cell input /
output, but isn't integral, your description above is equally good.
This seems the best route to the full power of whatever the Jupyter
server has to offer.

Cheers -Terry
> One can imagine doing all this in a week or three.
> 
> > I am now studying the Jupyter sources intensely  
> 
> Happily, there are no odious side effect to importing jupyter code.
> This is crucial.  It means that all jupyter code is actually
> available.
> 
> > the handle_image* methods do a lot of image-related magic behind
> > the   
> scenes.
> 
> I expect that these actual methods, or similar (they are small), will 
> eventually be used in the jupyter plugin.
> 
> Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Soon! valuespace and jupyter

2018-03-26 Thread Edward K. Ream
On Monday, March 26, 2018 at 11:50:15 AM UTC-5, Edward K. Ream wrote:

> There are several problems with the vs- commands.

I am thinking that these commands might move into the mod_scripting plugin, 
or the jupyter plugin (see below).  There is lots of room for 
experimentation.  For example, an enhanced execute-script command would 
know about:

>>> and <<< and sentinels
org-mode sentinels
Enhanced @language directives that carry optional arguments

> True, fully integrated, support for Jupyter will require a *Jupyter gui 
plugin*.

Well, maybe not.  The jupyter.py plugin might just do the following:

- Init one or more jupyter kernels in the background.
- Enhance the execute-script command so that it passes code/expressions to 
a kernel.
- Show the result in, say, the VR pane.
- Define various commands in a Jupyter menu.

One can imagine doing all this in a week or three.

> I am now studying the Jupyter sources intensely

Happily, there are no odious side effect to importing jupyter code.  This 
is crucial.  It means that all jupyter code is actually available.

> the handle_image* methods do a lot of image-related magic behind the 
scenes.

I expect that these actual methods, or similar (they are small), will 
eventually be used in the jupyter plugin.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.