jupytercalpoly / reactivepy

A reactive Python kernel
BSD 3-Clause "New" or "Revised" License
86 stars 11 forks source link

Unexpected behavior when reordering cells #34

Open ryanlovett opened 5 years ago

ryanlovett commented 5 years ago

When I reordered the first two cells in notebook via drag-n-drop: screen shot 2018-12-18 at 3 19 20 pm

I expected to see an exception that a was undefined. I also thought the cell execution numbering (i.e. [N]) would get reset.

ellisonbg commented 5 years ago

A key point is that the graph of cells that determines their dependencies is maintained in the kernel and is independent of the spatial ordering of the cells. This was one of the pain points (order dependence of cells) of the normal IPython kernel that this kernel is trying to tackle. Put another way - we consider it a key feature that users can re-order their cells without worrying about what gets run when. An outstanding question is how to manage this when a kernel is just started and cells haven't been run (what is the right initial run order?).

On Wed, Dec 19, 2018 at 12:16 PM Ryan Lovett notifications@github.com wrote:

When I reordered the first two cells in notebook via drag-n-drop: [image: screen shot 2018-12-18 at 3 19 20 pm] https://user-images.githubusercontent.com/10248125/50245439-4edbb280-0387-11e9-8a42-d92f7f1b6108.png

I expected to see an exception that a was undefined. I also thought the cell execution numbering (i.e. [N]) would get reset.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jupytercalpoly/reactivepy/issues/34, or mute the thread https://github.com/notifications/unsubscribe-auth/AABr0G30kVi8Ft1FzHL4qKmGLXbEQRI_ks5u6p6sgaJpZM4Za9Fz .

-- Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger@calpoly.edu and ellisonbg@gmail.com

dldx commented 5 years ago

Does it help to look at how Observable does it? https://beta.observablehq.com/@mbostock/how-observable-runs