|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | +- `src/physics_plot/` holds the package. `utils.py` exposes `Handles`, while `pp_base.mplstyle` defines the default Matplotlib theme and `py.typed` marks the package as typed. |
| 5 | +- `examples/` contains runnable demos (`bode-plot.py`, `violin-plot.ipynb`) and reference images; use these to validate visual regressions before shipping changes. |
| 6 | +- `uv.lock` captures the resolved dependency graph. Regenerate it only when you update dependencies with `uv`. |
| 7 | + |
| 8 | +## Build, Test, and Development Commands |
| 9 | +- `uv sync --group dev` installs runtime and development dependencies. If `uv` is unavailable, fall back to `python -m pip install -e .` and install test/format tools manually. |
| 10 | +- `uv run python examples/bode-plot.py` executes the CLI example; use it to smoke-test style updates. |
| 11 | +- `uv run pytest` runs the test suite once it exists; pass `-k <pattern>` to focus. |
| 12 | +- `uv run ruff check src` and `uv run black --check src` guard linting/formatting. Run without `--check` to auto-fix. |
| 13 | + |
| 14 | +## Coding Style & Naming Conventions |
| 15 | +- Target Python 3.11+ and keep modules, functions, and files in `snake_case`; classes stay in `PascalCase`. |
| 16 | +- Follow Black's 88-character line length and space indentation. Prefer double quotes (enforced by Ruff) and keep imports sorted. |
| 17 | +- Annotate public APIs with type hints—the package ships `py.typed`, so downstream users rely on them. |
| 18 | +- Document public interfaces with NumPy-style docstrings so contributors can extend utilities without guessing parameter semantics. |
| 19 | + |
| 20 | +## Testing Guidelines |
| 21 | +- Use `pytest` for unit and functional tests. Mirror package paths under `tests/` (e.g., `tests/test_utils.py`). |
| 22 | +- Name tests `test_<behavior>` and parametrize when covering multiple inputs. |
| 23 | +- For plotting changes, save comparison images in `examples/` or a dedicated `tests/data/` fixture directory and document the workflow in the PR. |
| 24 | + |
| 25 | +## Commit & Pull Request Guidelines |
| 26 | +- Keep commit subjects short, present-tense, and imperative (e.g., `update violin-plot filename`). Group related edits together. |
| 27 | +- Reference issues or discussion threads in the PR description, summarize visual/test results, and attach before/after screenshots for plotting tweaks. |
| 28 | +- Request review once CI passes, and respond to feedback with follow-up commits rather than force-pushes when possible. |
0 commit comments