This setup guide will help you get started with using git and Jupyter to work on your lab assignments.
You will work with a partner on all labs after Lab 1. You must reselect a partner for each lab, so you may continue with the same person or choose a different partner the following week.
Complete the Lab Partner Selection Form. Only one student from each partnership needs to submit the form. You can change partners by resubmitting it; your latest submission will be used. If you do not submit the form, the instructor will assign you a partner.
Deadline: Lab partners cannot be changed after noon on the day the lab is released. The instructor may occasionally override requested partnerships.
We will be using GIT for all labs; if you need a refresher, check https://www.cs.swarthmore.edu/git/
You should be able to find all lab assignments in the course GitHub organization https://github.swarthmore.edu/orgs/CS63-Fall26/repositories
For each lab, a private repository will be created for you. The repository name will have the following format: lab01-SECTION-USERNAME. For partnered labs, one repostory will be shared between both partners.
Do the following steps to get the starting point code. Replace SECTION with your lab section and USERNAME with your own username. The $ represents the command prompt.
For this lab, we'll be using a development environment called Jupyter. The primary advantage of this platform is that it provides "notebooks," which are a way of interweaving Python code segments and their output with descriptive text, equations, graphs, and more.
Like any tool, Jupyter has its advantages and disadvantages, and we won't be using it for every lab this semester, but it's an excellent fit for the goals of this warmup lab.
To run Jupyter on one of our CS machines, you just need to do the following:
$ source /usr/swat/bin/CS63
$ jupyter-lab
The first command configures the Python environment so you'll have access to all the packages that we'll be using this semester; it needs to be run once (in any given terminal) before jupyter-lab. If you forget to do this, then jupyter-lab likely won't launch at all; if you get a command not found error, it's probably because you forgot to source the correct Python virtual environment.
The source command should actually change your command prompt, putting a (CS63) in the front; this is a reminder that it's worked correctly, and you can run Jupyter.
When you run jupyter-lab, it should launch a web browser (or open a tab in an existing browser window). There should be a file browser in the panel on the left; the root directory will be whatever directory you ran the jupyter-lab command in (if you followed the directions above, this should be your cs63 directory). Navigate to the Lab 0 directory and double click on the file named python_warmup.ipynb; doing so should open the notebook in the large panel on the right.
From here, all the remaining instructions are in the notebook; start reading at the top, and follow the directions in the notebook.
When you're finished, you can quit Jupyter by clicking the "File" menu and selecting "Shut Down" at the bottom. Alternatively, if you type [Ctrl-c] twice in the terminal you ran the command in, that will also shut down the program.
Note that if you want the (CS63) to go away, you can deactivate the virtual environment:
$ deactivateHowever, this is not strictly necessary, since the virtual environment really only effects the versions of Python and Python libraries; all other commands should work normally regardless of whether you are in the CS63 environment or not.
When you're done, be sure to remember to use GIT to add/commit/push the changes you've made!
To submit your work, you'll need to use Git to add, commit, and push your changes to the remote repository. Make sure to do this before the deadline. Any commits after the deadline will be considered late submissions.
If you need help with your lab assignment, don't hesitate to ask your instructor or a teaching assistant for assistance. Please make sure to commit and push the latest version of your code before asking for help. This allows the instructor or teaching assistant to see your code and provide help.
It it very important to follow the academic integrity and AI policies at all times as you work on your labs. Please review the policies in the course syllabus and on the course website.
If you want to run Jupyter remotely (i.e. over an SSH connection, as opposed to on a machine you're physically logged in to), you'll need to add a couple of extra steps to the normal process. This is because Jupyter Lab is actually running a web server that your browser connects to; if the server and the browser are on the same machine, this happens automatically, but if you're connecting remotely you need to tell the two machines how to connect your local browser to the remote server.
The steps for running Jupyter remotely are as follows:
To access the server, open this file in a browser:
file:///home/mitchell/.local/share/jupyter/runtime/jpserver-581164-open.html
Or copy and paste one of these URLs:
http://localhost:6311/lab?token=833c29214af009d97714c2a852333e47cb8a954dba7d9e7d
or http://127.0.0.1:6311/lab?token=833c29214af009d97714c2a852333e47cb8a954dba7d9e7d
The details will vary slightly (i.e. you won't have the same port and token
number).