You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.4 KiB
34 lines
1.4 KiB
# Naming & Style Conventions
|
|
|
|
## Rules
|
|
- Modules and files: snake_case.py. Evidence: pipeline/run_pipeline.py, database.py, ai_provider.py
|
|
- Functions and methods: snake_case. Evidence: compute_svd_for_window (pipeline), _generate_windows (pipeline/run_pipeline.py)
|
|
- Classes: PascalCase. Evidence: MotionDatabase (database.py)
|
|
- Constants: UPPER_SNAKE_CASE. Evidence: VOTE_MAP, DATABASE_PATH (config inferred)
|
|
- Imports order: stdlib, third-party, local; prefer absolute imports and grouped.
|
|
- Use black, ruff, isort, mypy as the recommended toolchain; repository lacks config files (black, ruff, pyproject sections).
|
|
|
|
## Examples
|
|
|
|
### Function example (from pipeline/run_pipeline.py)
|
|
```python
|
|
def _generate_windows(start: date, end: date, granularity: str) -> List[Tuple[str, str, str]]:
|
|
"""Return list of (window_id, start_str, end_str) tuples."""
|
|
```
|
|
|
|
### Class example (from database.py)
|
|
```python
|
|
class MotionDatabase:
|
|
def __init__(self, db_path: str = config.DATABASE_PATH):
|
|
...
|
|
```
|
|
|
|
## Anti-patterns
|
|
- Missing formatting configs (black, ruff, isort). Add pyproject.toml sections or dedicated config files.
|
|
|
|
## Remediations
|
|
- Add pyproject.toml tool sections for black/ruff/isort and a pre-commit config. Run ruff/black CI lint step.
|
|
|
|
## Evidence pointers
|
|
- pipeline/run_pipeline.py: function _generate_windows (lines ~1-120)
|
|
- database.py: MotionDatabase class and methods (file database.py lines 1-400+)
|
|
|