This document provides guidelines for AI agents working on this repository.
Instructions:
- Never use git commands, you must not commit code
pre-commit run --all-filesThe project documentation is built using Sphinx and hosted on ReadTheDocs.
To build the documentation locally:
cd docs && make clean && make htmlThe generated documentation will be available in the docs/_build/html directory.
When working on the code, please follow these documentation guidelines:
- Use docstrings for all public classes, methods, and functions
- Follow the NumPy docstring format
- Include type hints in function signatures
- Document parameters, return values, and raised exceptions
Run all tests using pytest.
To run tests with coverage: pytest --cov=pydrime --cov-report=term
This project uses ruff for linting and formatting, and prettier for other file
types. These are enforced by pre-commit hooks.
Run linting and formatting:
ruff check --fix --exit-non-zero-on-fix --config=.ruff.toml
Do not use python -m pydrime to run the cli but pydrime directly!
Do not use pip install but uv pip install! pydrime is installed with -e . .
The project is organized as follows:
pydrime/ # Main package
tests/ # Test directory
pyproject.toml # Project metadata and build configuration
README.md # Project README
pydrime/__init__.py: Package initialization and public API exportspydrime/cli.py: Command-line interface implementation
- Formatting: Adhere to the
ruffandprettierconfigurations. Maximum line length is 88 characters. - Imports: Follow the
isortconfiguration in.ruff.toml. Imports are grouped intofuture,standard-library,third-party,first-party, andlocal-folder. - Naming: Use
snake_casefor functions and variables, andPascalCasefor classes. - Types: Add type hints for all new functions and methods.
- Error Handling: Use standard
try...exceptblocks for error handling.
When working on the code, be aware of these common issues:
- Type hints: Ensure proper typing for all functions, especially for context dictionaries and layout configurations