1. Getting started¶
- Read the Requirements section.
- Install, configure and test your development environment (Development environment).
- Create a Git repository for your team/project (Creating a team development repository) from the provided template.
- Read Using Git.
- Read the Deliverables section, and with your team consider dependencies between ‘tasks’ in the deliverables and allocate independent tasks to a team member (Project planning).
- Start implementing your tasks (Editing and executing Python code).
Start simple and work in small steps. It is much easier to add functionality to a working program than to fix a complicated non-working program.
When developing your programs, you may need to review the activity notebooks from Michaelmas Term.
1.1. Development environment¶
Experienced developers have their preferred tools and development environments. If you are experienced with Git, Python and using editors, you are free to use your preferred tools.
The following procedures and tools are suggested.
1.1.1. Software installation¶
1.1.2. Terminal (command line)¶
Some of the following steps require a command line terminal. To open a command line terminal:
- Linux and macOS: Open a ‘Terminal’.
- Windows: Launch ‘Anaconda Prompt’.
1.1.3. Install and configure Git¶
Open a terminal/command prompt.
conda install git
Configure Git with your name and email address
git config --global user.name "John Doe" git config --global user.email email@example.com
Configure Git to use VS Code
git config --global core.editor "code --wait"
You will need to configure Git on each computer that you use.
1.1.4. Testing your Python installation¶
Open the ‘Anaconda Navigator’ program.
From Anaconda Navigator, launch VS Code.
Create a new file in VS Code with the extension
.pyand enter some simple Python code, e.g.:
print("Testing Python install")
Right-click from VS Code on the file and select Run Python File in Terminal. The output of your program should appear in a terminal window inside VS Code.
1.2. Creating a team development repository¶
Cambridge students Follow the instructions on the course Moodle page to create your team repository.
Others Template start code is at https://github.com/CambridgeEngineering/PartIA-Flood-Warning-System.
Fetch a local copy of your repository by cloning it. The ‘Code -> Clone’ button on the GitHub page for your repository gives the address of your Git repository. From a terminal:
git clone <address of my repository>
You should now have a local (on your computer) copy of the code.
From the terminal, enter the code directory attempt to execute file
(If you are not using Anaconda, on some systems you may need to use
You should see some output on river level monitoring stations.
The Python code from which you will start uses some modules
dateutil) that are not part of the Python
standard library, but which are distributed as part of Anaconda. If
you see an error that a module is missing, you can install the module
pip install requests pip install python-dateutil
1.3. Editing and executing Python code¶
- From Anaconda Navigator launch ‘VS Code’ and from VS Code open your local code repository directory.
- Open/create the files you wish to edit. ‘Module’ files should go in
Task*.pyfiles should go in the root directory of the repository.
- Use right-click -> ‘Run Python File in Terminal’ on the program text in VS Code to run the Python code.
Python code can be run directly from a terminal. In a directory
containing Python code in a file named
test.py, it can be be
executed from the terminal using:
As you develop you programs, commit your changes (using Git) and push these to your shared online repository. If you are unsure how often to commit and push changes, err on the side of committing and pushing frequently. Commit at least upon the completion of each task.
1.4. Automated testing¶
The starter template repository includes the file
.github/workflows/pythonapp.yml which configures automated testing,
known as continuous integration (CI), on GitHub. Against each commit
you will see on the GitHub repository page whether or not the tests are
.github/workflows/pythonapp.yml to run your deliverables in the
test system and to add code tests to your test suite.
1.5. Project planning¶
- Examine the first few project deliverables, and divide independent tasks amongst team members. Each team member can then work on tasks independently.
- Communicate frequently with team members to update them on your progress, and seek help from a team member if required.
- As tasks are completed review each others work and provide feedback.
- As you progress through the tasks, periodically assess which tasks are independent and allocate these to a team member.