# activatedgeek/sweepr architecture

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

- Interactive diagram: https://gitdiagram.com/activatedgeek/sweepr
- Repository: https://github.com/activatedgeek/sweepr

## Overview

##### Main Components

a) Core Components:
- Sweep Controller (sweepr/sweep.py)
- Run Manager (sweepr/run.py)
- Type System (sweepr/types.py)

b) Extensible Components:
- Executors Framework
- Providers Framework

##### Architecture Pattern
The project follows a plugin-based architecture with two main extension points:
- Executors: Different backends for running experiments
- Providers: Different logging/tracking services

**┌─────────────────────────────────────────────┐**
- Client Code                    │
- ┘
- ↓
**┌─────────────────────────────────────────────┐**
- Sweep Controller                 │

- ┌───────────────┐      ┌───────────────┐   │
- Run Manager  │ ←──→ │  Type System  │   │
- ┘      └───────────────┘   │
- ┘
- ↓
**┌─────────────────────┐    ┌─────────────────┐**
- Executor Interface │    │Provider Interface│
- ┘    └─────────────────┘
- ↓                       ↓
**┌─────────────────────┐    ┌─────────────────┐**
- Executors       │    │    Providers    │
- ┌─────────────┐    │    │ ┌───────────┐   │
- Python    │    │    │ │   W&B     │   │
- ┘    │    │ └───────────┘   │
- ┌─────────────┐    │    │               │
- Pueue     │    │    │               │
- ┘    │    │               │
- ┌─────────────┐    │    │               │
- Slurm     │    │    │               │
- ┘    │    │               │
- ┘    └─────────────────┘

##### Important Details to Capture

a) Core Flow:
- How the Sweep Controller orchestrates the experiment runs
- How the Run Manager interfaces with both executors and providers
- Demonstrate the plugin architecture for executors and providers

b) Extension Points:
- Base classes (base.py) in both executors and providers
- Relationship between concrete implementations and their interfaces

##### Implementation Details
- Maintain consistent spacing and alignment
- Use clear, readable fonts
- Version information if relevant

##### Documentation Integration
- References to specific components in the code documentation

## Diagram (Mermaid)

```mermaid
graph TB
    %% Core Components
    Client[Client Code]
    SweepController[Sweep Controller]:::core
    RunManager[Run Manager]:::core
    TypeSystem[Type System]:::core

    %% Extension Points
    ExecutorInterface[Executor Interface]:::interface
    ProviderInterface[Provider Interface]:::interface

    %% Executors
    subgraph Executors
        PythonExecutor[Python Executor]:::executor
        PueueExecutor[Pueue Executor]:::executor
        SlurmExecutor[Slurm Executor]:::executor
    end

    %% Providers
    subgraph Providers
        WandBProvider[Weights & Biases Provider]:::provider
    end

    %% Relationships
    Client --> SweepController
    SweepController --> RunManager
    SweepController --> TypeSystem
    RunManager <--> TypeSystem
    
    RunManager --> ExecutorInterface
    RunManager --> ProviderInterface
    
    ExecutorInterface --> PythonExecutor
    ExecutorInterface --> PueueExecutor
    ExecutorInterface --> SlurmExecutor
    
    ProviderInterface --> WandBProvider

    %% Styles
    classDef core fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef interface fill:#90EE90,stroke:#333,stroke-width:2px
    classDef executor fill:#FFE5B4,stroke:#333,stroke-width:2px
    classDef provider fill:#FFE5B4,stroke:#333,stroke-width:2px

    %% Click Events
    click SweepController "https://github.com/activatedgeek/sweepr/blob/main/sweepr/sweep.py"
    click RunManager "https://github.com/activatedgeek/sweepr/blob/main/sweepr/run.py"
    click TypeSystem "https://github.com/activatedgeek/sweepr/blob/main/sweepr/types.py"
    click ExecutorInterface "https://github.com/activatedgeek/sweepr/blob/main/sweepr/executors/base.py"
    click PythonExecutor "https://github.com/activatedgeek/sweepr/blob/main/sweepr/executors/python.py"
    click PueueExecutor "https://github.com/activatedgeek/sweepr/blob/main/sweepr/executors/pueue.py"
    click SlurmExecutor "https://github.com/activatedgeek/sweepr/blob/main/sweepr/executors/slurm.py"
    click ProviderInterface "https://github.com/activatedgeek/sweepr/blob/main/sweepr/providers/base.py"
    click WandBProvider "https://github.com/activatedgeek/sweepr/blob/main/sweepr/providers/wandb.py"

    %% Legend
    subgraph Legend
        CoreComponent[Core Component]:::core
        InterfaceComponent[Interface]:::interface
        ImplementationComponent[Implementation]:::executor
    end
```
