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:
-
Module Specific Skills and Knowledge:
- explain and use standard features of the Python programming language
including assignments, statements, iterators and objects;
- write and modify simple programs in Python;
- find errors and debug code;
- write structured code based on short routines with a clear purpose
and interfaces that are simple and unambiguous;
- write self-documenting code using docstrings and comments;
- select and apply existing tools for scientific programming
from modules including NumPy, SciPy, Matplotlib and Astropy,
based on the documentation;
-
Discipline Specific Skills and Knowledge:
- apply logic to the solution of problems;
- keep proper records of work;
- apply the Python programming language to simple physical
problems including calculations, modelling and data analysis;
- produce publication-quality plots;
- present a portfolio of work;
-
Personal and Key Transferable / Employment Skills and Knowledge:
- deal with the practicalities of writing a computer program;
- think and plan in a logical manner;
- apply a structured approach to problem solving.
Syllabus Plan
-
Introduction to Python 3 and Revision
- Running Python and Jupyter notebook
- Loading modules and packages
- Using Python as a graphical calculator; simple calculations, maths, functions and plotting
-
Core Python.
- Objects, assignments and variables, dynamic typing
- Numbers, comparisons and logic
- Strings and print statements
- Lists and tuples
- Sets and dictionaries
- Control flow: loops and if-statements
- File I/O
- Functions
-
Program Design and Practice
- Python scripts
- Self-documenting code with comments, docstrings and markdown cells
- Testing and debugging
- Handling errors and exceptions
-
Modules/Packages and Applications
- NumPy
- Matplotlib
- SciPy
- Astropy
-
Advanced Python
- Creating a Python module
- Introduction to classes and Object Oriented Programming
-
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 |