The British Physics Olympiad (BPhO) Computational Challenge is a competition designed to test students' problem-solving abilities using computational methods. This year's computational challenge consists of a series of 9 progressively difficult tasks focused on the dynamics of projectiles. The instructions and mathematical derivations provided by BPhO for each of the challenges can be found here.
Our submission is a website written completely using Streamlit, an open-source app framework which allows us to easily write interactive web apps quickly and easily using only Python. The embedded interactive charts are generated using Plotly, a powerful open-source data visualization library.
Make sure you have git installed on your machine. Then, clone this repo using the following command:
git clone https://github.com/lew1101/bpho-projectiles.git && cd bpho-projectilesThis repo relies on poetry for dependency management. Make sure it is installed on your machine, then run the following command to install dependencies:
poetry install # initialize virtual env (not necessary if using pip without venv)
source ./venv/bin/activate
# initiate server (another port could be used)
streamlit run app.py --server.port 8501First, clone the repo. Then, make sure you have the Docker client and daemon installed. Ensure the daemon is started, then build the image:
docker build --tag bp-image .To run a container, first set the PORT environment variable to the desired port for the server to listen to. The environment variable can also be passed using the --env (-e) flag, for example:
docker run --env PORT=8501 --publish 8501:8501 bp-image