-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove In[*] from cells when notebook is restarted #2460
Comments
That sounds reasonable to me, and should hopefully be easy to implement. I think you could just add a handler for the |
Hey! Can I try to tackle this issue? |
Please do! Can you see what you might need to do? You'll probably want to search for the |
Sweet! I'll probably get to this on Friday |
And I got to this much earlier than Friday. I'm looking into doing something here. Am I looking in the right place? If I am, does anyone have any suggestions on removing the |
The code that updates the |
I'm thinking of adding an if statement to determine if the notebook has been restarted somewhere here my only issue though is i'm not sure how to determine if the notebook had been restarted. I'm not sure if this is the way I should be going about this since i'm not sure if there is any data to tell me anything about that. |
That code runs when the user executes a cell - I think the issue here is with restarting the kernel after that has happened. I think the way to do this will be to handle the kernel_restarting event in codecell.js , in the notebook/notebook/static/notebook/js/notificationarea.js Lines 117 to 120 in faa0cab
But inside the handler, if the prompt number is |
Hi! I'm making some progress on the issue. I was able to write the event listener here. The issue I'm having now is that it doesn't seem to actually run when the event is triggered since nothing is logging to the console. Am I doing something wrong? |
That looks right. Stick a |
Hmm doesn't seem to calling it. I even tried running the debugger 😢 |
I just tried your branch, and when I restart the kernel, I do see KERNEL HAS RESTARTED in the Javascript console. Are you rebuilding the Javascript after modifying it? The notebook doesn't load the separate js files directly - instead they're bundled into one big file to make it load quicker. There are instructions on how to work with this here: http://jupyter-notebook.readthedocs.io/en/stable/contributing.html#setting-up-a-development-environment |
Hmm I did try that, but it's still not showing up for me. I even tried restarting the notebook. I'm just supposed to run |
It doesn't matter where you run the command, but you need to do You might also need to hard refresh your browser a couple of times to make sure it's not loading the JS from cache. |
Argh. It's still not working and I also ran it in incognito mode :( |
Possibly you're not running the copy of the notebook package that you've modified. This can be fiddly. Try these steps:
|
Closed by #3494 |
I often restart a notebook when a cell hangs.
If several cells were executed, they are all left with
In[*]
when the notebook is restarted, which can be confusing.I suggest simply removing all occurrences of
In[*]
when the notebook is restarted.The text was updated successfully, but these errors were encountered: