refactor: delete stale files and consolidate .mindmodel structure
Deleted stale root-level Python files: - main.py (unused 'Hello world' script) - verify.py (unused table info script) - scraper.py (unused MotionScraper class) - scheduler.py (unused DataUpdateScheduler class) Deleted duplicate .mindmodel root YAML files (subdirectory versions are more comprehensive): - anti-patterns.yaml, architecture.yaml, conventions.yaml - dependencies.yaml, domain.yaml, domain-glossary.yaml - stack.yaml, tech-stack.yaml, workflows.yaml Added comprehensive .mindmodel subdirectories: - constraints/ (naming, db-schema, error-handling, types, etc.) - patterns/ (api, architecture, database, python, streamlit, etc.) - examples/ (code examples for each pattern) - anti-patterns/, architecture/, conventions/, dependencies/, domain/, stack/ Updated ARCHITECTURE.md to reflect current codebase: - Removed references to non-existent files - Added missing files (explorer.py, explorer_helpers.py, pipeline/) - Added directory structure documentation - Updated tech stack to include scipy, sklearn, umap Updated .gitignore: - Added patterns for generated analysis files - Added .worktrees/ pattern (was already in gitignore but dir was deleted) Removed empty .worktrees/ directory
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
# Dependencies
|
||||
|
||||
## Core Library Wiring
|
||||
|
||||
### Database Layer
|
||||
```
|
||||
ibis → DuckDB → MotionDatabase singleton (database.py)
|
||||
↑
|
||||
sqlglot (ibis dependency)
|
||||
```
|
||||
|
||||
### Data Processing
|
||||
```
|
||||
pandas → (used throughout for DataFrame operations)
|
||||
numpy → (used by sklearn, scipy, umap)
|
||||
scipy → spatial.procrustes for window alignment
|
||||
```
|
||||
|
||||
### ML Pipeline
|
||||
```
|
||||
sklearn.cluster → KMeans, Procrustes
|
||||
sklearn.preprocessing → StandardScaler
|
||||
umap → UMAP (optional, graceful fallback)
|
||||
```
|
||||
|
||||
### Visualization
|
||||
```
|
||||
plotly → explorer_helpers.py chart builders
|
||||
st.plotly_chart → explorer.py rendering
|
||||
```
|
||||
|
||||
### Streamlit
|
||||
```
|
||||
streamlit → all pages, @st.cache_data decorators
|
||||
```
|
||||
|
||||
## Optional Dependencies
|
||||
| Package | Required | Fallback |
|
||||
|---------|----------|----------|
|
||||
| `umap` | No | Use raw SVD vectors (first 2 dims) |
|
||||
| `plotly` | Yes | Raises ImportError |
|
||||
| `duckdb` | Yes | — |
|
||||
| `ibis` | Yes | — |
|
||||
| `sklearn` | Yes | — |
|
||||
|
||||
## Singleton Instances
|
||||
| Module | Instance | Type |
|
||||
|--------|----------|------|
|
||||
| `database.py` | `db` | `MotionDatabase` |
|
||||
| `config.py` | `config` | `Config` (dataclass) |
|
||||
| `config.py` | `PARTY_COLOURS` | `dict[str, str]` |
|
||||
|
||||
## Key Imports by File
|
||||
```
|
||||
explorer.py:
|
||||
- import streamlit as st
|
||||
- from database import db
|
||||
- from explorer_helpers import *
|
||||
|
||||
explorer_helpers.py:
|
||||
- import pandas as pd
|
||||
- import plotly.graph_objects as go
|
||||
- from database import db (optional, for type hints)
|
||||
|
||||
database.py:
|
||||
- import ibis
|
||||
- import duckdb
|
||||
- from config import config, PARTY_COLOURS
|
||||
|
||||
config.py:
|
||||
- from dataclasses import dataclass, field
|
||||
- import streamlit as st (optional, for warnings)
|
||||
```
|
||||
|
||||
## Environment
|
||||
- Python ≥3.13
|
||||
- Environment variables via `.env` (DB path, API keys)
|
||||
- No `.env` values in constraint files (security)
|
||||
Reference in New Issue
Block a user