# saicharan67778/energyflex architecture

> Architecture diagram of the GitHub repository saicharan67778/energyflex, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saicharan67778/energyflex
- Repository: https://github.com/saicharan67778/energyflex

## Overview

EnergyFlex generates reproducible synthetic industrial energy datasets, validates their labelled quality issues, analyzes energy waste and demand, and presents results in a static role-based dashboard. The main workflow is CLI generation → validation/analysis → exported datasets and metrics → dashboard. README documents the generation stages and dashboard capabilities; sampled pipeline code confirms analytics dispatch, while several generator and analytics implementations were not sampled, so their internal links are limited to documented or indexed references.

Main entry points: [`energyflex/analytics/pipeline.py`](https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/pipeline.py) (Analysis coordinator), [`energyflex/generate/__init__.py`](https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/__init__.py) (Generation coordinator), [`cli.py`](https://github.com/saicharan67778/energyflex/blob/main/cli.py) (Command interface), [`energyflex/schema.py`](https://github.com/saicharan67778/energyflex/blob/main/energyflex/schema.py) (Dataset schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Synthetic generation"]
  node_config["Scenario config<br/>[config.py]"]
  node_master["Site masters<br/>[master.py]"]
  node_weather["Weather series<br/>[weather.py]"]
  node_maintenance["Maintenance plan<br/>[maintenance.py]"]
  node_production["Production batches<br/>[production.py]"]
  node_telemetry["Machine telemetry<br/>[telemetry.py]"]
  node_anomalies["Labelled anomalies<br/>[anomalies.py]"]
  node_generator["Generation coordinator<br/>[__init__.py]"]
end

subgraph group_quality["Data quality"]
  node_validate["Dataset validation<br/>[validate.py]"]
  node_io["Dataset loading<br/>[io.py]"]
end

subgraph group_analysis["Energy analytics"]
  node_analytics_pipeline["Analysis coordinator<br/>[pipeline.py]"]
  node_quality_gate["Quality and findings<br/>[quality.py]"]
  node_reconcile["Energy reconciliation<br/>[reconcile.py]"]
  node_cost["Tariff costing<br/>[cost.py]"]
  node_intensity["Batch intensity<br/>[intensity.py]"]
  node_waste["Waste analysis<br/>[waste.py]"]
  node_recommend["Recommendations<br/>[recommend.py]"]
  node_evaluation["Detection evaluation<br/>[evaluate.py]"]
  node_tariffs["Tariff lookup<br/>[tariffs.py]"]
end

subgraph group_delivery["Data and dashboard"]
  node_cli["Command interface<br/>[cli.py]"]
  node_schema["Dataset schema<br/>[schema.py]"]
  node_export["Dataset exporter<br/>[export.py]"]
  node_site_builder["Dashboard data builder<br/>[site.py]"]
  node_dashboard["Role-based dashboard<br/>[app.js]"]
  node_dashboard_data["Dashboard data<br/>[dashboard.json]"]
end

node_operator(("CLI user"))
node_dashboard_user(("Dashboard user"))

node_operator -->|"runs commands"| node_cli
node_cli -->|"generates data"| node_generator
node_cli -->|"validates data"| node_validate
node_cli -->|"runs analysis"| node_analytics_pipeline
node_cli -->|"builds dashboard data"| node_site_builder
node_generator -->|"builds masters"| node_master
node_generator -->|"builds weather"| node_weather
node_generator -->|"plans maintenance"| node_maintenance
node_generator -->|"builds batches"| node_production
node_generator -->|"builds telemetry"| node_telemetry
node_generator -->|"injects anomalies"| node_anomalies
node_generator -->|"uses settings"| node_config
node_cli -->|"loads datasets"| node_io
node_io -->|"uses definitions"| node_schema
node_validate -->|"checks tables"| node_schema
node_analytics_pipeline -->|"curates and detects"| node_quality_gate
node_analytics_pipeline -->|"reconciles energy"| node_reconcile
node_analytics_pipeline -->|"prices readings"| node_cost
node_analytics_pipeline -->|"calculates intensity"| node_intensity
node_analytics_pipeline -->|"finds waste"| node_waste
node_analytics_pipeline -->|"builds actions"| node_recommend
node_analytics_pipeline -->|"scores detection"| node_evaluation
node_cost -->|"looks up rates"| node_tariffs
node_recommend -->|"uses occupancy"| node_reconcile
node_analytics_pipeline -->|"formats outputs"| node_export
node_export -->|"formats tables"| node_schema
node_dashboard_user -->|"views insights"| node_dashboard
node_dashboard -->|"renders data"| node_dashboard_data

click node_cli "https://github.com/saicharan67778/energyflex/blob/main/cli.py"
click node_config "https://github.com/saicharan67778/energyflex/blob/main/energyflex/config.py"
click node_master "https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/master.py"
click node_weather "https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/weather.py"
click node_maintenance "https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/maintenance.py"
click node_production "https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/production.py"
click node_telemetry "https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/telemetry.py"
click node_anomalies "https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/anomalies.py"
click node_generator "https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/__init__.py"
click node_validate "https://github.com/saicharan67778/energyflex/blob/main/energyflex/validate.py"
click node_io "https://github.com/saicharan67778/energyflex/blob/main/energyflex/io.py"
click node_analytics_pipeline "https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/pipeline.py"
click node_quality_gate "https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/quality.py"
click node_reconcile "https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/reconcile.py"
click node_cost "https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/cost.py"
click node_intensity "https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/intensity.py"
click node_waste "https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/waste.py"
click node_recommend "https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/recommend.py"
click node_evaluation "https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/evaluate.py"
click node_tariffs "https://github.com/saicharan67778/energyflex/blob/main/energyflex/tariffs.py"
click node_schema "https://github.com/saicharan67778/energyflex/blob/main/energyflex/schema.py"
click node_export "https://github.com/saicharan67778/energyflex/blob/main/energyflex/export.py"
click node_site_builder "https://github.com/saicharan67778/energyflex/blob/main/energyflex/site.py"
click node_dashboard "https://github.com/saicharan67778/energyflex/blob/main/site/app.js"
click node_dashboard_data "https://github.com/saicharan67778/energyflex/blob/main/site/data/dashboard.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_config,node_master,node_weather,node_maintenance,node_production,node_telemetry,node_anomalies,node_generator,node_operator,node_dashboard_user toneBlue
class node_validate,node_io toneAmber
class node_analytics_pipeline,node_quality_gate,node_reconcile,node_cost,node_intensity,node_waste,node_recommend,node_evaluation,node_tariffs toneMint
class node_cli,node_schema,node_export,node_site_builder,node_dashboard,node_dashboard_data toneRose
```

## Components

### Synthetic generation

- [Scenario config](https://github.com/saicharan67778/energyflex/blob/main/energyflex/config.py): `energyflex/config.py`
- [Site masters](https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/master.py): `energyflex/generate/master.py`
- [Weather series](https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/weather.py): `energyflex/generate/weather.py`
- [Maintenance plan](https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/maintenance.py): `energyflex/generate/maintenance.py`
- [Production batches](https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/production.py): `energyflex/generate/production.py`
- [Machine telemetry](https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/telemetry.py): `energyflex/generate/telemetry.py`
- [Labelled anomalies](https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/anomalies.py): `energyflex/generate/anomalies.py`
- [Generation coordinator](https://github.com/saicharan67778/energyflex/blob/main/energyflex/generate/__init__.py): `energyflex/generate/__init__.py`

### Data quality

- [Dataset validation](https://github.com/saicharan67778/energyflex/blob/main/energyflex/validate.py): `energyflex/validate.py`
- [Dataset loading](https://github.com/saicharan67778/energyflex/blob/main/energyflex/io.py): `energyflex/io.py`

### Energy analytics

- [Analysis coordinator](https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/pipeline.py): `energyflex/analytics/pipeline.py`
- [Quality and findings](https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/quality.py): `energyflex/analytics/quality.py`
- [Energy reconciliation](https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/reconcile.py): `energyflex/analytics/reconcile.py`
- [Tariff costing](https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/cost.py): `energyflex/analytics/cost.py`
- [Batch intensity](https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/intensity.py): `energyflex/analytics/intensity.py`
- [Waste analysis](https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/waste.py): `energyflex/analytics/waste.py`
- [Recommendations](https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/recommend.py): `energyflex/analytics/recommend.py`
- [Detection evaluation](https://github.com/saicharan67778/energyflex/blob/main/energyflex/analytics/evaluate.py): `energyflex/analytics/evaluate.py`
- [Tariff lookup](https://github.com/saicharan67778/energyflex/blob/main/energyflex/tariffs.py): `energyflex/tariffs.py`

### Data and dashboard

- [Command interface](https://github.com/saicharan67778/energyflex/blob/main/cli.py): `cli.py`
- [Dataset schema](https://github.com/saicharan67778/energyflex/blob/main/energyflex/schema.py): `energyflex/schema.py`
- [Dataset exporter](https://github.com/saicharan67778/energyflex/blob/main/energyflex/export.py): `energyflex/export.py`
- [Dashboard data builder](https://github.com/saicharan67778/energyflex/blob/main/energyflex/site.py): `energyflex/site.py`
- [Role-based dashboard](https://github.com/saicharan67778/energyflex/blob/main/site/app.js): `site/app.js`
- [Dashboard data](https://github.com/saicharan67778/energyflex/blob/main/site/data/dashboard.json): `site/data/dashboard.json`

### Other components

- **CLI user**
- **Dashboard user**

## Connections

- CLI user → Command interface: runs commands (evidence: `README.md`)
- Command interface → Generation coordinator: generates data (evidence: `cli.py`)
- Command interface → Dataset validation: validates data (evidence: `cli.py`)
- Command interface → Analysis coordinator: runs analysis (evidence: `cli.py`)
- Command interface → Dashboard data builder: builds dashboard data (evidence: `README.md`)
- Generation coordinator → Site masters: builds masters (evidence: `energyflex/generate/__init__.py`)
- Generation coordinator → Weather series: builds weather (evidence: `energyflex/generate/__init__.py`)
- Generation coordinator → Maintenance plan: plans maintenance (evidence: `energyflex/generate/__init__.py`)
- Generation coordinator → Production batches: builds batches (evidence: `energyflex/generate/__init__.py`)
- Generation coordinator → Machine telemetry: builds telemetry (evidence: `energyflex/generate/__init__.py`)
- Generation coordinator → Labelled anomalies: injects anomalies (evidence: `energyflex/generate/__init__.py`)
- Generation coordinator → Scenario config: uses settings (evidence: `energyflex/generate/__init__.py`)
- Command interface → Dataset loading: loads datasets (evidence: `cli.py`)
- Dataset loading → Dataset schema: uses definitions (evidence: `energyflex/io.py`)
- Dataset validation → Dataset schema: checks tables (evidence: `energyflex/validate.py`)
- Analysis coordinator → Quality and findings: curates and detects (evidence: `energyflex/analytics/pipeline.py`)
- Analysis coordinator → Energy reconciliation: reconciles energy (evidence: `energyflex/analytics/pipeline.py`)
- Analysis coordinator → Tariff costing: prices readings (evidence: `energyflex/analytics/pipeline.py`)
- Analysis coordinator → Batch intensity: calculates intensity (evidence: `energyflex/analytics/pipeline.py`)
- Analysis coordinator → Waste analysis: finds waste (evidence: `energyflex/analytics/pipeline.py`)
- Analysis coordinator → Recommendations: builds actions (evidence: `energyflex/analytics/pipeline.py`)
- Analysis coordinator → Detection evaluation: scores detection (evidence: `energyflex/analytics/pipeline.py`)
- Tariff costing → Tariff lookup: looks up rates (evidence: `energyflex/analytics/cost.py`)
- Recommendations → Energy reconciliation: uses occupancy (evidence: `energyflex/analytics/recommend.py`)
- Analysis coordinator → Dataset exporter: formats outputs (evidence: `energyflex/analytics/pipeline.py`)
- Dataset exporter → Dataset schema: formats tables (evidence: `energyflex/export.py`)
- Dashboard user → Role-based dashboard: views insights (evidence: `README.md`)
- Role-based dashboard → Dashboard data: renders data (evidence: `README.md`)
