# os-climate/sostrades-core architecture

> Architecture diagram of the GitHub repository os-climate/sostrades-core, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/os-climate/sostrades-core
- Repository: https://github.com/os-climate/sostrades-core

## Overview

##### Main Components Identification

- Execution Engine (Core)
- SOS Processes
- SOS Wrapping
- Study Manager
- Tests
- Tools

##### Connection and Data Flow

- Study Manager → SOS Processes (Process configuration)
- SOS Processes → Execution Engine (Process execution)
- Execution Engine ↔ SOS Wrapping (Discipline integration)
- Tools ↔ All Components (Utility services)
- GEMSEO ↔ Execution Engine (Optimization and calculation services)

##### External Dependencies

External interfaces:
- GEMSEO Integration
- Dataset Connectors (Arango, BigQuery, JSON)
- File System Interactions

##### Additional Details

Annotations for:
- Data flow directions
- Key interfaces between components
- Configuration points
- Extension points for custom implementations

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Main Components
    subgraph Core["Core Layer"]
        EE[Execution Engine]:::core
        GEMSEO[GEMSEO Integration]:::core
        DM[Discipline Management]:::core
        EC[Execution Control]:::core
        BT[Builder Tools]:::core
    end

    subgraph Service["Service Layer"]
        subgraph Wrapping["SOS Wrapping"]
            TD[Test Disciplines]:::wrapping
            AD[Analysis Disciplines]:::wrapping
            VBD[Value Block Disciplines]:::wrapping
        end

        subgraph Tools["Tools"]
            PP[Post Processing]:::tools
            BF[Base Functions]:::tools
            CT[Controllers]:::tools
            DT[Data Management]:::tools
        end
    end

    subgraph Process["Process Layer"]
        PF[Process Factory]:::process
        TP[Test Processes]:::process
        BPB[Base Process Builder]:::process
    end

    subgraph Management["Management Layer"]
        BSM[Base Study Manager]:::management
        SMI[Study Manager Implementation]:::management
        RU[Run Usecase]:::management
    end

    subgraph External["External Dependencies"]
        DC[Dataset Connectors]:::external
        FSO[File System Operations]:::external
    end

    %% Connections
    Management --> Process
    Process --> Core
    Core <--> Wrapping
    Tools <--> Core
    Tools <--> Process
    Tools <--> Management
    Core <--> External
    GEMSEO <--> EE

    %% Click Events
    click EE "https://github.com/os-climate/sostrades-core/blob/validation/sostrades_core/execution_engine/execution_engine.py"
    click GEMSEO "https://github.com/os-climate/sostrades-core/tree/validation/sostrades_core/execution_engine/gemseo_addon/"
    click DM "https://github.com/os-climate/sostrades-core/blob/validation/sostrades_core/execution_engine/sos_discipline.py"
    click BT "https://github.com/os-climate/sostrades-core/tree/validation/sostrades_core/execution_engine/builder_tools/"
    click PF "https://github.com/os-climate/sostrades-core/blob/validation/sostrades_core/sos_processes/processes_factory.py"
    click BPB "https://github.com/os-climate/sostrades-core/blob/validation/sostrades_core/sos_processes/base_process_builder.py"
    click TP "https://github.com/os-climate/sostrades-core/tree/validation/sostrades_core/sos_processes/test/"
    click TD "https://github.com/os-climate/sostrades-core/tree/validation/sostrades_core/sos_wrapping/test_discs/"
    click AD "https://github.com/os-climate/sostrades-core/tree/validation/sostrades_core/sos_wrapping/analysis_discs/"
    click VBD "https://github.com/os-climate/sostrades-core/blob/validation/sostrades_core/sos_wrapping/valueblock_discipline.py"
    click BSM "https://github.com/os-climate/sostrades-core/blob/validation/sostrades_core/study_manager/base_study_manager.py"
    click SMI "https://github.com/os-climate/sostrades-core/blob/validation/sostrades_core/study_manager/study_manager.py"
    click RU "https://github.com/os-climate/sostrades-core/blob/validation/sostrades_core/study_manager/run_usecase.py"
    click PP "https://github.com/os-climate/sostrades-core/tree/validation/sostrades_core/tools/post_processing/"
    click BF "https://github.com/os-climate/sostrades-core/tree/validation/sostrades_core/tools/base_functions/"
    click CT "https://github.com/os-climate/sostrades-core/tree/validation/sostrades_core/tools/controllers/"
    click DT "https://github.com/os-climate/sostrades-core/tree/validation/sostrades_core/tools/tree/"
    click DC "https://github.com/os-climate/sostrades-core/tree/validation/sostrades_core/datasets/datasets_connectors/"
    click FSO "https://github.com/os-climate/sostrades-core/blob/validation/sostrades_core/tools/folder_operations.py"

    %% Styles
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef process fill:#4CAF50,stroke:#388E3C,color:white
    classDef tools fill:#FFC107,stroke:#FFA000,color:black
    classDef wrapping fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef management fill:#FF5722,stroke:#E64A19,color:white
    classDef external fill:#9E9E9E,stroke:#616161,color:white

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Process Components]:::process
        L3[Tool Components]:::tools
        L4[Wrapping Components]:::wrapping
        L5[Management Components]:::management
        L6[External Dependencies]:::external
    end
```
