Jupyter as Leo's what ? [via] A study outline containing eric6 docs

108 views
Skip to first unread message

Zoom.Quiet

unread,
Feb 25, 2018, 4:20:17 AM2/25/18
to leo-e...@googlegroups.com
On Sun, Feb 25, 2018 at 4:51 PM, Edward K. Ream <edre...@gmail.com> wrote:
> On Sun, Feb 25, 2018 at 1:36 AM, Zoom.Quiet <zoom....@gmail.com> wrote:
>>
>> OT: JupyterLab Documentation — JupyterLab 1.0 Beta documentation
>> http://jupyterlab.readthedocs.io/en/latest/
>>
>> Jupyter will make web page as IDE...
>
>
> Thanks for this link. Imo it is on topic.
>

sorry for share link not with my idea :
Jupyter is the REPL interface beyond language ,
can make doc./code/running all in one page;

Leo not REPL, focus result problems is different with Jupyter:
every program is make up by:
- think world <~ what is my understand the goal task
- code world <~ what is compiler can understand the goal task
- product world <~ what is systems can understand my solution

Leo base Literate Programming thought easy merge these world in one interface:
- think world => logging as outlines
- code world => edit pane
- product world => @clean/@path/..etc. commands

BUT:
Leo can not like IDE/Jupyter can running on the spot,
and every one time change interface,
such as leave Leo, jump into iTerm2 for running code , observe log printing,
will hurt attention, lost Mind Cache...

SO if:
Leo can embedded Jupyter as inter. command;
will make product world merged as code world?

of course:
this kinds of enhancement, is not for core ability,
not necessarily think now ;-)

> I have no clear idea how jupyter/lab relates Leo, but imo we must keep
> paying attention to it. The jupyter project is one of the most important and
> interesting projects in the world.
>
> 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+...@googlegroups.com.
> To post to this group, send email to leo-e...@googlegroups.com.
> Visit this group at https://groups.google.com/group/leo-editor.
> For more options, visit https://groups.google.com/d/optout.



--
life is pathetic, go Pythonic! 人生苦短, Python当歌!
俺: http://zoomquiet.io
授: http://creativecommons.org/licenses/by-sa/2.5/cn/
怒: 冗余不做,日子甭过!备份不做,十恶不赦!
KM keep growing environment culture which promoting organization learning!

Edward K. Ream

unread,
Feb 25, 2018, 9:14:44 AM2/25/18
to leo-editor
On Sun, Feb 25, 2018 at 3:19 AM, Zoom.Quiet <zoom....@gmail.com> wrote:

Leo can embedded Jupyter as inter. command;
will make product world merged as code world?

​That was not my intention.​
 

of course:
this kinds of enhancement, is not for core ability,
not necessarily think now ;-)

​Correct.  There are many reasons to study the jupyter world without wanting to use its interface or embed Leo in it :-)

For instance:

1. Most editors/ide's have an easy way to switch themes.  This activates an already-created theme ​file.  Leo should use such a scheme, reserving Leo's complex @theme machinery only for theme developers themselves. Furthermore, studying the themes themselves may prove useful.

2. Both jupyter and eric6 use side tabs to great effect.  Leo might benefit from side tabs too.

3. The jupyter Settings menu has a Settings: Text Editor Indentation menu that has these items:

   Indent with tabs
   Spaces: 1
   Spaces: 2
   Spaces: 4
   Spaces: 8

This is clearer than any other explanation of indentation I have ever seen. Not sure whether this can or should @tabwidth, but I'll keep it in the back of my mind.

4. It may be possible to use the jupyter servers/kernels in some clever way, without re-imagining all of Leo ;-)

Edward

Zoom.Quiet

