Live data from Hacker News

JupyterLab 4.0

blog.jupyter.org

71–80 of 199 posts

Re: JupyterLab 4.0

#71
post #37

Earlier quoted context omitted.

> - I get an analysis that I like, but there isn't a good way to share it with others, so I end up just taking screenshots. Jupyter supports printing out as a PDF, an all-in-one-webpage and all sorts of other formats. I've used this and the support for Markdown to create a number of documents that I've presented up the leadership chain, or to other engineers across the org "Here's the data, here's the narrative, and…

Do you have a way to store data directly into the notebook? I do a bunch of device testing and I have master notebooks setup to analyze and condense raw data. I use papermill to evaluate the master notebook to generate a report. But I want to also store/attach intermediates (say a named numpy array) into the notebook for further analysis.

> I want to also store/attach intermediates (say a named numpy array) into the notebook for further analysis.

Is the issue that you do not want to save the data and report into a folder and distribute that? That is, you want an entirely self-contained notebook? Or is there something else going on here?

I'm sure that's possible but it seems kind of wrong to put your binary "data" in with your analysis and presentation-making code.

Re: JupyterLab 4.0

#72
post #47

I have been using VSCode notebooks with .ipynb file extensions, this gives me many advantages as I am able to configure things I'm not able in JupyterLab. I also have access to a very rich ecosystem of plugins. If there is anyone aware of VSCode as a solution but keeps using JupyterLab, could they explain why?

