# roruizf/openstudio-toolkit architecture

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

- Interactive diagram: https://gitdiagram.com/roruizf/openstudio-toolkit
- Repository: https://github.com/roruizf/openstudio-toolkit

## Overview

##### Main Components
- Core Library (OpenStudio Toolkit): Represented by the overall Python package including the "__init__.py" and README.
- Domain Objects (osm_objects): A set of modules, each encapsulating aspects of building simulation. These include files like building.py, surfaces.py, hvac_components.py, and more.
- Utility Modules (utils): Components that offer helper functions (such as Excel interactions and OSM processing) that support and interface with the domain objects.
- External Integration/Interfaces: Although not explicitly visible from the file tree, the presence of “excel_utils.py” and “osm_utils.py” suggests the project interacts with external data formats (Excel files or OSM models).

##### Relationships and Interactions
- The core library acts as the central umbrella that integrates the domain objects and utility components.
- The osm_objects modules likely interact with one another to collaboratively build a full building simulation model (for example, a Building object might rely on Spaces, Surfaces, and ThermalZones).
- The utils components are used throughout "osm_objects" to perform specific tasks (e.g., reading data from Excel or processing OSM files) and may also interact with external systems.

##### Architectural Patterns and Design Principles
- Modular Design: Each building component (air loops, building stories, HVAC sizing, etc.) is separated into its own module, following the single-responsibility principle.
- Layered Architecture:
- Domain Layer: Includes all the simulation objects (osm_objects).
- Utility Layer: Provides auxiliary functions for processing and data integration, decoupled from the business logic.
- This decoupling suggests that changes in how data is ingested (e.g., modifications in Excel format) can be contained within the utils without affecting the core domain logic.

##### Relevant Technologies, Frameworks, and Libraries
- Python is the development language.
- There is a potential integration with OpenStudio (suggested by the toolkit description and “osm” naming).
- Any additional third-party libraries for Excel (like openpyxl or pandas) or XML/OSM parsing may be used, though specifics aren’t detailed in the file tree.

- Each main component should have clear labels (e.g., “Building Module”, “HVAC Components”, “Utility Functions – Excel”, “Utility Functions – OSM”).
- How external data (from Excel or OSM) enters via the utilities.

## Diagram (Mermaid)

```mermaid
graph TD
    A["OpenStudio Toolkit"]:::core

    subgraph "Domain Objects"
        B["Building Module"]:::domain
        C["Air Loops"]:::domain
        D["Building Stories"]:::domain
        E["HVAC Components"]:::domain
        F["Surfaces"]:::domain
        G["Thermal Zones"]:::domain
        H["Other Simulation Components"]:::domain
    end

    subgraph "Utility Modules"
        I["Excel Utilities"]:::utils
        J["OSM Utilities"]:::utils
    end

    A --> B
    A --> C
    A --> D
    A --> E
    A --> F
    A --> G
    A --> H
    A --> I
    A --> J

    I -->|"data"| B
    I -->|"data"| C
    I -->|"data"| D
    I -->|"data"| E
    I -->|"data"| F
    I -->|"data"| G
    I -->|"data"| H
    J -->|"data"| B
    J -->|"data"| C
    J -->|"data"| D
    J -->|"data"| E
    J -->|"data"| F
    J -->|"data"| G
    J -->|"data"| H

    B -->|"aggregates"| F
    B -->|"aggregates"| G

    classDef core fill:#f4a460,stroke:#333,stroke-width:2px;
    classDef domain fill:#87CEFA,stroke:#333,stroke-width:2px;
    classDef utils fill:#90EE90,stroke:#333,stroke-width:2px;

    click A "https://github.com/roruizf/openstudio-toolkit/blob/main/__init__.py"
    click B "https://github.com/roruizf/openstudio-toolkit/blob/main/osm_objects/building.py"
    click C "https://github.com/roruizf/openstudio-toolkit/blob/main/osm_objects/air_loops.py"
    click D "https://github.com/roruizf/openstudio-toolkit/blob/main/osm_objects/building_stories.py"
    click E "https://github.com/roruizf/openstudio-toolkit/blob/main/osm_objects/hvac_components.py"
    click F "https://github.com/roruizf/openstudio-toolkit/blob/main/osm_objects/surfaces.py"
    click G "https://github.com/roruizf/openstudio-toolkit/blob/main/osm_objects/thermal_zones.py"
    click H "https://github.com/roruizf/openstudio-toolkit/blob/main/osm_objects/component_curves.py"
    click I "https://github.com/roruizf/openstudio-toolkit/blob/main/utils/excel_utils.py"
    click J "https://github.com/roruizf/openstudio-toolkit/blob/main/utils/osm_utils.py"
```
