This repository includes the following main files/folders:
requirements.txt and pyproject.toml outlines dependencies of coursework codes and repository info
question_a2.ipynb contains workings for question A2
question_b1.ipynb contains workings for question B1
question_c1.ipynb contains workings for question C1
report/ contains the report a3_coursework_report.pdf
data/ contains saved data from notebooks that can be loaded to avoid having to run certain lengthy processes repeatedly
src/a3_package contains python codes used in the coursework. In particular:
src/a3_package/a2.py contains codes used for question A2, and
src/a3_package/c1.py contains codes used for question C1
Create and activate venv for the repository
# make sure your current directory is the coursework repository
mkdir .env
cd .env
python -m venv a3_cw
source a3_cw/bin/activateGo back to the root of the repository and install required packages
cd ..
pip install -r requirements.txtWhile in the root directory, install the coursework package
pip install -e .The package can be imported using
import a3_packageOtherwise, use relative imports in the notebooks
from src.a3_package import *Create jupyter kernel for running the notebooks
python -m ipykernel install --user --name a3_cw --display-name "a3_cw"or
ipython kernel install --user --name=a3_cwIn the notebooks, select a3_cw as your jupyter kernel
As stated in the report, ChatGPT/GitHub Copilot has been used for the following purposes only:
(1) Auto-completion of lines of code based on repetition; and
(2) Docstring suggestions which are then revised.