NumPy Nebula is a browser-based educational game for beginner data science learners. Players repair a damaged colony ship by writing real Python and NumPy in a guided console, then reading the results through a live array inspector and ship-map progression system.
- Real in-browser Python + NumPy execution through Pyodide
- Seven guided sectors covering the beginner NumPy core
- Mission validators that reward actual array operations instead of hand-entered outputs
- A live array inspector for
shape,dtype,ndim,size, and rendered values - Browser-testing hooks:
window.render_game_to_text()andwindow.advanceTime(ms) - GitHub Pages deployment workflow and regression CI workflow
Static app only:
python -m http.server 4173Then open http://127.0.0.1:4173.
Regression tests use Playwright:
npm install
npx playwright install chromiumnpm run test:regressionThis script starts a local static server, waits for Pyodide + NumPy, verifies the testing hooks, solves all seven sectors in-browser, checks progression, reset behavior, and inspector sync, and fails on console or page errors.
index.html: static shell and UI regionsstyles.css: layout, mission panels, onboarding, and visual stylingapp.js: UI state, Pyodide execution, progression, inspector rendering, and testing hooksmissions.js: sector content, validators, and expected NumPy conceptsscripts/regression-check.js: end-to-end browser regression coverage
- Keep the player writing real NumPy, not pseudo-commands or drag-and-drop blocks.
- Treat
window.render_game_to_text()andwindow.advanceTime(ms)as stable public test hooks. - When adding or editing missions, update the authored content and validator together.
- Prefer teaching-oriented feedback over terse error states.
- Re-run
npm run test:regressionafter any mission, execution, or UI state change.
The repo includes GitHub Actions workflows for:
- regression CI:
.github/workflows/regression.yml - GitHub Pages deployment:
.github/workflows/deploy-pages.yml
On pushes to main, the Pages workflow publishes the static app using index.html, app.js, missions.js, and styles.css.