This repository houses the web app that implements the C-SEF mechanism for resource-constrained pooled testing for COVID-19. For more information, see this arxiv paper. A version of this app was used for the C-SEF trial at the Potosinian Institute for Scientific Research and Technology.
The web app is implemented using the Flask micro framework. Our implementation uses Mosek to solve the underlying conic programmes to allocate tests. Mosek is a commercial solver that offers free academic licences. The flask-babel
package allows to painlessly translate the web app into any language of choice; a translation into Spanish is provided as an example.
The web app was developed by a team at the University of Oxford and The United Nations University - Maastricht Economic and Social Research Institute on Innovation and Technology. The lead developer is Edwin Lock. Kat Molinet developed the scheduling preferences for participants as well as variable testing budgets across the days of the week. This includes the implementation of the weekly allocation algorithm. Michelle Gonzalez Amador lead frontend development, built the`flask-babel' Spanish dictionary, coordinated deployment of the web app during the IPICYT trial, and contributed to bug fixes and testing. Simon Finster contributed with adjustments of the allocation algorithm, frontend work, bug fixes and testing.
We give brief instructions to set up a Python virtual environment and install the required dependencies. This allows you to run the web app locally on your computer. Minimal experience with Python and the terminal is recommended. Contact mail@edwinlock.com if you have any issues. If you wish to host this web app publicly, we have had good experiences with the hosting platform https://www.pythonanywhere.com.
These are brief instructions for macOS. They should also work for Linux systems.
- Install Python 3.8 or newer.
- Get the files from the GitHub server
$ git clone https://github.com/edwinlock/csef.git
-
Install MOSEK according to instructions here.
3.1 Please note that if you are working with MacOS with an M1 chip or above, you must download the BETA version (10.0), due to Darwin ARM incompatibility. You will also be required to quarantine the following file libtbb.12.dylib .For a discussion as to why, please follow this thread.
$ sudo xattr -d com.apple.quarantine /Users/YourUserName/Documents/yourPath/csef/venv/lib/python3.10/site-packages/mosek/libtbb.12.dylib
-
Go to the project directory and set up a virtual environment (venv)
$ cd csef
$ python -m venv venv
- Activate virtual environment
$ source venv/bin/activate
- Install the dependencies
$ pip install -r requirements.txt
- Compile the translations
$ pybabel compile -d webapp/translations
- Run the app locally
$ flask run