Skip to content

Commit c611bd4

Browse files
authored
doc: improve documentation quality (#14)
Try to improve the explanations and hopefully smooth out issues when using this repository with VSCode.
1 parent 3a5982a commit c611bd4

File tree

2 files changed

+70
-43
lines changed

2 files changed

+70
-43
lines changed

README.md

Lines changed: 57 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
This repository contains the source for code the Internet Quality Barometer (IQB)
44
library, and related applications and notebooks.
55

6-
IQB is an open-source project initiated by [Measurement Lab (M-Lab)](https://www.measurementlab.net/).
6+
## About IQB
7+
8+
IQB is an open-source project initiated by
9+
[Measurement Lab (M-Lab)](https://www.measurementlab.net/).
710

811
IQB is motivated by the need to redefine how we measure and understand Internet
912
performance to keep pace with evolving technological demands and user
@@ -44,10 +47,14 @@ See [prototype/README.md](prototype/README.md) for how to run it locally.
4447

4548
Jupyter notebooks for exploratory data analysis, experimentation, and research.
4649

50+
See [analysis/README.md](analysis/README.md) for more information.
51+
4752
### **`data/`**
4853

4954
Sample datasets used in the IQB app prototype and notebooks.
5055

56+
See [data/README.md](data/README.md) for details.
57+
5158
## Development Environment
5259

5360
We use [uv](https://astral.sh/uv) as a replacement for several Python repository
@@ -77,9 +84,6 @@ git clone git@github.com:m-lab/iqb.git
7784
cd iqb
7885

7986
# Sync all dependencies (creates .venv automatically)
80-
uv sync
81-
82-
# For development (includes test dependencies)
8387
uv sync --dev
8488

8589
# Run the Streamlit prototype
@@ -89,38 +93,66 @@ uv run streamlit run Home.py
8993

9094
### Using VSCode
9195

92-
This repository is configured for VSCode with Python development tools (Ruff, Pyright, pytest).
96+
This repository is configured for VSCode with selected Python
97+
development tools (Ruff, Pyright, pytest).
98+
99+
When you first open this repository with VSCode, it will prompt you
100+
to install the required extensions for Python development.
101+
102+
Make sure you also read the following section to avoid `uv`
103+
issues: there is no official `uv` extension for VSCode yet and
104+
it seems more prudent to avoid using unofficial ones.
105+
106+
#### First-time uv setup
107+
108+
Running `uv sync --dev` creates the required `.venv` directory
109+
that VSCode needs to find the proper python version and the proper
110+
development tools.
111+
112+
If you open the repository using VSCode *before* running
113+
`uv sync --dev`, you see the following error:
114+
115+
```
116+
Unexpected error while trying to find the Ruff binary
117+
```
118+
119+
To fix this, either run `uv sync --dev` from the command line or
120+
use VSCode directly to run `uv` and reload:
121+
122+
1. Run the setup task:
123+
124+
- Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS)
125+
126+
- Type "Tasks: Run Task"
127+
128+
- Select **"IQB: Setup Development Environment"**
93129

94-
**First-time setup:**
130+
- This runs `uv sync --dev` to install all development dependencies
95131

96-
1. Open this repository in VSCode
97-
2. You may see an error: **"Unexpected error while trying to find the Ruff binary"** - this is expected on first open
98-
3. Run the setup task:
99-
- Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS)
100-
- Type "Tasks: Run Task"
101-
- Select **"IQB: Setup Development Environment"**
102-
- This runs `uv sync --dev` to install all development dependencies
132+
2. After setup completes, reload VSCode:
103133

104-
4. After setup completes, reload VSCode:
105-
- Press `Ctrl+Shift+P` → "Developer: Reload Window"
106-
- The Ruff error should disappear
134+
- Press `Ctrl+Shift+P` → "Developer: Reload Window"
107135

108-
**Available tasks** (access via `Ctrl+Shift+P` → "Tasks: Run Task"):
136+
- The Ruff error should disappear
137+
138+
#### Available Tasks
139+
140+
Access them via `Ctrl+Shift+P` → "Tasks: Run Task":
109141

110142
- **IQB: Setup Development Environment** - Run `uv sync --dev` to install/update dependencies
143+
111144
- **IQB: Run Tests** - Run the pytest test suite
145+
112146
- **IQB: Run Ruff Check** - Check code style and quality
147+
113148
- **IQB: Run Pyright** - Run type checking
114149

115-
**Recommended extensions** (VSCode will prompt to install these):
116-
- Python (ms-python.python)
117-
- Pylance (ms-python.vscode-pylance)
118-
- Ruff (charliermarsh.ruff)
150+
#### Extensions
119151

120-
See component-specific READMEs for more details:
152+
VSCode will prompt to install these extensions:
121153

122-
- [analysis/README.md](analysis/README.md) - Working with Jupyter notebooks
154+
- Python (`ms-python.python`)
123155

124-
- [library/README.md](library/README.md) - Working with the IQB library
156+
- Pylance (`ms-python.vscode-pylance`)
125157

126-
- [prototype/README.md](prototype/README.md) - Running the Streamlit app
158+
- Ruff (`charliermarsh.ruff`)

prototype/README.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,26 @@ Streamlit-based dashboard for the Internet Quality Barometer (IQB) project.
55
## Prerequisites
66

77
- Python 3.13 (see `.python-version` at repo root)
8+
89
- [uv](https://astral.sh/uv) installed (see root README.md)
910

1011
## Running Locally
1112

12-
From the **repository root**:
13-
1413
```bash
14+
# Enter into the prototype directory if you're in the repository root
15+
cd prototype
16+
1517
# Sync dependencies (creates .venv if needed)
16-
uv sync
18+
uv sync --dev
1719

18-
# Run Streamlit app
19-
cd prototype
20+
# Run the Streamlit app
2021
uv run streamlit run Home.py
2122
```
2223

2324
The app will be available at: http://localhost:8501
2425

25-
## Development Workflow
26-
27-
```bash
28-
# Install/update dependencies after pulling changes
29-
uv sync
30-
31-
# Run the app
32-
cd prototype
33-
uv run streamlit run Home.py
34-
35-
# Make changes to Home.py - Streamlit auto-reloads on save
36-
```
26+
If you make changes to [Home.py](Home.py) or any other file in
27+
this directory, Streamlit will reload on save.
3728

3829
## Project Structure
3930

@@ -113,9 +104,13 @@ This IAM policy persists across deployments, so it's only needed once.
113104
## Dependencies
114105

115106
The prototype depends on:
107+
116108
- **streamlit** - Web framework
109+
117110
- **pandas** - Data manipulation
111+
118112
- **numpy** - Numerical operations
119-
- **mlab-iqb** - IQB library (from `../library`, managed via uv workspace)
113+
114+
- **mlab-iqb** - IQB library (from [../library](../library), managed via uv workspace)
120115

121116
Dependencies are locked in the workspace `uv.lock` at the repository root.

0 commit comments

Comments
 (0)