unread,
Feb 25, 2018, 9:58:14 AM2/25/18
to leo-e...@googlegroups.com
On Sun, Feb 25, 2018 at 10:14 PM, Edward K. Ream <edre...@gmail.com> wrote:
> On Sun, Feb 25, 2018 at 3:19 AM, Zoom.Quiet <zoom....@gmail.com> wrote:
>
>> Leo can embedded Jupyter as inter. command;
>> will make product world merged as code world?
>
>
> That was not my intention.
>
>
>> of course:
>> this kinds of enhancement, is not for core ability,
>> not necessarily think now ;-)
>
>
> Correct. There are many reasons to study the jupyter world without wanting
> to use its interface or embed Leo in it :-)
>
> For instance:
>
> 1. Most editors/ide's have an easy way to switch themes. This activates an
> already-created theme file. Leo should use such a scheme, reserving Leo's
> complex @theme machinery only for theme developers themselves. Furthermore,
> studying the themes themselves may prove useful.
>

Hummm.. IMHO:
- theme is important for developer
- but easy switch theme is not big things
- because if someone always switch theme for show
must one designer not developer,
when i config love theme, never ever change it,
because in new theme, will odd my debug speed.

> 2. Both jupyter and eric6 use side tabs to great effect. Leo might benefit
> from side tabs too.
>
> 3. The jupyter Settings menu has a Settings: Text Editor Indentation menu
> that has these items:
>
> Indent with tabs
> Spaces: 1
> Spaces: 2
> Spaces: 4
> Spaces: 8
>
> This is clearer than any other explanation of indentation I have ever seen.
> Not sure whether this can or should @tabwidth, but I'll keep it in the back
> of my mind.
>

IMHO:
Leo's outline is better than TAB system,
because walking/jump in outline, is flow my self think world,
but multi-TAB?
such as worm-hole, can not help me:
who am i
where am i
want am i
....


> 4. It may be possible to use the jupyter servers/kernels in some clever way,
> without re-imagining all of Leo ;-)
>

of course, this is the biggest reason for IPython:NB upgrade as Jupyter:
SEE:
Four Ways to Extend Jupyter Notebook - Parente's Mindtrove
https://mindtrove.info/4-ways-to-extend-jupyter-notebook/
Jupyter Notebooks as RESTful Microservices - IBM Emerging Technologies Blog
http://blog.ibmjstart.net/2016/01/28/jupyter-notebooks-as-restful-microservices/
Jupyter Notebook Server API · jupyter/jupyter Wiki
https://github.com/jupyter/jupyter/wiki/Jupyter-Notebook-Server-API
Contents API — Jupyter Notebook 5.4.0 documentation
http://jupyter-notebook.readthedocs.io/en/stable/extending/contents.html
jupyterhub/jupyterhub: Multi-user server for Jupyter notebooks
https://github.com/jupyterhub/jupyterhub
...

in fact, Jupyter can usage as one frinedly distributed computer platform...

that means, Leo can publish self JupyterHub server as:
http://ipynb.leoeditor.com/

so when Leo trigger from some commonds;
will transform nodes as JSON sent the Jupyter backend srv.;
echo the running result as JSON;
rebuild GUI as new contents.

of course:
JupyterHub can running local host also.
with Leo Server Extensions, echo Leo edit action.

Matt Wilkie

unread,
Feb 27, 2018, 4:36:41 PM2/27/18
to leo-editor

BUT:
Leo can not like IDE/Jupyter can running on the spot,
and every one time change interface,
such as leave Leo, jump into iTerm2 for running code , observe log printing,
will hurt attention, lost Mind Cache...

+1.  This is why I tend to use Pyzo when prototyping new python code.

I love the "lost Mind Cache" phrase.

matt

Edward K. Ream

unread,
Feb 28, 2018, 9:15:16 AM2/28/18
to leo-editor
On Sun, Feb 25, 2018 at 8:57 AM, Zoom.Quiet <zoom....@gmail.com> wrote:

Hummm.. IMHO:
- theme is important for developer
- but easy switch theme is not big things
- because if someone always switch theme for show
  must one designer not developer,
  when i config love theme, never ever change it,
  because in new theme, will odd my debug speed.

​Showcasing good-looking, easy to find and install themes is important.  It's what people see first and what they want to customize first.
 
IMHO:
Leo's outline is better than TAB system,

