Thank you for your interest in contributing to astrowidget -- an interactive radio astronomy visualization widget for Jupyter, developed at the University of Washington's Scientific Software Engineering Center (SSEC).
This guide covers project-specific setup and workflows. For general SSEC contribution guidelines (including AI-usage policy), see the organization-level CONTRIBUTING.md.
- Read the README and architecture docs
- Check the issue tracker to see if someone is already working on your idea
- Comment on an issue before starting work, especially if you're a new contributor
- For a deeper dive into internals (traitlet bridge, ESM loading, uint8 pipeline, WebGL renderer), see the Development Guide
astrowidget uses pixi for reproducible environments.
git clone https://github.com/uw-ssec/astrowidget.git
cd astrowidget
pixi install
pixi run test # verify everything worksThis installs Python (>=3.11), Node.js (>=20), and all dependencies.
| Task | Description |
|---|---|
pixi run test |
Run all Python and JS tests |
pixi run test-py |
Run Python tests only |
pixi run test-js |
Run JS tests only |
pixi run lint |
Lint Python code with ruff |
pixi run build |
Build JS bundle with Vite |
pixi run dev |
Watch mode for JS development |
pixi run docs-serve |
Serve docs locally at localhost:8000 |
src/astrowidget/
widget.py # SkyWidget (anywidget class)
viewer.py # SkyViewer (Panel dashboard)
cube.py # PreloadedCube (LRU-cached slice loader)
io.py # open_dataset (zarr loader)
wcs.py # WCS extraction from zarr metadata
static/ # Compiled JS bundle (do not edit directly)
js/
inline_widget.js # WebGL2 renderer (source of truth for JS)
tests/
test_*.py # Python tests (pytest)
js/ # JS tests (vitest)
docs/ # MkDocs documentation
Note: The compiled bundle at
src/astrowidget/static/widget.jsis built fromjs/inline_widget.js. Edit the source file, then runpixi run buildto regenerate the bundle.
- Follow the existing code style (enforced by ruff)
- Add tests for new functionality in
tests/ - Run
pixi run lintbefore committing
- All renderer code lives in
js/inline_widget.js(raw WebGL2, no framework) - Projection math is validated against astropy-generated test vectors in
tests/fixtures/ - Run
pixi run test-jsto verify projection correctness - Run
pixi run buildafter changes to regenerate the static bundle
- Docs use MkDocs with the Material theme
- Source files are in
docs/ - Preview locally with
pixi run docs-serve
Your PR should:
- Reference the related issue (e.g., "Fixes #42")
- Include a clear description of what changed and why
- Contain focused commits (one logical change per PR)
- Include tests if adding or changing functionality
- Update documentation if behavior changes
- Pass CI checks (tests, linting, build)
- Tests pass (
pixi run test) - Linting passes (
pixi run lint) - JS bundle rebuilt if renderer changed (
pixi run build) - Documentation updated if applicable
Use the bug report template and include:
- Steps to reproduce
- Expected vs actual behavior
- Python version, browser, and Jupyter environment
- Sample data or minimal reproducer if possible
Use the feature request template. Describe the problem you're trying to solve, not just the solution you have in mind.
This project follows the Contributor Covenant Code of Conduct. Please read it before participating.
By contributing, you agree that your contributions will be licensed under the BSD 3-Clause License.