The Python for the Lab course is designed to show that anybody can build software for the lab. In this intensive 3-day course we will cover various topics, from the basics of communicating with a device, developing drivers, to building user interfaces.
Developing control software for labs with Python is becoming ubiquitous in all major research institutions around the world. Learn from examples, with real devices and measurements. The course Python for the Lab is aimed at small groups of up to 7 people, to deliver personalized content to every attendant.
Python for the lab was designed to make it attractive to scientists working on experiments, who are willing to automatize repetitive tasks or want to build software to control entire setups. Participants receive a custom-made acquisition card which will be used as an example device on which software will be developed, including a user interface, and a real experiment will be performed.
Do you like what you read, then drop us a line to firstname.lastname@example.org and we will glad to clarify any of your doubts. This course is offered to groups of up to 7 people in order to keep a balanced instructor/student ratio.
About the Course
The workshop is aimed at young scientists willing to learn how to control devices and automatize tasks in the lab. Prerequisite: working knowledge of a programming language such as Matlab, Python, C, etc. Participants should understand the basics of computer programming, such as for-loops, if-statements, etc. The workshop is designed to be hands-on since the beginning, performing measurements with a real device. The idea is to give attendees the basic tools to start their projects, not only in terms of selection of libraries, but also in terms of decisions that will ensure that programs are sustainable in the longer term.
We will use Python as the programming language and will rely on known libraries such as numpy to do some basic data manipulation. PyQt5 will be used to build user interfaces, and PyQtGraph to do real-time plots of a signal. We will discuss specific libraries for interfacing with instruments, such as pyVISA, pySerial, and frameworks such as Lantz, which are normally not covered in any other workshops. We will use PyCharm as the Python editor and QtDesigner for building user interfaces.
Requisites & Duration
To follow the workshop, you will need to bring a laptop with any operating system you normally use and with which you feel comfortable. The acquisition device, which will be provided by the instructor, is USB2 compatible, therefore it works with any PC. One week before the workshop you will receive instructions to install the needed software.
The workshop demands 3 full days. Time can be adapted according to the group dynamics, and some topics such as introduction to version control, distribution of packages, etc. can be included based on attendees’ experience and interests. Certificates of completion are given upon completion of the workshop.
About the Instructor
Aquiles Carattino completed his Ph.D. in experimental Physics in 2017. During this period, he started developing software for his experiments, and in 2017 founded a company to develop software for research labs. By the end of 2017, he created pythonforthelab.com and started offering workshops aiming at creating a strong community of python developers around common technologies and practices. In early 2019, Aquiles and some partners founded a new company to develop the next generation of nanoparticle tracking devices, which are planned to be released to the market in early 2020.
Very quick introduction to Python, with special focus on class definition and application. Introduction to the device to be used during the course.
Development of the driver. Discussion about timing, debugging, and general problem solving.
Expanding the code to make it reusable and easy to share. Learning about the MVC design pattern and its implications on software for hardware and the lab
Introduction to PyQt, building the first user interface for the experiment. Learning why the MVC patter is so useful in these scenario. Exploring QtDesigner.
Introduction to threads, signals and slots to produce a fluid user interface. Plotting data in real-time thanks to PyQtGraph
Polishing details of the program. Improving how to save data and metadata in order to repeat measurements. Time to answer questions, show how to navigate the documentation of Qt, etc.