The Jupyter Project creates powerful open source tools for interactive computing. Jupyter tools power many of the most important discoveries and learning experiences in computing.
GitHub Codespaces makes exploration, development, and experimentation using notebooks in Jupyter simpler by automating the set up and management of development environments so you don't have to configure anything on your computer, and you can take advantage of powerful cloud computing environments. This repository provides a straightforward, yet impactful, way to explore the power of using JupyterLab in Codespaces.
Credit for the data and notebook: WR-DustERS, ERS 1349, PI - R. Lau, personal communication, April 2023
This repository contains a Jupyter notebook that converts processed data from the JWST MIRI instrument and uses astropy.visualization
to render an image of the WR-140 binary star system showing the dynamically generated dust rings. For more details about the research see:
- DustERS team site https://www.ir.isas.jaxa.jp/~ryanlau/WRDustERS/index.html
- Nature publication https://www.nature.com/natastron/volumes/6/issues/11
The steps below illustrate using JupyterLab as the prefered IDE for Codespaces. There are many other ways to use Jupyter, and some are detailed below.
- Go to your GitHub settings, and select Codespaces
Then return to this page at https://github.com/craiglpeters/dusters-wr-140
- Set JupyterLab as your preferred IDE
- Then CMD + click on the "Open in GitHub Codespaces" badge at the top of this page to open the start in a new tab so you can keep going through these steps.
You won't have to install anything on your computer to run the notebook! (If you are already in a codespace, you don't need to click the button again - nothing bad will happen, but, you know 😜, Inception.)
Note: GitHub provides you 120 core-hours of Codespaces for free each month. The Jupyter kernel requires some resources, so it is recommended to use at least a 4 core Codespaces machine for this repository, which means you'll get 30 hours free a month. See About Billing for GitHub Codespaces for more details.
- If you already have a codespace running with the current repository you will be asked if you want to connect to it, or start a new one
- Codespaces may show you a brief "setting up" screen
- Next you'll land on the JupyterLab launcher page
- Select the WR140_MIRI_Image.ipynb notebook by double-clicking it
Note: Codespaces has started and connected you automatically to the correct IPython kernel
- Select "Run All Cells" from the Run menu
- Scroll down and look at the gorgeous image of the spiraling dust being emitted from the rotating binary star system observed by the JWST MIRI instrument
You can then explore more about GitHub Codespaces in the documentation, and find others in the Codespaces Community Discussions.
This repository is configured with a Dev Container to install all the tools and settings you need for your Codespaces environment so you don't have to worry about them. For more information about how this repository is configured, and how you can do this for your own projects, see the Codespaces: Introduction to Dev Containers documentation.
There are many other ways (this link outlines a few in more detail) you can use JupyterLab in Codespaces:
- Open the WR140_MIRI_Image.ipynb document by clicking on it in the file Explorer in VS Code for the Web.
- Run a Jupyter server manually in a Codespace by typing
jupyter lab
in the terminal, then CMD+Click one of the published URLs - Select the
Open in...
option for the already running codespace listed on the https://github.com/codespaces page, and choose Jupyter - Start a codespace from the Code dropdown menu in a GitHub Pull Request
- Start a codespace from a new branch created from the Issues developmet brach dialog
- Start a codespace from the VS Code client
- Use the
gh cs jupyter
cli
- Codespaces Documentation: Getting Started with GitHub Codespaces for Machine Learning
- VS Code Marketplace: Jupyter Extension
- VS Code: Jupyter Notebooks
- Dev Containers Specification
- Default image which contains JupyterLab https://github.com/devcontainers/images/tree/main/src/universal
- This repository is configured to start quickly by using Codespaces Prebuilds. A prebuild is used to install the python packages required for the notebook ahead of time, so that when you start a codespace you don't have to wait for the package installation to complete. To learn more see About GitHub Codespaces Prebuilds.
- GitHub CLI https://docs.github.com/en/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli#open-a-codespace-in-jupyterlab