python-conventions
Work on Python experiments in packages/python_viterbo. Use for layout conventions, stage entrypoints, lint/test commands, and asset/plot handling.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Python Conventions
Example: example-pipeline
Study src/viterbo/experiments/example_pipeline/ before creating experiments:
src/viterbo/experiments/example_pipeline/
├── SPEC.md # Research question, method, success criteria
├── stage_build.py # Stage 1: generate data
├── stage_analyze.py # Stage 2: compute results
└── stage_plot.py # Stage 3: create figures
config/example-pipeline/
└── default.json # Parameters for reproducible runs
data/example-pipeline/
├── synthetic_data.json
└── results.json
tests/test_example_pipeline.py
Run stages:
uv run python -m viterbo.experiments.example_pipeline.stage_build
uv run python -m viterbo.experiments.example_pipeline.stage_analyze
uv run python -m viterbo.experiments.example_pipeline.stage_plot
Directory Layout
All paths relative to packages/python_viterbo/:
| Artifact | Path |
|---|---|
| Experiment code | src/viterbo/experiments/<label>/ |
| Stage entrypoints | src/viterbo/experiments/<label>/stage_<name>.py |
| Spec | src/viterbo/experiments/<label>/SPEC.md |
| Configs | config/<label>/<variant>.json |
| Data artifacts | data/<label>/ |
| Tests | tests/test_<label>.py |
| Thesis assets | ../latex_viterbo/assets/<label>/ |
Commands
cd packages/python_viterbo
uv sync --extra dev # Install dependencies
uv run ruff format . # Format
uv run ruff check --fix . # Lint
uv run pyright # Type check
uv run pytest tests/ # Test
Code Style
- Docstrings: inputs, outputs, shapes/dtypes
- Pure functions preferred
- Comments explain WHY, not WHAT
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-01-26
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!