Session 0: Automated One-Click Setup — Your Engineering Lab

Why This Matters

This setup refreshes your local dev environment with automation using Bash scripts. Since you're already onboarded with VS Code, Python, and WSL on Windows, we'll focus on quick steps to build a "lab" for aero simulations. By the end, you'll run a script that draws a force diagram—your first aero output!

We'll use VS Code's terminal. On Windows, remember to type wsl first to switch to Linux mode (where Bash works best). File paths in Bash use / (forward slashes), not \ (backslashes).


Step 1: Open VS Code and Your Project Folder

  1. Open VS Code.
  2. Click "File" > "Open Folder..." and choose/create a folder like ukubona-aero-lab.
  3. Open the terminal in VS Code (Ctrl+` or Terminal > New Terminal).
  4. If not already in WSL, type wsl and hit Enter to enter Linux mode.

Step 2: Create bootstrap.sh

In the terminal, type code bootstrap.sh and hit Enter. This opens a new file in VS Code.

Copy the code below, paste it into the editor, and save (Ctrl+S).

#!/usr/bin/env bash

set -e

echo "===================================="
echo "🚀 Bootstrapping Ukubona Aero Lab"
echo "===================================="

# Check for Python
if ! command -v python &> /dev/null && ! command -v python3 &> /dev/null; then
    echo "❌ Python not found. Install Python 3 from python.org."
    exit 1
fi

if command -v python3 &> /dev/null; then
    PYTHON=python3
else
    PYTHON=python
fi

echo "✅ Using: $PYTHON"

# Create venv if missing
if [ ! -d "venv" ]; then
    $PYTHON -m venv venv
fi

# Activate venv
if [[ "$OSTYPE" == "msys"* || "$OSTYPE" == "cygwin"* ]]; then
    source venv/Scripts/activate
else
    source venv/bin/activate
fi

# Create requirements.txt
cat < requirements.txt
numpy
matplotlib
EOF

# Install packages
pip install --upgrade pip
pip install -r requirements.txt

# Create run.sh
cat < run.sh
#!/usr/bin/env bash

set -e

if [[ "$OSTYPE" == "msys"* || "$OSTYPE" == "cygwin"* ]]; then
    source venv/Scripts/activate
else
    source venv/bin/activate
fi

python s1.py
EOF

# No chmod yet - we'll run with bash

# Create s1.py
cat < s1.py
import numpy as np
import matplotlib.pyplot as plt
import os

os.makedirs("plots", exist_ok=True)

thrust = np.array([100, 50])
gravity = np.array([0, -9.81])

fig, ax = plt.subplots()

ax.quiver(0, 0, thrust[0], thrust[1],
          angles="xy", scale_units="xy", scale=1,
          color="blue", label="Thrust")

ax.quiver(0, 0, gravity[0], gravity[1],
          angles="xy", scale_units="xy", scale=1,
          color="red", label="Gravity")

ax.set_xlim(-10, 110)
ax.set_ylim(-20, 60)

ax.set_xlabel("X Force")
ax.set_ylabel("Y Force")

ax.legend()
ax.set_title("Basic Aero Forces")
ax.grid(True)

plt.savefig("plots/session1_forces.png", dpi=200)
plt.close()

print("✅ Plot saved!")
EOF

echo "✅ Bootstrap complete! Your lab is ready."
echo
echo "Next: In terminal, type 'bash run.sh' to test."

Step 3: Run the Bootstrap Script

In the terminal (make sure you're in WSL—type wsl if needed), type:

bash bootstrap.sh

Watch it set up your venv, install tools, and create files.


Step 4: Test Your Setup

In the terminal, type:

bash run.sh

This runs the test and creates plots/session1_forces.png. Open it in VS Code (File > Open File... or right-click in Explorer pane) or your file explorer—it's your first aero diagram!

Reminder: Before sessions, type source venv/bin/activate (or venv\Scripts\activate if not in WSL) to activate your lab.


Your Project Folder Now

ukubona-aero-lab/
 ├── venv/              # Your Python setup
 ├── requirements.txt   # Tools list
 ├── run.sh             # Runner script
 ├── s1.py              # Test code
 ├── bootstrap.sh       # Setup script
 └── plots/             # Your output (session1_forces.png)

Why Automation Matters in Aeronautics

Scripts automate setup, saving time for design—like testing plane models fast.

Skill Why It Fits Aero
Bash ScriptsRun tests on many designs automatically.
VenvKeeps tools consistent, like a reliable toolkit.
NumPy/MatplotlibFor math and visuals of forces/flights.
ReproducibilityShare via GitHub without issues.

Ukubona Principle

You're building tools to explore flight—one simple step at a time!

Stuck? Note for Zoom. Head to Session 1!