No description
Find a file
Mannu 314127effc [S1-T01 through T11] Solar, Wind, BESS generation simulation + CLI
- 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>
2026-05-07 10:04:21 +05:30
.github/workflows [S0-T11/T12/T13] GitHub Actions CI, pre-commit hooks, final README; mark Sprint 0 complete 2026-05-07 02:28:51 +05:30
packages [S1-T01 through T11] Solar, Wind, BESS generation simulation + CLI 2026-05-07 10:04:21 +05:30
sprints [S1-T01 through T11] Solar, Wind, BESS generation simulation + CLI 2026-05-07 10:04:21 +05:30
.gitignore [S0-T01] Initialize monorepo with packages/engine, packages/api, packages/web directories 2026-05-07 02:04:47 +05:30
.pre-commit-config.yaml [S0-T11/T12/T13] GitHub Actions CI, pre-commit hooks, final README; mark Sprint 0 complete 2026-05-07 02:28:51 +05:30
docker-compose.yml [S0-T04/T05/T10/T14] packages/web: Next.js, shadcn, TanStack Query, AG Grid; docker-compose; UI pages; openapi-typescript 2026-05-07 02:27:21 +05:30
Makefile [S0-T01] Initialize monorepo with packages/engine, packages/api, packages/web directories 2026-05-07 02:04:47 +05:30
PROJECT.md Project spec 2026-05-07 02:03:45 +05:30
RE_Financial_Modeling_Platform PRD.md Project spec 2026-05-07 02:03:45 +05:30
README.md [S0-T11/T12/T13] GitHub Actions CI, pre-commit hooks, final README; mark Sprint 0 complete 2026-05-07 02:28:51 +05:30

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.