An introduction to Pluto
An introduction to Pluto
Posted Nov 4, 2020 13:19 UTC (Wed) by rschroev (subscriber, #4164)In reply to: An introduction to Pluto by spacefrogg
Parent article: An introduction to Pluto
In a Jupyter notebook, make a cell containing "a = 0" and run that cell.
Then make a cell containing "print(a)", and run it. It will output "0";
Make a third cell containing "a = 1" and run it.
Now run the second cell again. It will now output "1".
You now have a notebook looking like this:
a = 0
print(a)
-> 1
a = 1
You can now delete the third cell, making it even more confusing. In this example it's obvious that a might have an unexpected value, but in real notebooks the value of a often just used in calculations, not printed, making it unclear on exactly which values the calculation is based.
The problem disappears of you always run all cells from top to bottom, which is not hard to do, but Jupyter makes it even more easy to run selected cells one by one as users see fit. It's one of the main criticisms of Jupyter. I haven't read the article, but it looks like the Pluto authors have managed to avoid the problem altogether in Pluto.
Posted Nov 4, 2020 20:15 UTC (Wed)
by otaylor (subscriber, #4190)
[Link]
It's worth noting that (especially for scientific computations) some of the initial steps in your notebook might be very slow, so not always running from the top makes work much faster. Reinteract (https://www.reinteract.org/) tried to achieve stateless notebooks with partial re-execution for Python, but I abandoned it, among other reasons, because it was really hard to get things to work sensibly with the full Python ecosystem. (If a user changes
Julia is likely easier to build this type of system on top of - I'll have to look at the implementation of Pluto one day.
An introduction to Pluto
The problem disappears of you always run all cells from top to bottom, which is not hard to do, but Jupyter makes it even more easy to run selected cells one by one as users see fit. It's one of the main criticisms of Jupyter.
f.write('foo')
to f.write('bar')
then you have to go back and replay things from the point where you opened a file for writing.)