Yesterday was a momentous day for me. I wrote a dead easy script that converts Jupyter notebooks to @file nodes. I immediately saw (Aha!) that Leo is a far better platform than Jupyter Lab!
I have forgotten exactly how the Aha came about. As usual, the Aha changed everything, including my memory!
But the historical details don't matter. What matters is that I now have an excellent workflow and environment for studying math.
math.leo, in the leo-editor-contrib repo, shows the results of yesterday's work.
The breakthrough script
The @button import-ipynb script converts .ipynb files to .py files. It practically wrote itself. math.leo contains the latest version.
The guts of the script are these lines:
p = parent.insertAsLastChild()
p.h = f"@jupytext {the_file}"
c.selectPosition(p)
c.refreshFromDisk()
new_fn = os.path.basename(the_file).replace('.ipynb', '.py')
p.h = f"# @file {dir_s}{os.sep}{new_fn}"
Wow. @jupytext does all the heavy lifting!!
Aha: Leo is the best math platform!
After converting the notebooks to Leo outlines, I immediately saw that Leo is much more powerful than Matlab or Jupyter.
To complete my new workflow, another @button script runs files externally:
import os
# Execute the script in the proper folder.
dir_ = os.path.dirname(c.fileName())
os.chdir(dir_)
# Use the common naming convention.
chapter = 'CH01'
section = r'SEC03_Rotation.py'
path = fr'{chapter}/{chapter}_{section}'
g.execute_shell_commands(f"&python {path}")
Summary
Yesterday was a golden day. Such milestones do not happen often.
math.leo, in the leo-editor-contrib, shows my latest work. Those wishing to use my work should carefully read the "Read me" node in math.leo.
For me, Leo is (by far!) the best platform for doing math. This insight could not have happened without @jupytext!
Questions? Comments? Acclaim?
Edward
P.S. There is still a place for Jupyter notebooks :-) They are an excellent way of collaborating. But I have no further interest in them.
EKR
In the same vein as Thomas, I was pushing Leo as an interactive notebook metasystem since years.
I think that those aha moment would be greatly improved by screenshots particularly depicting the interactive story behind Leo usage in the scientific notebook context as still is not represented in a way that showcases Leo's advantages. I would say that LeoVue is something to imitate regarding how to showcase Leo (maybe because of its multiple and versatile web views for Leo structured information).
Cheers,
Offray
--
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 view this discussion visit https://groups.google.com/d/msgid/leo-editor/9040e29e-f6db-451f-bf0a-251585c43610n%40googlegroups.com.
All interested in interactive notebooks,Please also consider marimo if it's unknown to you.It's claim of being "the future of python notebooks" is not far off the mark, IMO. It is an evolutionary step beyond Jupyter in my estimation.Interestingly, the necessity for marimo to process cells internally in a tree-like manner similar to Leo is an integral part of what makes it work.
P.S. There is still a place for Jupyter notebooks :-) They are an excellent way of collaborating. But I have no further interest in them.
Please also consider marimo if it's unknown to you.
marimo looks pretty cool! and a breath of fresh air in the
overcomplicated notebook space that Jupyter popularized. Once a
tool(kit) like Jupyter becomes the defacto standard in a community
(let's say data scientists) it is difficult to reimagine what can
be done in that space. That's why seeing things like Pluto.jl[1]
(named in the inspirations for marimo) that choose simplicity and
reproducible flat files over nested unreproducible JSON, as a
default for interactive computing is really inspiring.
[1] https://cinemaphile.com/watch?v=Rg3r3gG4nQo
In my case, after being pretty reluctant to web development
(mainly because of Javascript and all the messiness behind web
"standards" by committee ), seems that things like Pluto, marimo
and Hypermedia systems[2][2a] are showing that the time to develop
pretty interesting web experiences and publications without all
that incidental complexity and without the JavaScript monoculture
is finally arriving. I'll share my experiment on that front.
[2] https://hypermedia.systems/
[2a] https://hx-pod.transistor.fm
Cheers,
Offray
To view this discussion visit https://groups.google.com/d/msgid/leo-editor/2cd34e05-7bea-49b7-a562-63e72a0ee5ecn%40googlegroups.com.
Thomas,
I'm glad you liked :).
You should take a look of the Hypermedia podcast, particularly
the long recent chapter about Data-Star[1]. I think it gives you a
pretty broad overview of the possibilities of Hypermedia beyond
its flagship tech: HTMX
[1] https://data-star.dev/
I really like the moment we are arriving now, where web
development, particularly in the front-end, doesn't mean to
subsume yourself totally to the "Javascript mindset" with all its
technical design flaws, patchy features, gratuitous overcomplexity
and so on. I imagine instead that now I'll doing web stuff, that I
was thinking years ago, from my favorite computing environment:
Pharo/GToolkit, with sparks of Javascript here and there, without
making it or the web a "development platform" and thinking about
the web more like a "exportation target".
My idea for this holidays, is to use hypermedia for creating an interactive publishing format for the data stories we have made with Grafoscopio and see if, eventually, it can evolve to a (reactive) web notebook, working on several Smalltalk variants (but baby steps, I'll jus start with the interactive publishing format). As usual, I'll share preliminary results, when I see there is an overlap with the topics discussed here.
Cheers,
Offray
To view this discussion visit https://groups.google.com/d/msgid/leo-editor/8b139386-72de-476e-aeae-417292332ef7n%40googlegroups.com.
Thank you for the links! I'm just getting into reading the hypermedia book and already I can see that it's right up my alley. I stopped working with web frameworks when they got so complex and programming-oriented. I'm repelled by many modern javascript practices. As I started reading the book it felt like I had finally met a kindred spirit.
On second thought, the title of this thread is misguided.
pyplot can be fun.
I also recommend you develop a set of styles you like and save them to a style file in a known place.
You might want to check out plotnine, too, for plotting your datasets. You install it with pip.
Another fun little goodie is the attached outline. It contains a command that plots in a new tab in the log frame.
Hi,
I still fail to see the interactive story behind Leo usage,
particularly in the math learning context, and interactivity in
its most general sense is important for learning. See for example
the seam carving algorithm by Grant Sanderson, from the excellent
3Blue1Brown at [1], that is explained interactively with
Pluto.jl/Julia and reimplemented in marimo/Python. The educative
advantages from the explaining and learning sides are pretty
difficult to imagine by seeing just the source code or executing
it in batch mode, without interactivity.
[1] https://huggingface.co/spaces/marimo-team/seam-carving
As said, LeoVue and maybe the variant of Leo for VS Code/Codium
can convey this sense of interactivity, thanks to the integration
with web technologies. Maybe with Hypermedia and things like
FastHTML, much of that can be done within Leo. But I think that
this more interactive/visual storytelling is needed to make Leo a
good math platform for wider audiences.
Cheers,
Offray
--
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 view this discussion visit https://groups.google.com/d/msgid/leo-editor/7dac913d-b012-4e87-900a-1ad251df3ebcn%40googlegroups.com.
I still fail to see the interactive story behind Leo usage, particularly in the math learning context, and interactivity in its most general sense is important for learning.
My priority (singular) is to master ME 564. I intend to master the solutions to all exercises. Solutions using Jupyter Notebooks are acceptable, implying that Matplotlib suffices. I trust Steve Brunton to know his pedagogy. He's a brilliant educator.
Edward
Totally understandable. I just add that particularity for the assertion: Leo is superior to Jupyter notebook for Leo's main author and it's the best math platform for him.
As a tool maker myself, I share part of that feeling, as I think that Grafoscopio is a better tool than Jupyter or Leo for my purposes and the ones of my local community at the hackerspace: being able to adapt interactively the tool to our future needs. But I claiming that is the best for a general endeavor would be overselling Grafoscopio, to its detriment. I still find inspiring and superior use cases in Pluto, marimo, Leo in particular domains and I hope to learn from them and I don't consider that a distraction but a refreshing external view that reveals much of the blind spots that, by definition, I can not see by myself. And, of course, everyone can find seeing outside distracting or not.
Cheers,
Offray
--
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 view this discussion visit https://groups.google.com/d/msgid/leo-editor/70cdeab1-0515-47d1-8086-8abb8be70109n%40googlegroups.com.