# dtuwindenergy/pywake architecture

> Architecture diagram of the GitHub repository dtuwindenergy/pywake, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dtuwindenergy/pywake
- Repository: https://github.com/dtuwindenergy/pywake

## Overview

##### Project type and purpose
- This repository is merely a mirror of PyWake, an open-source Python library for wind-farm wake modeling and analysis. It is not a full-stack application but a scientific computing toolkit. The mirror itself contains only a README and is deprecated—reference the upstream project at https://gitlab.windenergy.dtu.dk/TOPFARM/PyWake for the complete codebase.

##### (minimal) file structure
- pywake/ (core modules: flow models, farm definitions, wake combination methods)
- examples/ (scripts demonstrating usage)
- tests/ (unit and integration tests)
- docs/ (documentation sources)
- setup.py or pyproject.toml (build and packaging)

##### README for additional insights
- The README points to a GitLab URL and does not contain architectural details. Refer to the real README and documentation in the upstream repo to identify major components, third-party dependencies (e.g., NumPy, SciPy), and extension points (custom flow models, post-processing hooks).

##### Detailed but not over-engineered
- How data (wind farm inputs) flows through the modeling engine to produce outputs (power curves, layouts).
- Extension points where new models or analysis routines can be registered.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Layer
    subgraph "User Interface Layer"
        UI["Examples (scripts & notebooks)"]:::ui
    end

    %% Core Library Modules
    subgraph "Core Library (pywake)"
        FM["FlowModel Module"]:::core
        WC["WakeCombination Module"]:::core
        FD["FarmDefinition Module"]:::core
        OPT["Optimization Module"]:::core
    end

    %% Data I/O Layer
    subgraph "Data I/O"
        CSV["CSV Reader/Writer"]:::io
        JSON["JSON Reader/Writer"]:::io
    end

    %% External Dependencies
    subgraph "External Dependencies"
        NP((NumPy)):::external
        SP((SciPy)):::external
        MP((Matplotlib)):::external
        PD((pandas)):::external
    end

    %% CI/CD & Packaging
    subgraph "CI/CD & Packaging"
        PYT{pytest}:::ci
        GCI{GitLab CI}:::ci
        PKG[setup.py/pyproject.toml]:::ci
    end

    %% Mirror README
    README["README.md"]:::external

    %% Relationships
    UI -->|"calls API"| FM
    UI -->|"defines farm"| FD
    FM -->|"uses"| WC
    FM -->|"compute using"| NP
    FM -->|"compute using"| SP
    WC -->|"combine wakes with"| NP
    WC -->|"combine wakes with"| SP
    FD -->|"loads/saves via"| CSV
    FD -->|"loads/saves via"| JSON
    FM -->|"plot results via"| MP
    FM -->|"dataframe via"| PD

    %% Tests invoking modules
    PYT -->|"tests"| FM
    PYT -->|"tests"| WC
    PYT -->|"tests"| FD
    PYT -->|"tests"| OPT
    PYT -->|"tests examples"| UI

    %% CI/CD pipeline flow
    GCI -.->|"runs"| PYT
    GCI -.->|"packages"| PKG

    %% Readme reference
    README -.->|"mirror of upstream"| UI

    %% Click Events
    click README "https://github.com/dtuwindenergy/pywake/blob/master/README.md"

    %% Styles
    classDef core fill:#D0E1F9,stroke:#3B6EA5,stroke-width:1px
    classDef ui fill:#F9E79F,stroke:#B7950B,stroke-width:1px
    classDef external fill:#A9DFBF,stroke:#145A32,stroke-width:1px
    classDef ci fill:#D5D8DC,stroke:#566573,stroke-width:1px,stroke-dasharray: 5 5
    classDef io fill:#E8DAEF,stroke:#6C3483,stroke-width:1px
```
