# dc110123/pinn_repo architecture

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

- Interactive diagram: https://gitdiagram.com/dc110123/pinn_repo
- Repository: https://github.com/dc110123/pinn_repo

## Overview

This repository develops a universal physics-informed neural network for solar-panel I–V and maximum-power prediction. Its documented workflow builds a filtered panel dataset, generates synthetic curves, trains and tunes a PINN, then checks curve shape, population accuracy, and dynamic-weather behavior. The README describes the training-module separation, while the sampled `main.py` is only a greeting, so the documented training entry point is shown rather than an edge from `main.py`. Validation code references model/scaler files not present in the tree; those missing assets are not represented as repository nodes.

Main entry points: [`src/data_loader.py`](https://github.com/dc110123/pinn_repo/blob/main/src/data_loader.py) (Data preparation), [`simulation/Test_A/panel_shape_validation.py`](https://github.com/dc110123/pinn_repo/blob/main/simulation/Test_A/panel_shape_validation.py) (Curve shape checks), [`simulation/Test_B/panel_accuracy_validation.py`](https://github.com/dc110123/pinn_repo/blob/main/simulation/Test_B/panel_accuracy_validation.py) (Population accuracy), [`simulation/Test_C/panel_simulation.py`](https://github.com/dc110123/pinn_repo/blob/main/simulation/Test_C/panel_simulation.py) (Dynamic simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Panel data"]
  node_data_loader["Data preparation<br/>[data_loader.py]"]
  node_synthetic_data["Synthetic I–V data<br/>[data_loader.py]"]
end

subgraph group_training["PINN training"]
  node_training_orchestrator["Bayesian training"]
  node_optuna["Optuna search"]
  node_training_engine["PINN training engine"]
  node_pinn_model["PINN model"]
end

subgraph group_validation["Model validation"]
  node_weights["Trained weights"]
  node_shape_validation["Curve shape checks"]
  node_accuracy_validation["Population accuracy"]
  node_dynamic_validation["Dynamic simulation"]
end

subgraph group_analysis["Panel analysis"]
  node_cell_eda["Cell-count analysis<br/>[eda_cell_count.py]"]
  node_materials_eda["Materials analysis"]
end

node_user(("Engineer"))
node_cec["CEC database"]
node_main["CLI stub<br/>[main.py]"]

node_user -->|"starts documented search"| node_training_orchestrator
node_cec -->|"provides modules"| node_data_loader
node_data_loader -->|"generates curves"| node_synthetic_data
node_synthetic_data -->|"supplies training data"| node_training_orchestrator
node_training_orchestrator -->|"searches parameters"| node_optuna
node_training_orchestrator -->|"calls train_model"| node_training_engine
node_training_engine -->|"builds and trains"| node_pinn_model
node_user -->|"runs checks"| node_shape_validation
node_user -->|"runs benchmark"| node_accuracy_validation
node_user -->|"runs simulation"| node_dynamic_validation
node_shape_validation -->|"loads panel database"| node_data_loader
node_accuracy_validation -->|"loads panel database"| node_data_loader
node_dynamic_validation -->|"loads panel database"| node_data_loader
node_shape_validation -->|"loads weights"| node_weights
node_accuracy_validation -->|"loads weights"| node_weights
node_dynamic_validation -->|"loads weights"| node_weights
node_shape_validation -->|"predicts curves"| node_pinn_model
node_accuracy_validation -->|"predicts energy"| node_pinn_model
node_dynamic_validation -->|"predicts power"| node_pinn_model
node_user -->|"runs analysis"| node_cell_eda
node_user -->|"runs analysis"| node_materials_eda
node_cec -->|"provides modules"| node_cell_eda
node_cec -->|"provides modules"| node_materials_eda

click node_data_loader "https://github.com/dc110123/pinn_repo/blob/main/src/data_loader.py"
click node_synthetic_data "https://github.com/dc110123/pinn_repo/blob/main/src/data_loader.py"
click node_training_orchestrator "https://github.com/dc110123/pinn_repo/blob/main/src/bayesian_optimization_and_training.py"
click node_optuna "https://github.com/dc110123/pinn_repo/blob/main/src/bayesian_optimization_and_training.py"
click node_training_engine "https://github.com/dc110123/pinn_repo/blob/main/src/network_and_train_step.py"
click node_pinn_model "https://github.com/dc110123/pinn_repo/blob/main/src/network_and_train_step.py"
click node_weights "https://github.com/dc110123/pinn_repo/blob/main/model/universal_pinn_weights.weights.h5"
click node_shape_validation "https://github.com/dc110123/pinn_repo/blob/main/simulation/Test_A/panel_shape_validation.py"
click node_accuracy_validation "https://github.com/dc110123/pinn_repo/blob/main/simulation/Test_B/panel_accuracy_validation.py"
click node_dynamic_validation "https://github.com/dc110123/pinn_repo/blob/main/simulation/Test_C/panel_simulation.py"
click node_cell_eda "https://github.com/dc110123/pinn_repo/blob/main/src/eda_cell_count.py"
click node_materials_eda "https://github.com/dc110123/pinn_repo/blob/main/src/eda_panel_materials.py"
click node_main "https://github.com/dc110123/pinn_repo/blob/main/main.py"

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_data_loader,node_synthetic_data toneBlue
class node_training_orchestrator,node_optuna,node_training_engine,node_pinn_model,node_cec toneAmber
class node_weights,node_shape_validation,node_accuracy_validation,node_dynamic_validation toneMint
class node_cell_eda,node_materials_eda toneRose
class node_user toneIndigo
class node_main toneTeal
```

## Components

### Panel data

- [Data preparation](https://github.com/dc110123/pinn_repo/blob/main/src/data_loader.py): `src/data_loader.py`
- [Synthetic I–V data](https://github.com/dc110123/pinn_repo/blob/main/src/data_loader.py): `src/data_loader.py`

### PINN training

- [Bayesian training](https://github.com/dc110123/pinn_repo/blob/main/src/bayesian_optimization_and_training.py): `src/bayesian_optimization_and_training.py`
- [Optuna search](https://github.com/dc110123/pinn_repo/blob/main/src/bayesian_optimization_and_training.py): `src/bayesian_optimization_and_training.py`
- [PINN training engine](https://github.com/dc110123/pinn_repo/blob/main/src/network_and_train_step.py): `src/network_and_train_step.py`
- [PINN model](https://github.com/dc110123/pinn_repo/blob/main/src/network_and_train_step.py): `src/network_and_train_step.py`

### Model validation

- [Trained weights](https://github.com/dc110123/pinn_repo/blob/main/model/universal_pinn_weights.weights.h5): `model/universal_pinn_weights.weights.h5`
- [Curve shape checks](https://github.com/dc110123/pinn_repo/blob/main/simulation/Test_A/panel_shape_validation.py): `simulation/Test_A/panel_shape_validation.py`
- [Population accuracy](https://github.com/dc110123/pinn_repo/blob/main/simulation/Test_B/panel_accuracy_validation.py): `simulation/Test_B/panel_accuracy_validation.py`
- [Dynamic simulation](https://github.com/dc110123/pinn_repo/blob/main/simulation/Test_C/panel_simulation.py): `simulation/Test_C/panel_simulation.py`

### Panel analysis

- [Cell-count analysis](https://github.com/dc110123/pinn_repo/blob/main/src/eda_cell_count.py): `src/eda_cell_count.py`
- [Materials analysis](https://github.com/dc110123/pinn_repo/blob/main/src/eda_panel_materials.py): `src/eda_panel_materials.py`

### Other components

- **Engineer**
- **CEC database**
- [CLI stub](https://github.com/dc110123/pinn_repo/blob/main/main.py): `main.py`

## Connections

- Engineer → Bayesian training: starts documented search (evidence: `README.md`)
- CEC database → Data preparation: provides modules (evidence: `README.md`)
- Data preparation → Synthetic I–V data: generates curves (evidence: `src/data_loader.py`)
- Synthetic I–V data → Bayesian training: supplies training data (evidence: `README.md`)
- Bayesian training → Optuna search: searches parameters (evidence: `src/bayesian_optimization_and_training.py`)
- Bayesian training → PINN training engine: calls train_model (evidence: `README.md`)
- PINN training engine → PINN model: builds and trains (evidence: `src/network_and_train_step.py`)
- Engineer → Curve shape checks: runs checks (evidence: `README.md`)
- Engineer → Population accuracy: runs benchmark (evidence: `README.md`)
- Engineer → Dynamic simulation: runs simulation (evidence: `README.md`)
- Curve shape checks → Data preparation: loads panel database (evidence: `simulation/Test_A/panel_shape_validation.py`)
- Population accuracy → Data preparation: loads panel database (evidence: `simulation/Test_B/panel_accuracy_validation.py`)
- Dynamic simulation → Data preparation: loads panel database (evidence: `simulation/Test_C/panel_simulation.py`)
- Curve shape checks → Trained weights: loads weights (evidence: `simulation/Test_A/panel_shape_validation.py`)
- Population accuracy → Trained weights: loads weights (evidence: `simulation/Test_B/panel_accuracy_validation.py`)
- Dynamic simulation → Trained weights: loads weights (evidence: `simulation/Test_C/panel_simulation.py`)
- Curve shape checks → PINN model: predicts curves (evidence: `simulation/Test_A/panel_shape_validation.py`)
- Population accuracy → PINN model: predicts energy (evidence: `simulation/Test_B/panel_accuracy_validation.py`)
- Dynamic simulation → PINN model: predicts power (evidence: `simulation/Test_C/panel_simulation.py`)
- Engineer → Cell-count analysis: runs analysis (evidence: `src/eda_cell_count.py`)
- Engineer → Materials analysis: runs analysis (evidence: `src/eda_panel_materials.py`)
- CEC database → Cell-count analysis: provides modules (evidence: `src/eda_cell_count.py`)
- CEC database → Materials analysis: provides modules (evidence: `src/eda_panel_materials.py`)
