Setup¶
git clone https://github.com/QuantEcon/benchmark.translate-zh-cn.git
cd benchmark.translate-zh-cn
uv sync --extra devRunning Tests¶
uv run pytest tests/ -vAll tests should pass before submitting a PR.
Code Style¶
We use ruff for linting and formatting:
uv run ruff check src/ tests/
uv run ruff format src/ tests/Project Structure¶
src/qebench/— main package codetests/— pytest testsdata/— benchmark dataset (JSON files)results/— output data (translation attempts, XP, Elo)docs/— documentation
See Architecture for the full module map.
Adding a New Command¶
Create
src/qebench/commands/yourcommand.pywith a functionRegister it in
src/qebench/cli.pyviaapp.command()Add tests in
tests/test_yourcommand.pyDocument in
docs/user/cli-reference.md
Adding Data Entries¶
Use qebench add for interactive entry creation. For bulk imports, write a
script in scripts/ following the pattern in scripts/seed_from_glossary.py
or scripts/seed_from_lectures.py.
See Seeding from Lectures for a walkthrough of the lecture extraction pipeline.
Adding Prompt Templates¶
Create a .txt file in the prompts/ directory with {source_lang},
{target_lang}, {domain}, and {text} placeholders. Use {glossary}
for optional glossary injection. Use double braces {{...}} to escape
literal braces. See Glossary & Prompt Templates.
Branch Workflow¶
Work on a feature branch
Open a PR against
mainAll tests must pass
Get review from a team member