No description
- Pydantic schemas: SolarConfig, WindConfig, BessConfig, GenerationResult - Catalog: synthetic 8760h profiles for RJ/KA/GJ solar and wind; LRU-cached loader - generation/solar.py: 25yr hourly simulation (DC losses, inverter, clipping, soiling, degradation) - generation/wind.py: power-law shear, piecewise power curve, wake/electrical losses, degradation - generation/bess_state.py: SOH-based capacity degradation with augmentation schedule - CLI: remodel --input scenario.json --output gen.parquet (Typer upgraded to 0.25.1 for Click 8.3 compat) - 43 unit tests, 97.4% coverage; mypy strict + ruff clean - S1-T10 parity gate: placeholder fixture + skipped integration tests (awaiting Nagasamudra data) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .github/workflows | ||
| packages | ||
| sprints | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| docker-compose.yml | ||
| Makefile | ||
| PROJECT.md | ||
| RE_Financial_Modeling_Platform PRD.md | ||
| README.md | ||
REmodel
Python calculation engine + FastAPI backend + Next.js frontend for Indian renewable energy (Solar + Wind + BESS) project finance modeling.
Replaces an Excel-macro workflow for bid preparation at hybrid RTC RE projects. Computes optimal flat tariff and full 25-year project financials in <30 seconds per scenario.
Prerequisites
| Tool | Version | Install |
|---|---|---|
| Python | ≥ 3.12 | python.org |
| Poetry | ≥ 2.0 | curl -sSL https://install.python-poetry.org | python3 - |
| Node.js | ≥ 20 | nodejs.org |
| pnpm | ≥ 10 | npm install -g pnpm |
| Docker | any | docker.com |
Quick start
git clone <repo-url> remodel
cd remodel
# 1. Start Redis (required for API + worker)
docker compose up -d redis
# 2. Install all deps
make setup
# 3. Start all services
make dev
After make dev:
| Service | URL |
|---|---|
| Web UI | http://localhost:3000 |
| API | http://localhost:8000 |
| API docs | http://localhost:8000/docs |
| Redis | localhost:6379 |
Package layout
packages/
├── engine/ pip-installable Python calculation library (UI-agnostic)
├── api/ FastAPI + Arq async worker
└── web/ Next.js App Router frontend
Common commands
make setup # one-time: install all deps (Poetry + pnpm)
make dev # start Redis, API server, Arq worker, web dev server
make test # pytest (engine + api) + jest (web, if any)
make lint # ruff + mypy + tsc + eslint
make build # production build of web
make clean # remove build artefacts, __pycache__, .next, etc.
Individual package commands
# Engine
cd packages/engine && poetry run pytest
cd packages/engine && poetry run mypy src/
# API
cd packages/api && poetry run uvicorn remodel_api.main:app --reload --port 8000
cd packages/api && poetry run arq remodel_api.workers.main.WorkerSettings
cd packages/api && poetry run pytest
# Web
cd packages/web && pnpm dev
cd packages/web && pnpm type-check
cd packages/web && pnpm generate-types # needs API on :8000
Pre-commit hooks
pip install pre-commit
pre-commit install
Architecture overview
┌─────────────────────────────────────────────────────┐
│ packages/web (Next.js App Router + shadcn/ui) │
└────────────────────────┬────────────────────────────┘
│ REST + SSE
┌────────────────────────▼────────────────────────────┐
│ packages/api (FastAPI + Arq + SQLite) │
└────────────────────────┬────────────────────────────┘
│ Python import
┌────────────────────────▼────────────────────────────┐
│ packages/engine (Pydantic + NumPy + SciPy) │
└─────────────────────────────────────────────────────┘
See PROJECT.md for full domain context and architectural decisions.