# lynkerintel/cpra-hsi architecture

> Architecture diagram of the GitHub repository lynkerintel/cpra-hsi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lynkerintel/cpra-hsi
- Repository: https://github.com/lynkerintel/cpra-hsi

## Overview

##### Project Type Analysis
This is a scientific modeling system with two main components:
- Vegetation Processing Module
- Habitat Suitability Index (HSI) Module

##### Key Components

A. Input Layer:
- Environmental Data Sources
- Configuration Files (veg_config.yaml)
- Sequence Data (dry, moderate, wet sequences)

B. Processing Core:
1. VegProcessor Module:
- Data Preprocessing Component
- Vegetation Transition Engine
- Hydrology Processing Component

2. HSI Module:
- Species-specific Models (e.g., Alligator HSI)
- HSI Calculation Engine

C. Output Layer:
- Visualization Components
- Analysis Results
- Model Outputs

**[Input Layer]**
- ↓
**[Processing Layer]**
- ↓
**[Output Layer]**

##### Specific Implementation Details

**[Environmental Data] → [Sequence Files] → [Config Files]**
- ↓                  ↓              ↓
- [VegProcessor Core] ←→ [Hydro Logic] → [Veg Logic]
- ↓
- [Vegetation Transition Engine]
- ↓
- [HSI Processing Module] → [Species-Specific Models]
- ↓
- [Visualization & Analysis]

##### Additional Elements

- Version/timestamp information
- External dependencies or systems
- Data format specifications at transition points

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Input Layer
    subgraph Input
        ED[Environmental Data]:::input
        SF[Sequence Files]:::input
        CF["Configuration (veg_config.yaml)"]:::config
        click CF "https://github.com/LynkerIntel/cpra-hsi/blob/main/VegProcessor/veg_config.yaml"
        
        subgraph Sequences
            DS["Dry Sequence"]:::input
            MS["Moderate Sequence"]:::input
            WS["Wet Sequence"]:::input
            click DS "https://github.com/LynkerIntel/cpra-hsi/blob/main/VegProcessor/sequences/dry_sequence.csv"
            click MS "https://github.com/LynkerIntel/cpra-hsi/blob/main/VegProcessor/sequences/moderate_sequence.csv"
            click WS "https://github.com/LynkerIntel/cpra-hsi/blob/main/VegProcessor/sequences/wet_sequence.csv"
        end
    end

    %% Processing Layer
    subgraph Processing
        subgraph "Vegetation Processing"
            VPC["VegProcessor Core"]:::veg
            HL["Hydrology Logic"]:::veg
            VL["Vegetation Logic"]:::veg
            VTE["Vegetation Transition Engine"]:::veg
            click HL "https://github.com/LynkerIntel/cpra-hsi/blob/main/VegProcessor/hydro_logic.py"
            click VL "https://github.com/LynkerIntel/cpra-hsi/blob/main/VegProcessor/veg_logic.py"
            click VTE "https://github.com/LynkerIntel/cpra-hsi/blob/main/VegProcessor/veg_transition.py"
        end

        subgraph "HSI Module"
            HSIP["HSI Processing"]:::hsi
            SSM["Species-Specific Models"]:::hsi
            AHM["Alligator HSI Model"]:::hsi
            click HSIP "https://github.com/LynkerIntel/cpra-hsi/tree/main/HSI/"
            click AHM "https://github.com/LynkerIntel/cpra-hsi/blob/main/HSI/AlligatorHSI.py"
        end
    end

    %% Output & Testing Layer
    subgraph Output
        VIS["Visualization Component"]:::output
        click VIS "https://github.com/LynkerIntel/cpra-hsi/blob/main/VegProcessor/plotting.py"
        
        subgraph "Testing Components"
            VT["Vegetation Testing"]:::test
            HT["HSI Testing"]:::test
            click VT "https://github.com/LynkerIntel/cpra-hsi/blob/main/VegProcessor/testing.py"
            click HT "https://github.com/LynkerIntel/cpra-hsi/blob/main/HSI/hsi_testing.ipynb"
        end
        
        AN["Analysis Results"]:::output
        MO["Model Outputs"]:::output
    end

    %% Utility Components
    UF["Utility Functions"]:::util
    click UF "https://github.com/LynkerIntel/cpra-hsi/blob/main/VegProcessor/utils.py"

    %% Relationships
    ED --> VPC
    SF --> VPC
    CF --> VPC
    DS & MS & WS --> VPC
    
    VPC <--> HL
    VPC <--> VL
    HL <--> VL
    
    VPC --> VTE
    VTE --> HSIP
    HSIP --> SSM
    SSM --> AHM
    
    VTE --> VIS
    HSIP --> VIS
    VIS --> AN
    VIS --> MO
    
    VT -.-> VPC
    HT -.-> HSIP
    UF -.-> VPC
    UF -.-> HSIP

    %% Styling
    classDef input fill:#3498db,stroke:#2980b9,color:white
    classDef config fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef veg fill:#2ecc71,stroke:#27ae60,color:white
    classDef hsi fill:#e67e22,stroke:#d35400,color:white
    classDef output fill:#9b59b6,stroke:#8e44ad,color:white
    classDef test fill:#e74c3c,stroke:#c0392b,color:white
    classDef util fill:#34495e,stroke:#2c3e50,color:white
```
