Installation

Prerequisites

  • Python 3.9 or higher

  • Node.js 18 or higher (for frontend)

  • pip (Python package manager)

  • npm (Node package manager)

Backend Setup

  1. Clone the repository:

https://gitlab.developers.cam.ac.uk/phy/data-intensive-science-mphil/assessments/c1_coursework/oL306

git clone
  1. Navigate to the repository:

cd interpolator
  1. Create virtual environment:

python3 -m venv appenv
source appenv/bin/activate
  1. Install dependencies:

pip install -r requirements.txt
  1. Install the backend package in editable mode:

cd backend
pip install -e .
cd ..
  1. Verify:

python -c "import torch; print('OK')"

Frontend Setup

  1. Go to frontend directory:

cd frontend
  1. Install dependencies:

npm install

Running the Application

Local Deployment

  1. Using the launch script (recommended):

./scripts/launch.sh

This will start both the backend and frontend servers.

  1. Manual Deployment:

    Ensure you have completed the Backend Setup steps (including pip install -e .) before starting the servers.

    Start backend:

    cd backend
    uvicorn main:app --reload --host 0.0.0.0 --port 8000
    

Start frontend (in another terminal):

cd frontend
npm run dev

Access the application at http://localhost:3000

Running the Testing Suite

  1. Activate virtual environment:

source appenv/bin/activate
  1. Navigate to the backend directory:

cd backend

NOTE: Ensure you have installed the required dependencies in the steps above.

  1. Run the testing suite:

pytest tests/

Running the Benchmarking Script

  1. Activate virtual environment:

source appenv/bin/activate
  1. Navigate to the backend directory:

cd backend/experiments

NOTE: Ensure you have installed the required dependencies in the steps above.

  1. Run the benchmarking script:

python performance_benchmark.py

Build the Documentation

  1. Navigate to the root directory:

cd scripts
  1. Build the documentation:

./build_docs.sh
  1. The documentation will be built in the docs/_build/html/ directory.