Teaching (Python) programming for self-driving labs

I recently came across the following via a blog post, which is a topic I and many others have thought a lot about. What are some of the best practices involved with teaching Python to scientists who don’t have a background in programming? Especially considering time limitations and a very application-oriented focus.

(Note about the blog post that pointed me here: CodeGrade seems like a nice solution, though I use GitHub Classroom when making coding assignments).

I collected a variety of resources at Hackathon resources | Bayesian Optimization Hackathon for Chemistry and Materials for learning Python (see “Python” section). While I haven’t used these myself (see note at bottom of this post), these are either ones that have been recommended to me by people in the accelerated discovery field or ones I’ve identified that seem to have a nice structure and set of topics.

While designing https://ac-microcourses.readthedocs.io/, I tried to identify the bare minimum of Python topics/background required and made a Python refresher assignment with a GitHub Classroom integration based on this. Feedback I’ve received is that there can be so many new things for AC microcourses where some would feel more comfortable with something focused more exclusively on Python for materials / chemistry informatics and self-driving labs. However, GitHub Classroom and the way I use it gives people experience using the same tools they would as a software developer and learning best practices. I try to give full walkthroughs (usually video walkthrough) for pieces that aren’t directly tied to the learning outcomes of that particular assignment while avoiding being stifling for things that are tied to the learning outcomes.

As an aside, I took a rather unique path of learning Python. As an undergrad in physics, I learned Mathematica as my first language with some very structured and high-quality courses from the school (computational physics classes) and frequently used it in courses for assignments through the end of grad school. As a master’s student in mech eng I used MATLAB extensively. As a Ph.D. in materials science & eng, I taught myself Python via Python kernels within Mathematica on a specific project and passing data back to Mathematica when I got too frustrated, then back to the Python kernel. I almost exclusively used Google / stackoverflow for looking things up.

Really curious to hear others’ thoughts on these topics, both in terms of lessons learned, best practices, gotcha-s to avoid, and specific content/courses/tools that have been effective for you. I know many professors in the field have given this a lot of thought and have personal anecdotes of how things have gone.

2 Likes

A nice perspective by @sergei2:

The New Language of Science: How to Learn Python Effectively