Skip to main content

Dragonfly

Build Status Coverage Status

Python 3.10 Python 3.7 Python 2.7 IronPython

dragonfly-energy

Dragonfly extension for energy simulation, including integration with the EnergyPlus simulation engine, the OpenStudio SDK, and the URBANopt SDK.

Installation

pip install dragonfly-energy

To check if Dragonfly command line interface is installed correctly use dragonfly-energy --help.

QuickStart

import dragonfly_energy

API Documentation

Usage

Since the building geometry in dragonfly is fundamentally 2D, creating a model of a building and assigning energy model properties can be done with a few lines of code. Here is an example:

from dragonfly.model import Model
from dragonfly.building import Building
from dragonfly.story import Story
from dragonfly.room2d import Room2D
from dragonfly.windowparameter import SimpleWindowRatio
from honeybee_energy.lib.programtypes import office_program

# create the Building object
pts_1 = (Point3D(0, 0, 3), Point3D(0, 10, 3), Point3D(10, 10, 3), Point3D(10, 0, 3))
pts_2 = (Point3D(10, 0, 3), Point3D(10, 10, 3), Point3D(20, 10, 3), Point3D(20, 0, 3))
pts_3 = (Point3D(0, 10, 3), Point3D(0, 20, 3), Point3D(10, 20, 3), Point3D(10, 10, 3))
pts_4 = (Point3D(10, 10, 3), Point3D(10, 20, 3), Point3D(20, 20, 3), Point3D(20, 10, 3))
room2d_1 = Room2D('Office1', Face3D(pts_1), 3)
room2d_2 = Room2D('Office2', Face3D(pts_2), 3)
room2d_3 = Room2D('Office3', Face3D(pts_3), 3)
room2d_4 = Room2D('Office4', Face3D(pts_4), 3)
story = Story('OfficeFloor', [room2d_1, room2d_2, room2d_3, room2d_4])
story.solve_room_2d_adjacency(0.01)
story.set_outdoor_window_parameters(SimpleWindowRatio(0.4))
story.multiplier = 4
building = Building('OfficeBuilding', [story])

# assign energy properties
for room in story.room_2ds:
    room.properties.energy.program_type = office_program
    room.properties.energy.add_default_ideal_air()

# create the Model object
model = Model('NewDevelopment', [building])

Once a Dragonfly Model has been created, it can be converted to a honeybee Model, which can then be converted to IDF format like so:

# create the dragonfly Model object
model = Model('NewDevelopment', [building])

# serialize the dragonfly Model to Honeybee Models and convert them to IDF
hb_models = model.to_honeybee('Building', use_multiplier=False, tolerance=0.01)
idfs = [hb_model.to.idf(hb_model) for hb_model in hb_models]

The dragonfly model can also be serialized to a geoJSON to be simulated with URBANopt.

from ladybug.location import Location

# create the dragonfly Model object
model = Model('NewDevelopment', [building])

# create a location for the geoJSON and write it to a folder
location = Location('Boston', 'MA', 'USA', 42.366151, -71.019357)
sim_folder = './tests/urbanopt_model'
geojson, hb_model_jsons, hb_models = model.to.urbanopt(model, location, folder=sim_folder)

Local Development

  1. Clone this repo locally
git clone git@github.com:ladybug-tools/dragonfly-energy

# or

git clone https://github.com/ladybug-tools/dragonfly-energy
  1. Install dependencies:
cd dragonfly-energy
pip install -r dev-requirements.txt
pip install -r requirements.txt
  1. Run Tests:
python -m pytest tests/
  1. Generate Documentation:
sphinx-apidoc -f -e -d 4 -o ./docs ./dragonfly_energy
sphinx-build -b html ./docs ./docs/_build/docs

Metadata

Release files for dragonfly-energy 1.48.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dragonfly-energy 1.48.13
File Size Uploaded Provenance Actions
dragonfly_energy-1.48.13.tar.gz 197.2 kB Without provenance Details for dragonfly_energy-1.48.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dragonfly-energy 1.48.13
File Interpreter ABI Platform Actions
dragonfly_energy-1.48.13-py3-none-any.whl Python 3 none any Details for dragonfly_energy-1.48.13-py3-none-any.whl

Total release size: 420.8 kB

Release files / dragonfly_energy-1.48.13.tar.gz

Download URL dragonfly_energy-1.48.13.tar.gz
Size 197.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1fad677770957da865284a91db5e477c6e7bf575c86d50e91d38d6aea5e7bc1c
BLAKE2b-256 checksum
How to use checksums
c5f8767f1c67656d5a4322e145207f3e1e4671f35d614f76ca5152384e188d92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.16

Release files / dragonfly_energy-1.48.13-py3-none-any.whl

Download URL dragonfly_energy-1.48.13-py3-none-any.whl
Size 223.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6e4d91d50a0946cce06884dafa2542db0ad04748e3d157b91d2e4702823d998
BLAKE2b-256 checksum
How to use checksums
4e2b370c3a490040bb07639d67a4b51d8c0aaded7b1ddab409deebaba32ce9b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.16

Security for dragonfly-energy 1.48.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.48.13 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page