I too use VS Code as my Jupyter platform (running remotely on a powerful EC2 instance with 32 CPUs and 256GB RAM — my own desktop is a 7 year old Intel core i7 with 8GB RAM). VS Code’s Remote extension is amazing, works over any SSH host and seamlessly blends local and remote. It’s also fast since the UI is local while the filesystem and execution is remote. The experience is a lot better than JupyterLab (which I am…

Really interesting setup. What kind of monthly expense does this run?

And on a separate but related note, does it change the way you think about how you spend your time coding? (Assuming the costs do ramp up with usage such that time literally does equal money?)

Re: JupyterLab 4.0

#73

I have been using VSCode notebooks with .ipynb file extensions, this gives me many advantages as I am able to configure things I'm not able in JupyterLab. I also have access to a very rich ecosystem of plugins. If there is anyone aware of VSCode as a solution but keeps using JupyterLab, could they explain why?

I've not been back to full-fledged Jupyter since getting in to VSCode. Most of my analytical work now is done in .py files, broken up into blocks with `#%%`. Real notebooks feel really clunky since adopting the approach.

Does `#%%` have special meaning to the tooling? Are you able to view the output as a pseudo-notebook?

EDIT: Googled and answered my own question. Here are docs describing the feature: https://code.visualstudio.com/docs/python/jupyter-support-py

And a video demoing what you are describing: https://www.youtube.com/watch?v=lwN4-W1WR84

Re: JupyterLab 4.0

#74
post #37

Earlier quoted context omitted.

> - I get an analysis that I like, but there isn't a good way to share it with others, so I end up just taking screenshots. Jupyter supports printing out as a PDF, an all-in-one-webpage and all sorts of other formats. I've used this and the support for Markdown to create a number of documents that I've presented up the leadership chain, or to other engineers across the org "Here's the data, here's the narrative, and…

Do you have a way to store data directly into the notebook? I do a bunch of device testing and I have master notebooks setup to analyze and condense raw data. I use papermill to evaluate the master notebook to generate a report. But I want to also store/attach intermediates (say a named numpy array) into the notebook for further analysis.

The problem with that is that Jupyter requires a back-end to do any of the actual processing that runs the code in the cells.

Only way I can think to make the html file truly portable while fully functional would be to embed a python interpreter and all required libraries as wasm.

Could be possible with pyodide? I haven't used it.

Re: JupyterLab 4.0

#75

I keep experimenting with Jupyter in the context of telemetry/fault analysis and then hitting a wall with it where: - I get an analysis that I like, but there isn't a good way to share it with others, so I end up just taking screenshots. - There isn't a good way to take the same analysis and plug new data into it, other than to copy-paste the entire notebook. - The process to "promote" fragments of a notebook into be…

You may be interested in papermill to address the parametrized analysis problem [1]. I think (but I'm not positive) this is what the data team at a previous job used to automate running notebooks for all sorts nightly reports.

[1] https://papermill.readthedocs.io/en/latest/#

Re: JupyterLab 4.0

#76
post #16

Earlier quoted context omitted.

> There aren't good boundaries between Jupyter's own Python environment, and that of your notebooks— if you have a dependency which conflicts with one of Jupyter's dependencies, then good luck. It's cumbersome, and I'm not totally sure it's the correct way, but I remember getting around this by creating a virtualenv for my projects and then using that virtualenv's python as Jupyter's "kernel".

had a ton of trouble getting jupyterlab to target an arbitrary virtualenv

The trick is that you have to deactivate the virtual environment and then resource it after adding Jupyter to that virtual environment.

Most shells cache executable paths, so the path for jupyter will be the global path, not the one for your virtual environment. This is unfortunately not at all obvious and leads to very hard to track down bugs that seem to disappear and reappear if you aren't familiar with the issue.

I have a recipe here which always works: https://github.com/nlothian/m1_huggingface_diffusers_demo#se...

If you don't have requirements.txt then do this: `pip3 install jupyter` for that line, then `deactivate` and `source ./venv/bin/activate`.

Re: JupyterLab 4.0

#77
post #47

Earlier quoted context omitted.

I too use VS Code as my Jupyter platform (running remotely on a powerful EC2 instance with 32 CPUs and 256GB RAM — my own desktop is a 7 year old Intel core i7 with 8GB RAM). VS Code’s Remote extension is amazing, works over any SSH host and seamlessly blends local and remote. It’s also fast since the UI is local while the filesystem and execution is remote. The experience is a lot better than JupyterLab (which I am…

Really interesting setup. What kind of monthly expense does this run? And on a separate but related note, does it change the way you think about how you spend your time coding? (Assuming the costs do ramp up with usage such that time literally does equal money?)

I’ve no idea what the cost is since the company pays for it — I do need the horsepower to run some really large models and I suspect most people don’t need this kind of spec. But for my company it’s just part of the cost of doing business.

There’s no IT and I can provision instances of any type (subject to limits) at any time.

Re: JupyterLab 4.0

#78
post #47

Earlier quoted context omitted.

I too use VS Code as my Jupyter platform (running remotely on a powerful EC2 instance with 32 CPUs and 256GB RAM — my own desktop is a 7 year old Intel core i7 with 8GB RAM). VS Code’s Remote extension is amazing, works over any SSH host and seamlessly blends local and remote. It’s also fast since the UI is local while the filesystem and execution is remote. The experience is a lot better than JupyterLab (which I am…

I'm curious about your setup as I might have to do something similar soon due to my machine's performance constraints. I understand you can connect to a Jupyter server remotely, but how do you sync your code? Do you have your Git repo cloned on the remote host and just run Git commands over SSH? Or does VS Code have some kind of integration for remote file systems with version control?

My code resides entirely on the remote EC2 instance while VS Code UI runs locally. There is no sync as such. You’re working off the remote copy via SSH. (I do back up my code periodically)

VS code takes care of spinning up the remote Jupyter server. All I have to do is create a new .ipynb file and everything happens automatically. Execution and disk are remote, only the UI is local. This is the magic.

It’s exactly like SSH except you have a rich client IDE in VS Code. The only data that moves over the network are your keystrokes and pastes and what is needed to display output in VS Code. You have to try it to see.

Re: JupyterLab 4.0

#79
post #11

Can somebody give me a quick rundown on the difference between JupyterLab and JupyterNotebook? Whose the target audience for each one?

The Jupyter Notebook interface/server just opens singular notebooks (i.e. one notebook per browser tab). Jupyter Lab is an IDE where you can open notebooks, files, terminals, etc all in one interface. Additionally, you can easily adjust the layout of open files (want notebooks side by side? Click one notebook's tab and drag it to one side of the screen. Want a terminal on the bottom of the screen? Open a terminal and…

when I install `pip install jupyter && jupyter notebook`, I can still create Py notebook,s text files or shell terminals.

I still dont quite get that is diff btw jupyter nb vs jupyterlab.

My understanding is notebook for single user locally, while jupyterlab is multi-user running on server, something like that

Re: JupyterLab 4.0

#80
post #47

Earlier quoted context omitted.

I too use VS Code as my Jupyter platform (running remotely on a powerful EC2 instance with 32 CPUs and 256GB RAM — my own desktop is a 7 year old Intel core i7 with 8GB RAM). VS Code’s Remote extension is amazing, works over any SSH host and seamlessly blends local and remote. It’s also fast since the UI is local while the filesystem and execution is remote. The experience is a lot better than JupyterLab (which I am…

I'm curious about your setup as I might have to do something similar soon due to my machine's performance constraints. I understand you can connect to a Jupyter server remotely, but how do you sync your code? Do you have your Git repo cloned on the remote host and just run Git commands over SSH? Or does VS Code have some kind of integration for remote file systems with version control?

Check out the remote SSH (https://code.visualstudio.com/docs/remote/ssh) extension. It makes everything really painless. I'm currently developing a website that resides in a docker container in a digitalocean server, and editing the code in VSCode feels literally no different at all to running it locally. If you have the SSH keys set up it's completely painless.

The other nice thing about VSCode is that you can extend it with VSCode Neovim (https://marketplace.visualstudio.com/items?itemName=asvetlia...), which runs a headless version of Neovim and allows you to do all the wonderful things that that entails, including stuff like VSCode's native multiple cursor implementation (and Lua config files!). All in all it's a great workflow, it's pretty light, and if you're paying for (or self-hosting) a beefy server it can turn any laptop into a powerhouse.

Post reply on HN