Introduction to Jupyter Notebooks on Sagehen HPC
Welcome!
This workshop teaches you how to use Jupyter Notebooks for interactive Python development on the Sagehen HPC cluster. Jupyter Notebooks combine executable code, text explanations, and visualizations in a single document, making them ideal for exploratory analysis, teaching, and scientific computing.
Why take this workshop?
Jupyter Notebooks are powerful tools for computational research, and when combined with the resources of an HPC cluster, they become even more valuable. After this workshop, you will be able to:
- Understand what Jupyter Notebooks are and why they’re useful for research
- Launch Jupyter on Sagehen using the OnDemand portal
- Work with different cell types (code, markdown) and understand the notebook execution model
- Write Python code that explores data and produces visualizations
- Manage Python environments and install packages for your notebooks
- Apply best practices for reproducible and shareable notebooks
- Convert notebooks to different formats and automate analyses
What you’ll need
- Your Pomona College account with HPC access
- A web browser (Chrome, Firefox, Safari, or Edge)
- Access to the Sagehen HPC cluster (sagehen.hpc.pomona.edu)
- Basic Python knowledge (variables, functions, simple data structures)
- 30-40 minutes for the full workshop
If you’re new to Python, we recommend learning Python basics first. This workshop assumes you can write simple Python statements.
Workshop structure
This workshop is organized as follows:
| Episode | Time | Topic |
|---|---|---|
| 1 | 15 min + 5 ex | What Are Jupyter Notebooks? — history, use cases, and why notebooks on HPC |
| 2 | 15 min + 10 ex | Launching Jupyter on Sagehen via the OnDemand portal with proper resource requests |
| 3 | 15 min + 10 ex | Notebook interface basics — JupyterLab layout, file browser, and the kernel model |
| 4 | 20 min + 15 ex | Working with cells — code vs. markdown, execution order, and editing shortcuts |
| 5 | 20 min + 10 ex | Python fundamentals in notebooks — imports, variables, control flow |
| 6 | 25 min + 20 ex | Data analysis in notebooks — loading, exploring, and summarising data |
| 7 | 15 min + 10 ex | Visualization in notebooks — matplotlib basics and inline figures |
| 8 | 20 min + 15 ex | Managing kernels and environments — conda envs and custom kernels for Jupyter |
| 9 | 15 min + 10 ex | Sharing and exporting — HTML, PDF, .py, and integrating with version control |
| 10 | 15 min + 10 ex | Best practices for reproducible, shareable notebooks |
Total teaching time: ~5 hours (175 minutes teaching + 115 minutes exercises, plus breaks)
Key technologies
This workshop focuses on tools available on Sagehen:
- JupyterLab - Interactive notebook environment (modern Jupyter interface)
- Python 3 - Programming language (via conda)
- conda - Environment and package management
- Sagehen HPC cluster - Computing resources with module system
- OnDemand portal - Web interface for cluster access (https://ondemand.hpc.pomona.edu/)
Learning outcomes
By the end of this workshop, you will be able to:
- Explain what Jupyter Notebooks are and their advantages for computational research
- Launch JupyterLab on Sagehen with appropriate resource requests
- Create and execute notebook cells with proper output handling
- Write Python code that loads, processes, and visualizes data
- Create and switch between Python environments
- Manage dependencies reproducibly using environment files
- Export notebooks to HTML, PDF, or Python scripts
- Apply version control best practices to notebook-based workflows
Getting help
If you encounter issues during the workshop: - Email: its-hpc@pomona.edu (most reliable) - Slack: #hpc-help channel (Pomona CS Slack workspace) - Office hours: See ITS-HPC website for Andrew Wilson’s availability - Troubleshooting: Check the Reference section for common issues
Before you begin
Please complete the following before the workshop:
- Verify HPC access: Try logging into https://ondemand.hpc.pomona.edu/ - if it works, you’re ready
- Check browser compatibility: We support modern Chrome, Firefox, Safari, and Edge
- Test internet connection: Jupyter requires a persistent network connection
-
Optional: Create a work directory:
ssh sagehen && mkdir -p ~/jupyter-workshop
Ready to get started? Let’s dive in!
Questions or suggestions? Please contact its-hpc@pomona.edu or open an issue on our GitHub repository.
Acknowledgments
Developed by Andrew Wilson, Director of Research Computing and Digital Scholarship at Pomona College, with Andrei Motchenko, who tested, edited and produced screenshots for the workshop series.
| Setup Instructions | Download files required for the lesson | |
| Duration: 00h 00m | 1. What Are Jupyter Notebooks? |
What is a Jupyter Notebook? Why are Jupyter Notebooks useful for computational research? How do Jupyter Notebooks differ from regular Python scripts? |
| Duration: 00h 20m | 2. Launching Jupyter on Sagehen HPC |
How do I launch Jupyter on the Sagehen HPC cluster? What is the OnDemand portal and why use it? How do I request the right amount of compute resources? |
| Duration: 00h 45m | 3. Notebook Interface Basics |
What does the JupyterLab interface look like? How do I create my first notebook? Where does my data live on Sagehen HPC? How do I stop my session when done? |
| Duration: 01h 10m | 4. Working with Cells |
How do I create and edit cells in a notebook? What’s the difference between code cells and markdown cells? How do I run cells and understand cell execution? Why does execution order matter? |
| Duration: 01h 45m | 5. Python Fundamentals in Notebooks |
How do I write Python code in notebooks? How do I import and use common data science libraries? How do I load data from CSV and other formats? What’s special about IPython magic commands? |
| Duration: 02h 15m | 6. Data Analysis in Notebooks |
How do I explore and summarize data in a notebook? How do I select, filter, and modify data with pandas? How do I work with data stored on Sagehen HPC? How do I keep a notebook reproducible as analysis grows? |
| Duration: 03h 00m | 7. Visualization in Notebooks |
How do I create plots and visualizations in Jupyter? What types of plots are available with matplotlib? How do I create multi-panel figures with subplots? |
| Duration: 03h 25m | 8. Managing Kernels and Environments |
What is a kernel and how does it affect my notebook? How do I manage and restart kernels? What is a Python environment and why do I need one? How do I create a conda environment for my project? |
| Duration: 04h 00m | 9. Sharing and Exporting Notebooks |
How can I convert notebooks to other formats? How do I use version control with notebooks? How do I share reproducible research? |
| Duration: 04h 25m | 10. Best Practices |
How do I organize notebooks for reproducibility? What are best practices for naming and documenting? How do I scale notebooks to production workflows? What common mistakes should I avoid? |
| Duration: 04h 50m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
What You Need
Before the workshop, please verify the following:
1. Pomona College HPC Account
You need an active HPC account on the Sagehen HPC cluster.
Verify your account
- Go to https://ondemand.hpc.pomona.edu/
- Log in with your Pomona College username and password
- Complete DUO authentication on your phone
- If you see the OnDemand dashboard, you’re ready!
If you can’t log in: - Verify your Pomona username (ask ITS Help Desk if unsure) - Ensure DUO is registered (register at https://duo.pomona.edu/) - Contact its-hpc@pomona.edu for account issues
2. Web Browser
You’ll use your web browser to access JupyterLab. Ensure you have a modern browser:
- Google Chrome (recommended)
- Firefox (recommended)
- Safari (Mac)
- Microsoft Edge (Windows)
Avoid very old versions of Internet Explorer.
3. Internet Connection
Jupyter requires a persistent network connection to the cluster. Ensure:
- Stable WiFi or wired connection
- If on campus WiFi, make sure you’re on “Pomona” network (not “Guest”)
- Off-campus? VPN may be required (check with ITS Help Desk)
4. Basic Python Knowledge
This workshop assumes you know:
- Variables and data types (strings, numbers, lists)
- Simple functions and for loops
- How to read and understand error messages
If you’re new to Python, we recommend completing a Python basics tutorial first. Good resources:
Python Learning Resources
- Codecademy Python Course (interactive, free): https://www.codecademy.com/learn/learn-python-3
- Python for Everybody (comprehensive, free): https://www.py4e.com/
- Kaggle Python Micro-Courses (bite-sized, free): https://www.kaggle.com/learn/python
All assume no prior experience. Complete any of these and you’ll be ready!
Pre-Workshop Checklist
Before the workshop, complete these steps:
If all items are checked, you’re ready for the workshop!
Optional: Pre-Workshop Learning
If you want to get ahead:
-
Learn basic Python (if new to programming)
- Complete 1-2 hours of Python basics
- Understand variables, loops, functions
-
Explore pandas DataFrames (data analysis library)
- DataFrames are like spreadsheets in Python
- Used heavily in our examples
- (But we’ll teach this during the workshop, so it’s optional)
-
Browse Jupyter documentation
- Visit https://jupyter.org/ to see what Jupyter is
- Watch a 5-minute “Jupyter Notebook tutorial” video on YouTube
- (We’ll cover everything in the workshop, so this is just for context)
Workshop Materials
The workshop provides:
- 6 interactive episodes covering Jupyter from basics to best practices
- Code examples you can run in JupyterLab on Sagehen HPC
- Hands-on exercises to practice what you learn
- Reference guide with common commands and troubleshooting
All materials are available through the workshop website (you’re reading it now!).
Getting Help Before the Workshop
If you encounter issues:
Can’t access OnDemand: - Email: its-hpc@pomona.edu - Subject: “Can’t access OnDemand” - Include: your Pomona username, error message (if any)
Trouble with DUO: - Contact ITS Help Desk: (909) 621-8061 - Or: https://www.pomona.edu/its/ - They handle DUO issues
Browser problems: - Try a different browser (Chrome, Firefox) - Clear browser cache (Ctrl+Shift+Delete / Cmd+Shift+Delete) - Try in incognito/private mode
Internet connectivity: - Try on campus WiFi or wired connection - Off-campus? Contact ITS about VPN access
Python knowledge gaps: - Check resources above for 1-2 hours of learning - Basic Python is essential; reach out if you need guidance
Troubleshooting Sagehen HPC Access
If you can’t access OnDemand:
Check 1: Is OnDemand the right URL? - Correct: https://ondemand.hpc.pomona.edu/ - Wrong: ondemand.hpc.pomona.com (no “https”)
Check 2: Are you using the right username? - Pomona username (what you use for email) - Not your full name - Not “student” or generic names
Check 3: Is DUO working? - Check your phone: Is DUO app installed and current? - Is your device registered at https://duo.pomona.edu/? - Try “Call me instead of code” if codes don’t work
Check 4: Is the cluster working? - Check cluster status: its-hpc@pomona.edu - Rarely, Sagehen goes down for maintenance - Status posted on cluster website
Still stuck? - Email: its-hpc@pomona.edu - Include: - Your Pomona username - Exact error message (copy-paste) - What you’ve already tried - Preferred contact method and time
What Happens During the Workshop
The workshop is hands-on and interactive:
- First episode: Lecture + discussion about Jupyter (15 min) + small exercise
- Subsequent episodes: Lecture (20-40 min) + guided exercises (15-25 min)
- Each exercise: You write code in JupyterLab on Sagehen and see results immediately
- Challenges: Optional deeper exercises for those who want more challenge
You’ll need: - A web browser open to OnDemand - JupyterLab launched (we’ll do this in Episode 2) - Time to type and think
Questions?
Reach out anytime:
- Email: its-hpc@pomona.edu
- Slack: #hpc-help (Pomona CS Slack workspace)
- Office Hours: See instructor availability on ITS-HPC website
We’re here to help you succeed!