# hydroclimateextremesgroup/rainyday architecture

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

- Interactive diagram: https://gitdiagram.com/hydroclimateextremesgroup/rainyday
- Repository: https://github.com/hydroclimateextremesgroup/rainyday

## Overview

##### Main Components
- Data Ingestion & Input Resources:
- Source of remotely-sensed precipitation fields.
- GIS components (as seen under the Examples/BigThompson and Madison folders) that provide watershed boundary data, domain boundaries, and related GIS file formats (.shp, .dbf, etc.).
- Rainfall frequency analysis and intensity-duration-frequency (IDF) datasets from the IDFdata folder.
- Core Simulation Engine:
- Main engine for SST calculations; this is implemented in the Source directory (e.g., RainyDay_Py3.py) where the core algorithms reside.
- Utilities provided in the RainyDay_utilities_Py3 package; these likely contain functions for processing and analysis (RainyDay_functions.py).
- Configuration & Environment:
- Configuration files like RainyDay.yml and RainyDayPy38.yml, indicating how the system is parameterized and how environments are set up.
- Example & Testing Modules:
- A separate component for examples (Examples and sample directories) which serve both as demonstrations and test cases.
- User Documentation:
- UserGuide directory as the interface for learners and analysts (with notebook tutorials) to understand and run simulations.

##### Relationships and Interactions
- Data Flow:
- How the simulation engine interacts with the utilities module for manipulating input data and performing the stochastic resampling.
- Configuration Integration:
- That configuration files feed into the simulation engine, controlling key parameters for scenario generation.
- Output Generation:
- Example and Testing:

##### Architectural Patterns and Design Principles
- Separation of Concerns:
- Distinguish between the simulation core (business logic), the utilities, and the data management sections.
- Modular Structure:
- That the project is organized into modules (Source for logic, utilities for supplementary functionality, Examples for use cases, and UserGuide for documentation and tutorials).
- Extensibility:

##### Technologies, Frameworks, and Libraries
- Python is at the center (as indicated by the .py files and YAML configurations).
- GIS processing libraries (implied by the existence of shapefiles and associated GIS formats) should be noted as critical external dependencies.
- Any statistical libraries for handling stochastic processes and resampling should be mentioned if they are apparent from the code structure.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Data Ingestion & Input Resources
    subgraph "Data Ingestion & Input Resources"
        A1["BigThompson (GIS/IDF)"]:::input
        A2["Madison (GIS/Storm Transposition)"]:::input
    end

    %% Configuration
    subgraph "Configuration"
        B1["RainyDay.yml"]:::config
        B2["RainyDayPy38.yml"]:::config
    end

    %% Example & Testing Modules
    subgraph "Example & Testing Modules"
        C1["Examples (Test Cases)"]:::example
        C2["Sample Configurations"]:::example
    end

    %% User Documentation
    subgraph "User Documentation"
        D1["User Documentation"]:::doc
    end

    %% Core Simulation Engine and Utilities
    S["SST Simulation Engine (Core)"]:::core
    U["Utilities Module"]:::util

    %% Output Generation
    E["Generated Rainfall Scenarios"]:::output

    %% Connections: Data ingestion to Core Engine
    A1 -->|"feeds"| S
    A2 -->|"feeds"| S

    %% Connections: Configuration to Core Engine
    B1 -->|"configures"| S
    B2 -->|"configures"| S

    %% Connections: Example & Testing to Core Engine
    C1 -->|"providesSamples"| S
    C2 -->|"providesSamples"| S

    %% Documentation influences usage
    D1 -->|"guidesUsage"| S

    %% Core Engine relies on Utilities
    S -->|"reliesOn"| U

    %% Core Engine produces output
    S -->|"generates"| E

    %% Click Events
    click A1 "https://github.com/hydroclimateextremesgroup/rainyday/tree/main/Examples/BigThompson"
    click A2 "https://github.com/hydroclimateextremesgroup/rainyday/tree/main/Examples/Madison"
    click S "https://github.com/hydroclimateextremesgroup/rainyday/blob/main/Source/RainyDay_Py3.py"
    click U "https://github.com/hydroclimateextremesgroup/rainyday/blob/main/Source/RainyDay_utilities_Py3/RainyDay_functions.py"
    click B1 "https://github.com/hydroclimateextremesgroup/rainyday/blob/main/RainyDay.yml"
    click B2 "https://github.com/hydroclimateextremesgroup/rainyday/blob/main/Source/RainyDayPy38.yml"
    click C1 "https://github.com/hydroclimateextremesgroup/rainyday/tree/main/Examples"
    click C2 "https://github.com/hydroclimateextremesgroup/rainyday/tree/main/sample"
    click D1 "https://github.com/hydroclimateextremesgroup/rainyday/tree/main/UserGuide"

    %% Styles
    classDef input fill:#c5f7bb,stroke:#333,stroke-width:2px;
    classDef core fill:#9dc6f7,stroke:#333,stroke-width:2px;
    classDef config fill:#f7e1a1,stroke:#333,stroke-width:2px;
    classDef util fill:#fad4a0,stroke:#333,stroke-width:2px;
    classDef example fill:#d1a9f7,stroke:#333,stroke-width:2px;
    classDef doc fill:#a1f7f0,stroke:#333,stroke-width:2px;
    classDef output fill:#b2f7a1,stroke:#333,stroke-width:2px;
```
