2

I will shortly be teaching a second-year Python-based course on scientific computation in a mathematics department. It is just a one semester course with many things to cover, so I do not want to spend too much time on any one thing. However, I would like to get the students to read and understand a small chunk of code from one of the mainstream open source libraries, maybe numpy or scipy or pandas or perhaps something less obvious. Of course, if you look at a random file from one of those projects you will probably find multiple layers of abstraction and code organised in non-obvious ways to maximise flexibility, generality or efficiency. I would rather avoid that, and try to find something that is still a real example but is relatively straightforward. Does anyone have suggestions?

1 Answers1

2

Here are the best options I have found so far:

I am still interested in other ideas.

  • Looking at this code, despite it being relatively simple, I guess there is a good reason mathematics is a better language to convey ideas. My suggestion would be to stay away from major libraries (it is fine to use numpy and other things as a basis, but I wouldn't recommend a fem library) as they focus on efficiency and tremendous generality which are incompatible with most pedagogical goals. Efficiency is often at odds with readability and clarity, and generality leads to massive levels of abstractions in which students will get lost. – lightxbulb Jan 28 '24 at 22:05