​Yes, and more flexible.  I just wanted to point out an excellent user interface.
 
​​
> 4. It may be possible to use the jupyter servers/kernels in some clever way,
> without re-imagining all of Leo ;-)
>

of course, this is the biggest reason for IPython:NB upgrade as Jupyter:
SEE:
Four Ways to Extend Jupyter Notebook - Parente's Mindtrove
    https://mindtrove.info/4-ways-to-extend-jupyter-notebook/
Jupyter Notebooks as RESTful Microservices - IBM Emerging Technologies Blog
    http://blog.ibmjstart.net/2016/01/28/jupyter-notebooks-as-restful-microservices/
Jupyter Notebook Server API · jupyter/jupyter Wiki
    https://github.com/jupyter/jupyter/wiki/Jupyter-Notebook-Server-API
Contents API — Jupyter Notebook 5.4.0 documentation
    http://jupyter-notebook.readthedocs.io/en/stable/extending/contents.html
jupyterhub/jupyterhub: Multi-user server for Jupyter notebooks
    https://github.com/jupyterhub/jupyterhub
...

in fact, Jupyter can usage as one friendly distributed computer platform...


that means, Leo can publish self JupyterHub server as:
http://ipynb.leoeditor.com/

so when Leo trigger from some commands;

will transform nodes as JSON sent the Jupyter backend
​[server].;
echo the running result as JSON;
rebuild GUI as new contents.

of course:
JupyterHub can running local host also.
with Leo Server Extensions, echo Leo edit action.

​Many thanks for all these ideas and links. I'll study them closely.

Edward

Edward K. Ream

unread,
Feb 28, 2018, 9:20:24 AM2/28/18
to leo-editor
On Tue, Feb 27, 2018 at 3:36 PM, Matt Wilkie <map...@gmail.com> wrote:

BUT:
Leo can not like IDE/Jupyter can running on the spot,
and every one time change interface,
such as leave Leo, jump into iTerm2 for running code , observe log printing,
will hurt attention, lost Mind Cache...

+1.  This is why I tend to use Pyzo when prototyping new python code.

​Pyzo has an integrated console window.  Is this what you are talking about?​

Is the Stupendous Aha not convenient enough?

I love the "lost Mind Cache" phrase.

​Hehe.  It's a big problem for me.

Edward

Matt Wilkie

unread,
Feb 28, 2018, 6:58:13 PM2/28/18
to leo-editor
+1.  This is why I tend to use Pyzo when prototyping new python code.

​Pyzo has an integrated console window.  Is this what you are talking about?​
 
Is the Stupendous Aha not convenient enough?

Pyzo's integrated console window is very handy. Pyzo has the ancestral idea of Leo's Execute Node (Ctrl-B), but more primitive as it only executes the currently selected lines (via Alt-Enter).

Confession: I don't do unit tests, which is horrible and likely grounds for kicking me off the team! ;-) Note, this is different from saying I don't do tests. I do test, as best I can. In my periodic attempts to do the right thing and get on the unit test bandwagon I get frustrated by commonly spending twice as much time writing and debugging the tests themselves as the code they are supposed to validate.

Back to Pyzo: I also really like the interactive exploration of live variable values in the "Workshop" panel. It lets me see at a glance how my in-memory data values are changing with each step. See screenshot.



matt
Auto Generated Inline Image 1

Edward K. Ream

unread,
Mar 1, 2018, 6:36:55 AM3/1/18
to leo-editor
On Wed, Feb 28, 2018 at 5:58 PM, Matt Wilkie <map...@gmail.com> wrote:

Pyzo's integrated console window is very handy.
 
Pyzo has the ancestral idea of Leo's Execute Node (Ctrl-B), but more primitive as it only executes the currently selected lines (via Alt-Enter).

​Pyzo allows setting breakpoints in gutters. Iirc, eric6 supports a built-in debugger view.

Pyzo cells are everything between two commands starting with ## or #%%. ​
 
​ Like this:

## cell 1

print('hi')

print('cell1')

## cell 2

print('cell2')


