/inm713-coursework

Primary LanguageJupyter NotebookMIT LicenseMIT

inm713-coursework

This repo is at https://github.com/feiphoon/inm713-coursework.

This is an individual submission of the INM713 coursework.

See my file tree documentation for a clear repo overview and for how the coursework submission has been laid out.

Relevant files are in the src/ folder here:

Each folder contains detailed README files for running instructions. Please install the included requirements.txt file to make sure everything runs correctly.

Setup

git clone this repo so you can run it locally.

This repo was written for Python 3.8.5. On Mac, please check your version:

python --version

Virtualenv

Having a virtual environment gives you a self-contained space to reproduce your project with the right versions of modules. venv is the simplest way toward this.

Create your new virtual environment

cd inm713-coursework # Be in your project folder
python3 -m venv venv # Where venv is the name of your new environment

Start and set up your new environment

source venv/bin/activate
pip install -r requirements.txt # Install the required packages in your new environment
pip list # Optional: check what was installed in `venv`

Exit your environment

deactivate

Contributing and development guidelines

Good repo hygiene tips

  • Don't push without a branch
  • Don't merge without a quick review from the other person
  • Write informative and succinct commit messages - so we can find stuff and follow logic!
  • Many small logical, passing/working commits are better than huge ones - use Github Desktop to stage individual lines
  • Use black and flake8 via inv lint to tidy up code - keep the reformatting commits separate from the actual code change ones :)

Code formatting

Just run this:

inv lint

The packages run by this are as follows (if you want to run them individually).

black

Aggressive PEP 8 code reformatter.

https://pypi.org/project/black/

black . # In the folder you're in, or a particular file you want to format

flake8

Reports PEP 8 violations.

https://pypi.org/project/flake8/

flake8 . # In the folder you're in, or a particular file you want to report on

Recommended VSCode settings

On your machine, create a .vscode folder in the root of this repo and create a settings.json inside it.

Save the following into it:

{
    "python.terminal.activateEnvironment": true,
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": false,
    "python.linting.flake8Enabled": true,
    "python.linting.flake8Args": [
        "--config",
        ".flake8"
    ],
    "python.formatting.provider": "black",
    "editor.formatOnSave": true,
    "python.pythonPath": "<path to your venv!>venv/bin/python3"
}