1. Getting started

  1. Read the Requirements section.

  2. Install, configure and test your development environment (Development environment).

  3. Create a Git repository for your team/project (Creating a team development repository) from the provided template.

  4. Read Using Git.

  5. 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).

  6. Start implementing your tasks (Editing and executing Python code).

Tip

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.

Note

When developing your programs, you may need to review the activity notebooks from Michaelmas Term.

1.1. Development environment

Note

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. Option 1: Web-based environment

You can use GitHub Codespaces, which provides a development environment in your browser.

1.1.2. Option 2: Local software installation

  1. Install Visual Studio Code (https://code.visualstudio.com/).

    Visual Studio Code will provide instructions on how to install git and python when you need them. Otherwise, instructions at https://code.visualstudio.com/docs/sourcecontrol/overview and https://code.visualstudio.com/docs/languages/python.

1.1.3. Testing your Python installation

  1. Create a file in VS Code with the extension .py and enter some simple Python code, e.g.:

    print("Testing Python install")
    
  2. Click the ‘play’ button at the top of the open file.

1.2. Creating a team development repository

  1. Log into GitHub (create an account using your @cam.ac.uk email address, or use any other GitHub account you wish).

  2. One team member only: The template start code is at https://github.com/CambridgeEngineering/PartIA-Flood-Warning-System. Click on the green “Use this template” button, select “Create a new repository” give your new repository a name. Make your repository “private”. In the “Settings” section for your repository add your team members as “Collaborators” and share the name of the repository with team members.

  3. Clone your team’s repository using VS Code “Source control”.

  4. From VS Code, execute file Task1A.py. You should see some output on river level monitoring stations.

Note

The Python code uses some modules (requests and dateutil) that are not part of the Python standard library. If you see an error that a module is missing, you can install the module using pip. Use:

pip install requests python-dateutil

in the terminal window.

1.3. Editing and executing Python code

  1. Launch VS Code and open your local code repository directory.

  2. Open/create the files you wish to edit. ‘Module’ files should go in the directory floodsystem/. The Task*.py files should go in the root directory of the repository.

  3. Use right-click -> ‘Run Python File in Terminal’ on the program text in VS Code to run the Python code.

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 passing.

Edit .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

  1. Examine the first few project deliverables, and divide independent tasks amongst team members. Each team member can then work on tasks independently.

  2. Communicate frequently with team members to update them on your progress, and seek help from a team member if required.

  3. As tasks are completed review each others work and provide feedback.

  4. As you progress through the tasks, periodically assess which tasks are independent and allocate these to a team member.