This is (almost) compatible with the format of Leo's python sentinel lines!​

Confession: I don't do unit tests, which is horrible and likely grounds for kicking me off the team! ;-)

​Heh.  On that basis I might be kicked off the team...​
 
 
I get frustrated by commonly spending twice as much time writing and debugging the tests themselves as the code they are supposed to validate.

​I have the reverse frustration.  Any kind of test, unit or otherwise, would typically save me more time in the long run.  Yesterday's work on the​
 

Back to Pyzo: I also really like the interactive exploration of live variable values in the "Workshop" panel.

​Leo has to have these features. ​
 
​ #558 Add support for in-Leo debugging, breakpoints, etc already exists.

I have just updated it to mention the features you mention here. It now has a new label, MajorFeature, so I can find it easily, even without a milestone.

Edward

Edward K. Ream

unread,
Mar 1, 2018, 6:40:17 AM3/1/18
to leo-editor
On Thursday, March 1, 2018 at 5:36:55 AM UTC-6, Edward K. Ream wrote:

​> I have the reverse frustration.  Any kind of test, unit or otherwise, would typically save me more time in the long run.  Yesterday's work on the​
 

Oops.  I didn't complete the thought.

I meant to say that yesterday's work on the print-settings command would likely have gone more quickly had I created a test for the formatting of a line.  Yes, it would have required some futzing, but it probably would have been worthwhile.  Impossible to say for sure, and I doubt that pyzo would have made the required task easier.

Edward

Terry Brown

unread,
Mar 1, 2018, 9:19:03 AM3/1/18
to leo-e...@googlegroups.com

On Thu, 1 Mar 2018 05:36:53 -0600 "Edward K. Ream" <edre...@gmail.com> wrote:

> Pyzo cells <http://www.pyzo.org/pyzo_intro.html> are everything > between two commands starting with ## or #%%. ​

The vs-eval-block command from the valuespace plugin gives Leo a cell like behavior. It puts "# >>>" after the current code and executes it, separating the results from further input with "# <<<".

from collections import OrderedDict
test = OrderedDict({'a': 1, 'b': 2, 'c': 3})
# >>>
OrderedDict([('a', 1), ('c', 3), ('b', 2)])
# <<<
test = OrderedDict((('a', 1), ('b', 2), ('c', 3)))
# >>>
OrderedDict([('a', 1), ('b', 2), ('c', 3)])
# <<<
test.update({'note': "variables are persistent"})
# >>>

# <<<
# but update evals to None, so name the variable you want to see
test
# >>>
OrderedDict([('a', 1), ('b', 2), ('c', 3), ('note', 'variables are persistent')])
# <<<

if you go back to an earlier block and execute it, subsequent blocks are marked "# >>> *" to indicate they're out of date. Binding vs-eval-block to a key let's you step rapidly through the blocks, as each execution selects the next block.

Tangential: I think many years ago I wrote some code to pull plugin docstrings into Leo's docs., pretty sure that's not done currently, but seems worthwhile.

Off-topic: docutils.sourceforge.net refused to connect.

Cheers -Terry

Edward K. Ream

unread,
Mar 1, 2018, 10:30:46 AM3/1/18
to leo-editor
On Thu, Mar 1, 2018 at 8:17 AM, Terry Brown <terry...@gmail.com> wrote:

> Pyzo cells <http://www.pyzo.org/pyzo_intro.html> are everything
> between two commands starting with ## or #%%. ​

The `vs-eval-block` command from the valuespace plugin gives Leo a cell
like behavior. 

​Thanks for this reminder.

Tangential: I think many years ago I wrote some code to pull plugin
docstrings into Leo's docs., pretty sure that's not done currently, but
seems worthwhile.

​Heh. You don't think I throw useful stuff like this out, do you?​
 

​The two places to look are LeoDocs.leo and scripts.leo.  In fact, it's in LeoDocs.leo:

​LeoDocs.leo#Startup-->Scripts-->Script: get-plugin-docstrings

Edward
Reply all
Reply to author
Forward
0 new messages