Lab material for ING3513.
Before starting, ensure you have:
- A GitHub account
- Access to the
ing3513/course-materialsrepository
-
Install WSL (Windows Subsystem for Linux)
- Open PowerShell as Administrator
- Run:
wsl --install - Restart your computer when prompted
-
Install Visual Studio Code
- Download from https://code.visualstudio.com/
- Run the installer and follow the setup wizard
-
Install WSL Extension
- Download from https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl
- Or in VS Code: Go to Extensions (Ctrl+Shift+X), search for "WSL" and install the official Microsoft WSL extension
-
Connect to WSL
- Press F1 to open the Command Palette
- Type and select:
WSL: Connect to WSL - VS Code will reopen in your Linux home directory (~ or /home/)
-
Login with GitHub
- Open the Accounts menu in VS Code (bottom left corner)
- Select "Sign in with GitHub"
- Follow the authentication process
-
Clone Repository
- Open the Source Control view (Ctrl+Shift+G)
- Click "Clone Repository" or press F1 and type
Git: Clone - Enter the repository URL:
https://github.com/ing3513/course-materials.git - Select a folder location and open the cloned repository
-
Install Recommended Extensions
- When you open the repository, VS Code will prompt you to install recommended extensions
- Click "Install" to automatically install Python, Jupyter, and WSL extensions
- Alternatively, you can manually install them from the Extensions view (Ctrl+Shift+X)
-
Setup Python Environment
- Open a terminal in VS Code (Ctrl+`)
- Run the setup script:
./scripts/setupPythonEnvironment.sh - This will install uv, Python 3.13, and all project dependencies
- If this is your first run, restart your terminal or run:
source ~/.bashrc
-
Verify Installation
- Open
labs/lab00/lab00.ipynbin VS Code - Click "Select Kernel" in the top right corner of the notebook
- Choose "Python Environments..." and select the
ing3513environment - Run the verification cell (click the play button or press Shift+Enter)
- You should see pandas version information and a success message
- Open
Congratulations! You are now set up and ready to work with Jupyter notebooks in this course.
This course uses uv, a modern Python package and project manager. uv is significantly faster than pip and provides better dependency resolution.
- Automatic Python version management
- Fast dependency resolution and installation
- Reproducible environments via lockfiles
- All-in-one tool replacing pip, venv, and virtualenv
uv run <command>- Run a command in the project's virtual environmentuv add <package>- Add a new dependencyuv sync --locked- Sync dependencies from lockfile (use--lockedto ensure exact versions match)uv python install- Install Python versions
This project uses Ruff for code formatting and linting. Ruff is an extremely fast Python linter and formatter.
VS Code is configured to automatically format your code on save, both in Python files and Jupyter notebooks. This includes:
- Code formatting (consistent style)
- Import sorting
- Auto-fixing common issues
If you need to run formatting or linting manually:
uv run ruff format .- Format all Python filesuv run ruff check .- Check for linting issuesuv run ruff check --fix .- Auto-fix linting issues where possible
- Open the notebook in VS Code
- Click the
...(More Actions) button in the notebook toolbar - Select Export from the dropdown menu
- Choose HTML as the export format
- Select a location to save the file
You can also export notebooks programmatically using nbconvert:
# Export a single notebook to HTML
uv run jupyter nbconvert --to html path/to/notebook.ipynb
# Export to a specific output directory
uv run jupyter nbconvert --to html --output-dir=./output path/to/notebook.ipynbThe exported HTML file will be created in the same directory as the notebook (or the specified output directory).
Exporting directly to PDF from VS Code requires system-level installation of Pandoc and a LaTeX distribution. For most use cases, exporting to HTML and using your browser's "Print to PDF" is simpler and produces good results.