Overview#

physlab-hub is meant to provide an ecosystem of high-quality, interactive applications to explore some of the basic concepts underlying the physics laboratories in a typical undergraduate physics curriculum, spanning from elementary probability and statistics to more advanced signal processing and data analysis techniques.

Warning

The project is still in its early stages of development, and we are writing this as we develop the software—expect this page to change quickly!

Design goals#

We tentatively identify the following design goals for the project:

  1. we want students to be able to install and use the software locally with minimal effort and no other dependencies in addition to what is already required for our typical lab courses: a recent Python installation along with numpy, scipy, and matplotlib;

  2. we would like to make it easy for students to study the source code of the applications;

  3. we would like the applications to be interactive, responsive on a typical laptop installation, and visually appealing;

  4. we would like to be able to deploy and serve the applications on the web, so that students can use them without installing anything at all. (It goes without saying, web applications should run in isolation, with no shared state between users.)

Taken at face value, these goals imply some interesting tradeoffs. At the very top level, 1. indicates that the backbone of the applications should be written in pure matplotlib, and having simple, self-contained python scripts would probably be best in terms of making the code easy to study and understand. (Although the interactive layer will necessarily pollute the core logic, which is what the students are primarily concerned with, and we should put some thought into how to minimize this impact.)

On the other hand, serving the applications on the web in any meaningful form will likely require the use of some sort of web framework, which in turn implies an even more complex code structure to clearly separate the core logic from the interactive display, and minimize the duplication of code. This will almost certainly raise the entry barrier to studying the code, and we will have to be careful to mitigate this as much as possible.

Technologies#

The technologies that we are currently exploring for the project are:

  • Python, numpy and scipy for all the core logic and numerical computations (e.g., statistical functions, optimization, signal processing);

  • matplotlib for the core plotting and interactive display when the applications are run locally; that is, we will use native matplotlib widgets (e.g., sliders and buttons) rather than relying on a more complex GUI framework such as PyQt, PySide or Tkinter;

  • Panel for the interactive display when the applications are served on the web, probably relying on Bokeh as the underlying plotting library.

In order to minimize duplications, this will require a strict separation between the core logic and the visualization layer. The latter will need to be implemented in parallel across two different code paths—matplotlib for the local applications and Panel for the web applications.

A simplified, non interactive version of each application might be an interesting option to explore as well, as it would allow students to focus on the core logic without worrying about the interactive layer at all. We need to understand how much extra work, code duplication and maintenance burden this would imply.