Skip to main content

A package for summarizing BRICK models

Project description

BRICK Model Summarizer

PyPI version Tests

BRICK Model Summarizer is a Python tool designed to validate and benchmark AI-generated BRICK models against reference models. It transforms complex BRICK schema TTL files into concise, human-readable summaries of HVAC systems, zones, meters, and central plants. By leveraging reference BRICK models, this tool enables users to validate AI-created models for consistency, accuracy, and adherence to expected standards.

Purpose

The primary purpose of this repository is to provide a framework for summarizing BRICK models into HVAC-centric insights. This is especially useful for:

  • Benchmarking AI-generated BRICK models against reference models.
  • Validating BRICK schemas for completeness and alignment with building system expectations.
  • Empowering building engineers, analysts, and AI developers with clear summaries of mechanical systems and operational data.

Key Features

  • HVAC-Focused Summarization: Extracts key details about AHUs, VAVs, meters, and central plant equipment.
  • Model Validation: Provides a framework for benchmarking AI-created BRICK models.
  • Scalable Processing: Processes individual or multiple BRICK schema TTL files.

Installation

pip install brick-model-summarizer

Local Installation for development purposes

  1. Clone the repository:

    git clone https://github.com/bbartling/brick-model-summarizer.git
    cd brick-model-summarizer
    
  2. Set up a virtual environment (optional but recommended):

    python -m venv env
    source env/bin/activate  # On Windows: .\env\Scripts\activate
    
  3. Install the package locally:

    pip install .
    

Usage

The package includes functions for summarizing BRICK models and generating detailed outputs. Below is an example of how to use the tool in Python to generate JSON-style data.

Example: Processing a BRICK Model

from brick_model_summarizer.utils import load_graph
from brick_model_summarizer.ahu_info import identify_ahu_equipment, collect_ahu_data
from brick_model_summarizer.zone_info import identify_zone_equipment, collect_zone_data
from brick_model_summarizer.meters_info import query_meters, collect_meter_data
from brick_model_summarizer.central_plant_info import (
    identify_hvac_system_equipment,
    collect_central_plant_data,
)
from brick_model_summarizer.building_info import collect_building_data
from brick_model_summarizer.class_tag_checker import analyze_classes_and_tags
import json

# Path to the BRICK schema TTL file
brick_model_file = "sample_brick_models/bldg6.ttl"

# Load the RDF graph once
graph = load_graph(brick_model_file)

# Extract structured data using modular functions
ahu_data = collect_ahu_data(identify_ahu_equipment(graph))
zone_info = identify_zone_equipment(graph)
zone_data = collect_zone_data(zone_info)
building_data = collect_building_data(graph)
meter_data = collect_meter_data(query_meters(graph))
central_plant_data = collect_central_plant_data(identify_hvac_system_equipment(graph))
class_tag_summary = analyze_classes_and_tags(graph)
vav_boxes_per_ahu = zone_info.get("vav_per_ahu", {})

# Construct the final structured output
building_data_summary = {
    "ahu_information": ahu_data,
    "zone_information": zone_data,
    "building_information": building_data,
    "meter_information": meter_data,
    "central_plant_information": central_plant_data,
    "number_of_vav_boxes_per_ahu": vav_boxes_per_ahu,
    "class_tag_summary": class_tag_summary,
}

# Print the output in JSON format
print(json.dumps(building_data_summary, indent=2))

# Optionally, save the output as a JSON file
output_file = "bldg6_summary.json"
with open(output_file, 'w') as file:
    json.dump(building_data_summary, file, indent=2)

Example Output

{
  "ahu_information": {
    "total_ahus": 16,
    "constant_volume_ahus": 11,
    "variable_air_volume_ahus": 0,
    "ahus_with_cooling_coil": 10,
    "ahus_with_heating_coil": 7,
    "ahus_with_dx_staged_cooling": 0,
    "ahus_with_return_fans": 0,
    "ahus_with_supply_fans": 0,
    "ahus_with_return_air_temp_sensors": 4,
    "ahus_with_mixing_air_temp_sensors": 1,
    "ahus_with_leaving_air_temp_sensors": 18,
    "ahus_with_leaving_air_temp_setpoint": 9,
    "ahus_with_duct_pressure_setpoint": 0,
    "ahus_with_duct_pressure": 0
  },
  "zone_information": {
    "zone_air_temperature_setpoints_found": true,
    "total_vav_boxes": 132,
    "number_of_vav_boxes_per_ahu": {
      "ah1s": 4,
      "ah2n": 3,
      "ah2s": 3,
      "ah3s": 1,
      "ahbs": 2,
      "ahu01n": 24,
      "ahu01s": 22,
      "ahu02n": 10,
      "ahu02s": 30,
      "ahu03n": 14,
      "ahu03s": 30
    },
    "vav_boxes_with_reheat_valve_command": 0,
    "vav_boxes_with_air_flow_sensors": 0,
    "vav_boxes_with_supply_air_temp_sensors": 0,
    "vav_boxes_with_air_flow_setpoints": 0,
    "cooling_only_vav_boxes": 132
  },
  "building_information": {
    "building_area": "130149 sq ft",
    "number_of_floors": 4
  },
  "meter_information": {
    "btu_meter_present": false,
    "electrical_meter_present": false,
    "water_meter_present": false,
    "gas_meter_present": false,
    "pv_meter_present": false
  },
  "central_plant_information": {
    "total_chillers": 1,
    "total_boilers": 0,
    "total_cooling_towers": 0,
    "chillers_with_water_flow": 0,
    "boilers_with_water_flow": 0,
    "cooling_towers_with_fan": 0,
    "cooling_towers_with_temp_sensors": 0
  }
}

Validating AI-Generated Models

Use the outputs to compare AI-created models against reference BRICK models, checking for consistency in:

  • Equipment classification (e.g., AHUs, VAVs).
  • Sensor and control points.
  • Central plant configurations.

Sample Data

Reference BRICK models from BRICK resources are included in the sample_brick_models directory. These files can be used for testing and validation.

Web App Demo

View a web app interface on Bens Pythonanywhere account for free!

BRICK Model Summarizer Interface

Contributing

We welcome contributions to improve the repository. Please submit issues or pull requests to discuss new features, bug fixes, or enhancements.

Roadmap

Planned Enhancements

  • ECM and KPI Suggestions: Develop functionality to recommend energy conservation measures (ECMs) based on model summaries.
  • Advanced Validation: Add checks for missing or inconsistent relationships in AI-generated models.
  • PyPI Distribution: Prepare the package for publication on PyPI.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brick_model_summarizer-0.4.0.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brick_model_summarizer-0.4.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file brick_model_summarizer-0.4.0.tar.gz.

File metadata

  • Download URL: brick_model_summarizer-0.4.0.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for brick_model_summarizer-0.4.0.tar.gz
Algorithm Hash digest
SHA256 28552ffd45dc08574e830ce755ea539af9fbc7cc8ba1105ff438c6c04cfcc9ea
MD5 879ea54bbaed376cf0feed27b74dd0d2
BLAKE2b-256 03050bd34bdd2e4818437f6284ff70b7227b740b751ec4f84afcc686330dc46c

See more details on using hashes here.

File details

Details for the file brick_model_summarizer-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for brick_model_summarizer-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0124943f9e9303a6805cc5ee76dcd73c55034e391edada8df3b0e365b966c45a
MD5 ebdbfb512812ec87f0f2f2ef29db3da1
BLAKE2b-256 3c62bec5ca5478b2b815d79d8131cd66bb07fd4abf1f3a17cf719898a35b1b3f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page