PHY2035 Scientific Programming in Python 2023-24
Dr J. Hatchell
 
Delivery Weeks: T1:01-11
Level: 5 (NQF)
Credits: 15 NICATS / 7.5 ECTS
Enrolment: 120 students (approx)

Description

A knowledge of a computing language and how to write programs to solve physics related problems is a valuable transferable skill. It is taught though a series of practical sessions in which the student will initially learn to understand the logic of the source code and are required to modify the code for a number of prepared projects. This module teaches the Python programming language, but the principles involved are applicable to almost every procedural programming language.

Module Aims

This module aims to build on the introduction to programming in Python given in the IT Skills training in Stage 1 (e.g. PHY1027) in order to develop students' ability to write clear, structured, debuggable and maintainable computer programs in Python and to understand such programs written by others.

Intended Learning Outcomes (ILOs)

A student who has passed this module should be able to:

Syllabus Plan

  1. Introduction to Python 3 and Revision
    1. Running Python and Jupyter notebook
    2. Loading modules and packages
    3. Using Python as a graphical calculator; simple calculations, maths, functions and plotting
  2. Core Python.
    1. Objects, assignments and variables, dynamic typing
    2. Numbers, comparisons and logic
    3. Strings and print statements
    4. Lists and tuples
    5. Sets and dictionaries
    6. Control flow: loops and if-statements
    7. File I/O
    8. Functions
  3. Program Design and Practice
    1. Python scripts
    2. Self-documenting code with comments, docstrings and markdown cells
    3. Testing and debugging
    4. Handling errors and exceptions
  4. Modules/Packages and Applications
    1. NumPy
    2. Matplotlib
    3. SciPy
    4. Astropy
  5. Advanced Python
    1. Creating a Python module
    2. Introduction to classes and Object Oriented Programming
  6. Projects
    A number of projects based upon the Stage 2 physics course. The background physics required for each project is provided for the student in the project description.

Learning and Teaching

Learning Activities and Teaching Methods

Description Study time KIS type
11×1-hour lectures 11 hours SLT
11×2-hour supervised computer labs 22 hours SLT
Directed self-study and project work 56 hours GIS
Reading to support own learning requirements 61 hours GIS

Assessment

Weight Form Size When ILOS assessed Feedback
13% Homework assignment 8 hours Deadline Monday week T1:04 1-16 Written and verbal
13% Homework assignment 8 hours Deadline Monday week T1:06 1-16 Written and verbal
30% Programming Knowledge and Skills Test 1 hour 30 T1:06 1-9, 11, 13-16 Written and verbal
13% Homework assignment 8 hours Deadline Monday week T1:09 1-16 Written and verbal
31% Programming Project 32 hours Deadline Friday week T1:12 (Friday) 1-16 Written and verbal

Resources

The following list is offered as an indication of the type & level of information that students are expected to consult. Further guidance will be provided by the Module Instructor(s).

Core text:

Supplementary texts:

ELE:

Further Information

Prior Knowledge Requirements

Pre-requisite Modules Mathematics Skills (PHY1025) and Electromagnetism I (PHY2021)
Co-requisite Modules none

Re-assessment

Re-assessment is not available except when required by referral or deferral.

Original form of assessment Form of re-assessment ILOs re-assessed Time scale for re-assessment
Programming Knowledge and Skills Test Test (1hr 30min) 30% wt 1-9, 11, 13-16 August/September assessment period
Programming Project and Homework Assignments Programming Project (32 hours) 70% wt 1-16 August/September assessment period

KIS Data Summary

Learning activities and teaching methods
SLT - scheduled learning & teaching activities 33 hrs
GIS - guided independent study 117 hrs
PLS - placement/study abroad 0 hrs
Total 150 hrs
Summative assessment
Coursework 70%
Written exams 0%
Practical exams 30%
Total 100%

Miscellaneous

IoP Accreditation Checklist
  • Not applicable, this is an optional module.
Availability unrestricted
Distance learning NO
Keywords Physics; Program; Structures; Function; Codes; Project; Data; Computing; Arrays; Designing.
Created 01-Sep-18
Revised 01-May-21