11  Preparing Your Computer for the Experimental Interlude

Our experimental interlude includes running Python scripts to calculate functions and material features described in the lecture. Before continuing, please make sure that you have a working Python installation and that you can successfully run the required code.

11.2 Option 2: Install Spyder

Spyder is a user-friendly scientific Python development environment that resembles MATLAB and is particularly well suited for beginners.

If you installed Anaconda, Spyder is usually included automatically.

To launch Spyder:

  • Open Anaconda Navigator and click Launch next to Spyder, or
  • Open a terminal (or Anaconda Prompt) and type:
spyder

If Spyder is not installed, it can be installed through Anaconda Prompt:

conda install spyder

11.3 Verifying the Required Libraries

Open Spyder and create a new Python script containing:

import numpy as np
import matplotlib.pyplot as plt

from tqdm import tqdm  # Progress bar for long calculations

print("Everything is working!")

Run the script.

If the installation is working correctly, you should see:

Everything is working!

and no error messages should appear.


11.4 Installing Missing Packages

If you receive an error such as

ModuleNotFoundError: No module named 'tqdm'

open an Anaconda Prompt (or terminal) and install the missing package:

conda install tqdm

or

pip install tqdm

11.5 Final Checklist

Before the practical begins, make sure that:

import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm

If all boxes are checked, your computer is ready for the experimental interlude.

To gain time, you can already download the coordinate files from the shared University of Bristol folder: Data folder: Download the coordinate datasets

You can also run the contained code on one of the files in order to familiarize yourself with the output.

11.6 Option 3: Use Noteable (No Local Installation Required)

If you do not wish to install Python on your own computer, you can use Noteable, the University’s cloud-based Jupyter environment. A link to noteable is included in the Blacboard page of the lecture, in Resources and tools. This allows you to run Python code directly in your web browser and is particularly useful if you encounter installation issues.

11.6.1 Step 1: Log in to Noteable, upload the data and open the code

  1. Open Noteable through the Blackboard lecture page, in Resources and tools.
  2. Start a Standard Python 3 notebook (choose from the drop-down menu).
  3. Navigate to /shared-data-PHYSM0071_2026_TB-1/ (using the file explorer on the left).
  4. Copy the folder G(r) data in your root directory (/shared-data-PHYSM0071_2026_TB-1/ is read-only for students). Alternatively, if this folder is not showing, you can dowload the files from the Data folder , then click Upload (upwards arrow in the top left corner) and choose the data from the file explorer.
  5. Open the folder, and confirm that the files appear in the project file browser.

11.6.2 Step 3: Open a Terminal

Some parts of the practical require running Python scripts from the command line.

  1. Create a new thumbnail (opens the Launcher).
  2. Select Terminal.

A terminal window will open within Noteable.

11.6.3 Step 4: Edit the Python Script

The practical includes a Python script called:

DidacticGrCode.py

To edit it:

  1. Locate DidacticGrCode.py in the file browser.
  2. Click on the file to open it in Noteable’s text editor.
  3. Make any modifications requested during the practical.
  4. Save the file before running it.

11.6.4 Step 6: Run the Script

In the terminal, navigate to the folder containing the script and execute:

python DidacticGrCode.py

11.7 Final Checklist

Before the practical begins, make sure that:

python filename.py

If all boxes are checked, you are ready to participate in the experimental interlude using Noteable.