Level 6 / Project 13 - Batch Window Controller¶
Home: README
Learn Your Way¶
| Read | Build | Watch | Test | Review | Visualize | Try |
|---|---|---|---|---|---|---|
| — | This project | — | — | Flashcards | — | — |
Focus¶
- load window scheduling controls
Why this project exists¶
This project gives you level-appropriate practice in a realistic operations context. Goal: run the baseline, alter behavior, break one assumption, recover safely, and explain the fix.
Run (copy/paste)¶
Use <repo-root> as the folder containing this repository's README.md.
cd <repo-root>/projects/level-6/13-batch-window-controller
python project.py --input data/sample_input.txt --output data/output_summary.json
pytest -q
Expected terminal output¶
{
"windows_created": 4,
"overlaps_found": 1,
"gaps": [{"start": "...", "end": "..."}, ...],
"windows": [...]
}
Expected artifacts¶
data/output_summary.json— window analysis with overlaps and gaps- Passing tests (
pytest -q→ 6+ passed) - Updated
notes.md
Alter it (required)¶
- Add a
merge_overlapsfunction that combines overlapping windows into a single window. - Add a
--auto-fill-gapsflag that creates new pending windows for any detected gaps. - Add a duration column showing each window's length in hours.
- Re-run script and tests after each change.
Break it (required)¶
- Create a window where
end < startand observe the validation error. - Create three windows that all overlap each other and check all pairs are detected.
- Try to transition a window to an invalid status (e.g. "cancelled").
Fix it (required)¶
- Add validation rejecting
end <= startwindows. - Ensure overlap detection handles more than 2 windows overlapping.
- Add status validation with a clear error message.
Explain it (teach-back)¶
- Why are overlapping processing windows dangerous in data pipelines?
- What is a "gap" in batch processing, and what data does it leave unprocessed?
- How do real ETL systems prevent double-processing?
- What is the interval scheduling problem and how does it relate to this project?
Mastery check¶
You can move on when you can: - run baseline without docs, - explain one core function line-by-line, - break and recover in one session, - keep tests passing after your change.
Related Concepts¶
| ← Prev | Home | Next → |
|---|---|---|