Skip to content

Weekly process for lab

K Clough edited this page Sep 10, 2025 · 7 revisions

For those using Google Colab

Download the new lab file from the module page into a folder, and then upload it from there to Colab (do Open Colab, then Upload and select it from your directory). You can now edit it and run it in the browser. Edits should be automatically saved, and a copy will be kept in your Google Drive.

For those using the python installation (e.g. Anaconda) on their own machine, but not GitHub

First thing, activate your virtual environment:

conda activate myenv

Download the new lab file from the module page, and put it in a folder you can access from the command line. Navigate to the folder in the command line and type jupyter notebook to open the interface in your browser. Open the lab file and edit it, save any changes before closing the browser.

To kill the process in the terminal after closing the browser, you may need to do Ctrl-C and confirm you want to kill the process.

For those using GitHub

First thing, activate your virtual environment:

conda activate myenv

Now go to GitHub and pull any new updates from my repository into your fork. My recommendation is to do this via the web interface of GitHub, by making a pull request on the equivalent page to this one for your own fork. Click on the big green new pull request button.

The base branch should be your fork's main branch (where you want the changes to go) and the compare branch will be the main branch from the parent repo (my repo) - note that to access this you will need to click on the blue wording compare across forks. Once selected, you can view all the changes to be merged and approve it - the process is mostly self explanatory.

You still need to pull these changes from the cloud to your machine. To do so, first check you are in the main branch of your repository, by doing:

git status

If you are not, checkout the main branch:

git checkout main

Now pull the changes from the cloud:

git pull origin main

Now you want to start working on the exercises for the week in a new branch. To do this follow the setting up a new branch instructions.

Now work on the exercises, and save any changes using the jupyter interface. At the end of the class you want to save these, so now follow the adding changes to your branch instructions.

Now all your work is saved in the cloud on this branch!

You may at this point want to switch back to the main branch so you are ready to start again next week:

git checkout main

Last thing, deactivate your environment:

conda deactivate myenv
Clone this wiki locally