Introduction to Scientific Programming for Chemists

6 EC

Semester 1, period 2

5112ITSP6Y

Owner Bachelor Scheikunde (joint degree)
Coordinator prof. dr. L. Visscher
Part of Bachelor Chemistry (Joint Degree), year 3

Course manual 2022/2023

Course content

The course provides an introduction into scientific programming and scripting with the Python language. We start by covering the basics of programming: variables and operators, loops and conditional expressions, use of functions and libraries. We then pay attention to larger applications and data visualization. We end this part by discussing more advanced techniques in which the object-oriented features (classes, objects and methods, inheritance) that the Python language has to offer are used.

Examples will be taken from chemical research, mostly taking Python both as a programming language in its own right, but also discussing how python scripts can be used to glue together different existing scientific software tools to form sophisticated scientific modelling workflows.

For the latter purpose we also provide an introduction into the Unix operating system that is used in almost all scientific computing applications. Topics treated in this stage are: overview of hardware; operating systems; directories and files; file transfer; grep and regular expressions; editing with vi; sed and awk; shells and environment variables; running jobs via queueing systems.

 

Study materials

Literature

  • C. Hill, 'Learning Scientific Programming with Python', Cambridge University Press, ISBN 978-1-107-42822-5 (or the e-book version).

  • Hand-outs and online material

Software

  • Conda, Python

Other

  • Students are expected to have a (not too old) computer available for the self study part.

Objectives

  • understands the basics of structured and object-oriented programming. 
  • is able to create small programs in the Python language and use the language to script scientific workflows.
  • is familiar with the Unix operating system and its use in a research environment.

Teaching methods

  • Hoorcollege
  • Zelfstudie
  • (Computer)practicum
  • Lecture
  • Laptop seminar
  • Computer lab session/practical training
  • Self-study

This is a really "hands-on" course as one can only learn programming by doing it. The exercise classes play a central role as this gives opportunity to discuss your own programming solutions with the teachers. The lectures serve to introduce the programming concepts and language and will also be used to look back at the exercises of the previous week, discussing good and bad solutions to the problem that was posed.

Learning activities

Activiteit

Aantal uur

Zelfstudie

168

Attendance

Programme's requirements concerning attendance (OER-B):

  • Active participation is expected of each student in the course for which he is registered.
  • If a student cannot attend an obligatory part of a programme's component due to circumstances beyond his control, he must report in writing to the teacher in question as soon as possible. The teacher, if necessary after consulting the study adviser, may decide to issue the student a replacing assignment.
  • It is not allowed to miss obligatory parts of the programme's component if there is no case of circumstances beyond one's control.
  • In case of participating qualitatively or quantitatively insufficiently, the examiner can expel a student from further participation in the programme's component or a part of that component. Conditions for sufficient participation are fixed in advance in the study guide and/or on Canvas.

Additional requirements for this course:

For the assignments it is compulsory to discuss them with the teaching assistants. Grades are only given after this discussion has taken place.

Assessment

Item and weight Details

Final grade

1 (100%)

Tentamen 1

Students will be assessed based via an exam (50%) and via the assignments handed in during the course (50%). For the Unix module, the grade will be passed / not passed. In case of not passed, a re-exam is offered. Having obtained a passing grade for Unix is a prerequisite for passing this course as a whole. The final grade is the average of the grades obtained for the assignments during the course and the exam.

Assignments

All assignments should be made individually and grades are only final after a student has discussed his or her chosen program design with the teacher.

Fraud and plagiarism

The 'Regulations governing fraud and plagiarism for UvA students' applies to this course. This will be monitored carefully. Upon suspicion of fraud or plagiarism the Examinations Board of the programme will be informed. For the 'Regulations governing fraud and plagiarism for UvA students' see: www.student.uva.nl

Course structure

Weeknummer Onderwerpen Studiestof
1 Python basics: Installation, data types variables,  lists, printing, conditional execution Hill: 1+2, McCormack
2 Data input, storage and visualization: dictonaries, files, making simple plots Hill: 3+4
3 Scientific computing: efficiency of computation, use of NumPy Hill: 6
4 Modeling and advanced visualization: debug strategies, SciPy, matplotlib Hill: 7
5 Advanced Topics: classes, notebooks, external programs Hill:4.10, 5
6 Unix basics Online material
7 Unix applications Online material
8 Exam  

Processed student feedback

Changed compared to last year is to briefly introduce Jupyter notebooks. This is made possible by reducing the time spent on running external programs from within Python.

Contact information

Coordinator

  • prof. dr. L. Visscher

Staff

Prof. dr. L. Visscher

Dr. D. Dubbeldam

Mr. C. Chibueze