I'll be teaching a group of nine and ten years olds to code. I'm planning on using Jupyter.
What I'd really like to do is make a multiplayer naval game, with each player controlling their ship from their own notebook. Players would start out by running commands like fire(range=400, bearing=120) right from a cell, but would later be able automate their ship - for example, pick the nearest enemy, get the range, and plug that into firing automatically at it.
My server would be projecting a big map of the world up on the wall.
However, to do this nicely, I need the ability to make a cell (or a function defined in a cell) run every X milliseconds. I know I can do this for one cell, with a loop and sleep function, but I'd really rather have multiple cells/functions "running", so we can break the code into smaller chunks, and to let them build their own ship UIs.
Any advice on how to do this in Juptyer with Python? In an ideal world, I'd just "tag" a cell somehow so that it ran periodically.
Also the modular packages they have built are amazing. They have a node package called @jupyterlab/services which lets you write typescript code for your own libraries that can then call the Jupyter Server.
An example of using JupyterLab services is provided on their GitHub:
Mathematica is wonderful in terms of sheer computational power, but the notebook interface it presents is hopelessly outclassed nowadays by initiatives such as these. I keep hoping Wolfram will spring some impressive new interface on us that will enhance usability for power users (rather than their weird attempts at bringing ‘computation’ to random casual users), but... I'm giving up hope.
Loving Jupyter, I use it every day and for sure I will try this out. What I do miss though is good separation between code and data, it is a pain when someone just takes a look at your notebook and it autosaves, the code block counters reset, this alters the file and GIT reports a lot of alterations.
This is really exciting for the team! However I don't think that I am particularly sold on the notebook style of coding.. its possible that I simply haven't found a good use case for it, can anyone suggest an example where the notebook style outperforms a simple script based style?
For reference, I use Matlab and Mathematica pretty heavily, and python in a text editor like sublime along with a terminal running ipython shell.
I find notebooks to be great for prototyping longer pipelines or processes. Instead of having to constantly get fresh data, particularly if it's from an external API, the notebook can persist the data in memory and you can iterate on the next piece of the process right there.
I then take that and make it a more formal script/process w/ version control and all that fun stuff. They're also really great for learning. I just wouldn't put them in production :-)
I'm using RStudio notebooks heavily in my latest bioinformatics analysis pipeline. They're a great way to produce an HTML report containing code, exposition, results, and plots all in one place.
Besides the other replies, notebooks are also great for an extremely easy literate programming style, i.e. when you want to explain in text or images as much as you want to do. Not only is that easy to create as a notebook, it's easy to share.
It's hugely helpful in the consulting world. We use it all the time for proof-of-concept type work -- it's much easier to present a notebook to a CTO than a bunch of scripts.
It makes sense for one off / exploratory idea style scripts - exactly the sort of thing that scientist will do, which is probably why its so popular with them.
If I'm writing code for data science purposes and I'm not planning on putting that code directly into production (i e. exploratory analysis, general offline analysis, etc.)
So I can now use a decent text editor (emacs) to edit Jupyer notebooks? Great! I do wish it was possible to interleave languages like with org-mode, though. I've yet to find a literate programming/notebook format I'm truly happy with.
Edit: oh.. I misread. It doesn't support using external editors. All I want is some way to edit those text boxes with another program. I can't do any serious work in a web browser. It's awful.
I have used it quite productively for a while, but at the moment have mostly moved back to the browser for my notebooks. I can recommend to collect larger functions in a separate source file (for Emacs editing bliss) which you import to the notebook. [import helpers; reload(helpers)]
You can evaluate different cells using different kernels, by using a cell magic command. So a notebook can have a mix of languages. Is this something like what you are after?
I'd really like 1 thing from those articles. I didn't knew what Jupyter was in first place.
So please dear authors when I click on your articles I'd like to have a single sentence somewhere on the landing zone where I can easily figure what we're talking about and not having to read entire paragraphs
The source article is a blog entry on the Jupyter project's blog; i don't think its unreasonable to expect that readers of the Jupyter blog have some idea what Jupyter is; its kind of unreasonable to expect every blog entry to repeat that.
Now, readers of HN might not know, and HN's decision (which is, on balance, I think beneficial) to not allow additional supporting commentary besides the title on posts with links to outside articles prevents contextualizing this well for HN readers. (Perhaps allowing one or a small number of supporting links with very brief annotations might be an improvement, but we really do want to avoid Slashdot-style editorializing of submissions, which the current setup does quite efficiently.)
I love the term "reproducible computational narratives" from their post. This is a great step toward making software accessible for everyone. In addition, imagine how transparent governments and open source communities can be by helping explain the algorithms in use with a clear provided sense of understanding for everyone. On the project level, it can be useful for keeping it simple. It's all good stuff!
So let's say I am progressing inside a jupyter notebook top to bottom. I run code blocks, then some markdown, then code blocks, and so on.
At some point I need to drop down to the terminal to run something. I run commands in the terminal I collect some results or collect some info and go back to my notebook to resume my work inside it.
Later I need to look up something in a text file. I open a certain text file. Browse to a certain line number, read that line, maybe edit the text file, and close the text file to go back to my notebook.
Does JupyterLab keep a record of the point in my progress in the notebook when I switched to the terminal or the text file, what I ran in the terminal, and what info was used? If I edited the text file, what was before and after of the text file? In other words, does JupyterLab help with the chronology of workflow events?
If not, I don't see how this is anything other than hundreds of "IDE"s out there.
Notebook format has its own issues, but going back to IDE is not a solution. Offering both notebook and an IDE at the same time and leaving it up to the user to make the best of the combo is not a solution either, unless the offering helps some kind of a way of eliminating the cons of either format.
Jupyter doesn’t track the execution history of your cells like this.
However, you can run the shell commands straight from a notebook cell (use the %%bash cell magic or prepend the line with !).
Not sure what to do about editing data files. If you can do this with something like awk, just use a shell magic cell, but if it needs to be done manually I guess you’re stuck manually documenting this in markdown?
Replying to my own comment, I have a plot and a text file open side by side. I want to change a value in the text file and I want the plot to be updated automatically. The update might not be trivial, behind the scenes maybe the text file is an input to a simulation that runs for a minute, then computes some values in a table that are used for the plot. Can Jupyter allow you to do that?
Point being, offering an IDE in 2018 is not interesting unless you added something "smart" to the IDE that makes the life of the engineer/scientist easier compared to the rest. Otherwise, IDE's are being developed for the last three decades or more.
At the same time, the community has faced challenges in using various software workflows with the notebook alone, such as running code from text files interactively. The classic Jupyter Notebook, built on web technologies from 2011, is also difficult to customize and extend.
Do I read this correctly as hinting that Jupyter Notebook is being replaced by an IDE?
We should disambiguate the term "jupyter notebook" here. Jupyter notebooks, as documents that contain code, markdown, math, widgets, etc., are a central feature of JupyterLab. Jupyter notebooks are not going away, and are getting better in JupyterLab.
The "Jupyter Notebook" web application (i.e., the browser application that was originally released in 2011) will eventually be replaced with JupyterLab.
Having used JupyterLab alpha extensively, I don't think so. JupyterLab makes the 'notebook' one type of document, rather than the only type of document.
So it extends Jupyter Notebooks by giving you new IDE-like features, whilst retaining the ability to write notebooks.
> JupyterLab 1.0 will eventually replace the classic Jupyter Notebook. Throughout this transition, the same notebook document format will be supported by both the classic Notebook and JupyterLab.
Jupyter was already one of the greatest Python projects out there, this just takes it to another level. I can't wait to use this. Enormous kudos to the Jupyter team.
This especially includes things like "Table of Contents", "Variable Inspector", "Ruler", and "Execute Time". How easy will it be to have all of this functionality in the JupyterLab notebooks? There's certainly advantages to having data/terminals/notebooks in an IDE-style layout, but for the moment it would still be two steps back, one step forward for me personally. This is to disparage the effort, JupyterLab clearly is the future!
First of all these are not "official" (hence why it's a different organisation on GitHub) and all is maintained by community.
It will take some time to port all the existing extensions, but the good news is that JupyterLab has been thought to work with extensions (actually everything in JupyterLab is an extension with no privileged component), so it will be easier to write these for JupyterLab than for current notebook.
The documentation on writing extension is also way better than for Classic notebook, and we had new contributor writing extension in 2 to 3 hours.
Been trying to use JupyterLab over the weekend and had some issues with it. The idea is great though. I also look forward for the extensions. Data pipelines and dashboards can be built in visual applications much more quickly than with coding, so maybe we can now program extensions for that? Also, with vegalite and flask you can build dashboards from scratch and jupyterlab is great there (as you can mix code and notebooks). I think jupyterlab is very well positioned for being a complete end to end analytics tool from raw data to dashboards and visuals. If the extensions are powerful enough on the UI side, who knows? Maybe even business users could use jupyterlab.
I like Medium, but I always struggle to find a link to the company's site. Is this hidden somewhere? I had to google it to find it, not that it was hard, but I thought it would somewhere on their Medium blog.
When i checked two weeks ago, there was a bug that when opened a notebook with large number of cells(~200), in firefox, it would freeze for about 10 seconds if the window was resized. The problem, as i know, only occurs in Firefox, not in Chrome.
This was problematic, especially for me, as I open documentation on other side of the window and keep resizing the window as part of my habit. But, overall JupyterLab was great. You can work on the same notebook side by side too and has a file manager/viewer panel.
[+] [-] danielvf|8 years ago|reply
What I'd really like to do is make a multiplayer naval game, with each player controlling their ship from their own notebook. Players would start out by running commands like fire(range=400, bearing=120) right from a cell, but would later be able automate their ship - for example, pick the nearest enemy, get the range, and plug that into firing automatically at it.
My server would be projecting a big map of the world up on the wall.
However, to do this nicely, I need the ability to make a cell (or a function defined in a cell) run every X milliseconds. I know I can do this for one cell, with a loop and sleep function, but I'd really rather have multiple cells/functions "running", so we can break the code into smaller chunks, and to let them build their own ship UIs.
Any advice on how to do this in Juptyer with Python? In an ideal world, I'd just "tag" a cell somehow so that it ran periodically.
[+] [-] RobinL|8 years ago|reply
The things I'm most impressed with (relative to Jupyter Notebooks, which were already amazing):
- The ability to render .geojson, .json, markdown, Vega and Vega lite files, and integrate external tools like Voyager.
- The new terminal is a joy to use compared to what came before it
- The ability to set out multiple windows easily, much like an IDE
- The plugin ecosystem means that we can start writing custom components for the analytical platform we're building.
Thanks so much to the team!
[+] [-] SimonBiggs|8 years ago|reply
An example of using JupyterLab services is provided on their GitHub:
https://github.com/jupyterlab/jupyterlab/tree/master/package...
Because of the way they built their packages I have been able to stand on the shoulder of giants and build the following tool:
https://github.com/SimonBiggs/scriptedforms
I am very grateful to the JupyterLab team. They have built something brilliant.
[+] [-] Quenty|8 years ago|reply
https://colab.research.google.com/notebook
[+] [-] qubex|8 years ago|reply
This looks very impressive.
[+] [-] teekert|8 years ago|reply
[+] [-] sinab|8 years ago|reply
For reference, I use Matlab and Mathematica pretty heavily, and python in a text editor like sublime along with a terminal running ipython shell.
[+] [-] veritas3241|8 years ago|reply
I then take that and make it a more formal script/process w/ version control and all that fun stuff. They're also really great for learning. I just wouldn't put them in production :-)
[+] [-] jasongrout|8 years ago|reply
[+] [-] rcthompson|8 years ago|reply
https://github.com/DarwinAwardWinner/CD4-csaw (look at scripts/*.Rmd)
[+] [-] aeorgnoieang|8 years ago|reply
[+] [-] ng12|8 years ago|reply
[+] [-] collyw|8 years ago|reply
[+] [-] chibg10|8 years ago|reply
[+] [-] cdelsolar|8 years ago|reply
[+] [-] cup-of-tea|8 years ago|reply
Edit: oh.. I misread. It doesn't support using external editors. All I want is some way to edit those text boxes with another program. I can't do any serious work in a web browser. It's awful.
[+] [-] rerx|8 years ago|reply
I have used it quite productively for a while, but at the moment have mostly moved back to the browser for my notebooks. I can recommend to collect larger functions in a separate source file (for Emacs editing bliss) which you import to the notebook. [import helpers; reload(helpers)]
[+] [-] optimali|8 years ago|reply
I haven't had as much luck using it for other languages, but I also haven't put in much effort into trying.
[+] [-] leephillips|8 years ago|reply
[+] [-] smortaz|8 years ago|reply
If you like to try it, pick any of your libraries, right click and select “open in JupyterLab”.
[+] [-] carreau|8 years ago|reply
[+] [-] monkeydust|8 years ago|reply
[+] [-] make3|8 years ago|reply
[+] [-] mirages|8 years ago|reply
So please dear authors when I click on your articles I'd like to have a single sentence somewhere on the landing zone where I can easily figure what we're talking about and not having to read entire paragraphs
Thanks,
[+] [-] dragonwriter|8 years ago|reply
Now, readers of HN might not know, and HN's decision (which is, on balance, I think beneficial) to not allow additional supporting commentary besides the title on posts with links to outside articles prevents contextualizing this well for HN readers. (Perhaps allowing one or a small number of supporting links with very brief annotations might be an improvement, but we really do want to avoid Slashdot-style editorializing of submissions, which the current setup does quite efficiently.)
[+] [-] afshin|8 years ago|reply
> JupyterLab is an interactive development environment for working with notebooks, code, and data.
[+] [-] shalabhc|8 years ago|reply
[+] [-] mav3r1ck|8 years ago|reply
[+] [-] fizixer|8 years ago|reply
At some point I need to drop down to the terminal to run something. I run commands in the terminal I collect some results or collect some info and go back to my notebook to resume my work inside it.
Later I need to look up something in a text file. I open a certain text file. Browse to a certain line number, read that line, maybe edit the text file, and close the text file to go back to my notebook.
Does JupyterLab keep a record of the point in my progress in the notebook when I switched to the terminal or the text file, what I ran in the terminal, and what info was used? If I edited the text file, what was before and after of the text file? In other words, does JupyterLab help with the chronology of workflow events?
If not, I don't see how this is anything other than hundreds of "IDE"s out there.
Notebook format has its own issues, but going back to IDE is not a solution. Offering both notebook and an IDE at the same time and leaving it up to the user to make the best of the combo is not a solution either, unless the offering helps some kind of a way of eliminating the cons of either format.
[+] [-] rsfern|8 years ago|reply
However, you can run the shell commands straight from a notebook cell (use the %%bash cell magic or prepend the line with !).
Not sure what to do about editing data files. If you can do this with something like awk, just use a shell magic cell, but if it needs to be done manually I guess you’re stuck manually documenting this in markdown?
[+] [-] fizixer|8 years ago|reply
Point being, offering an IDE in 2018 is not interesting unless you added something "smart" to the IDE that makes the life of the engineer/scientist easier compared to the rest. Otherwise, IDE's are being developed for the last three decades or more.
[+] [-] KKKKkkkk1|8 years ago|reply
Do I read this correctly as hinting that Jupyter Notebook is being replaced by an IDE?
[+] [-] jasongrout|8 years ago|reply
The "Jupyter Notebook" web application (i.e., the browser application that was originally released in 2011) will eventually be replaced with JupyterLab.
[+] [-] RobinL|8 years ago|reply
So it extends Jupyter Notebooks by giving you new IDE-like features, whilst retaining the ability to write notebooks.
[+] [-] ndanmand|8 years ago|reply
Guess so :-)
[+] [-] fredley|8 years ago|reply
[+] [-] goerz|8 years ago|reply
This especially includes things like "Table of Contents", "Variable Inspector", "Ruler", and "Execute Time". How easy will it be to have all of this functionality in the JupyterLab notebooks? There's certainly advantages to having data/terminals/notebooks in an IDE-style layout, but for the moment it would still be two steps back, one step forward for me personally. This is to disparage the effort, JupyterLab clearly is the future!
[+] [-] carreau|8 years ago|reply
It will take some time to port all the existing extensions, but the good news is that JupyterLab has been thought to work with extensions (actually everything in JupyterLab is an extension with no privileged component), so it will be easier to write these for JupyterLab than for current notebook.
The documentation on writing extension is also way better than for Classic notebook, and we had new contributor writing extension in 2 to 3 hours.
So we encourage you to try and send us feedback !
[+] [-] kfk|8 years ago|reply
[+] [-] ibdf|8 years ago|reply
[+] [-] carreau|8 years ago|reply
[+] [-] skshetry|8 years ago|reply
This was problematic, especially for me, as I open documentation on other side of the window and keep resizing the window as part of my habit. But, overall JupyterLab was great. You can work on the same notebook side by side too and has a file manager/viewer panel.
[+] [-] wodenokoto|8 years ago|reply
[+] [-] carreau|8 years ago|reply
It would be great to have community plugins that make R-Studio able to open Jupyter files, and JupyterLab open R-Studio files !
[+] [-] unknown|8 years ago|reply
[deleted]
[+] [-] SimonBiggs|8 years ago|reply