
[](https://github.com/ladybug-tools/dragonfly-energy/actions)
[](https://coveralls.io/github/ladybug-tools/dragonfly-energy)
[](https://www.python.org/downloads/release/python-3100/) [](https://www.python.org/downloads/release/python-370/) [](https://www.python.org/downloads/release/python-270/) [](https://github.com/IronLanguages/ironpython2/releases/tag/ipy-2.7.8/)
# dragonfly-energy
Dragonfly extension for energy simulation, including integration with the
[EnergyPlus](https://github.com/NREL/EnergyPlus) simulation engine, the
[OpenStudio](https://github.com/NREL/OpenStudio) SDK, and the
[URBANopt](https://docs.urbanopt.net/) SDK.
## Installation
`pip install dragonfly-energy`
To check if Dragonfly command line interface is installed correctly
use `dragonfly-energy --help`.
## QuickStart
```python
import dragonfly_energy
```
## [API Documentation](http://ladybug-tools.github.io/dragonfly-energy/docs)
## 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:
```python
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:
```python
# 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.
```python
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
```
2. Install dependencies:
```
cd dragonfly-energy
pip install -r dev-requirements.txt
pip install -r requirements.txt
```
3. Run Tests:
```
python -m pytest tests/
```
4. Generate Documentation:
```
sphinx-apidoc -f -e -d 4 -o ./docs ./dragonfly_energy
sphinx-build -b html ./docs ./docs/_build/docs
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ladybug-tools/dragonfly-energy",
"name": "dragonfly-energy",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Ladybug Tools",
"author_email": "info@ladybug.tools",
"download_url": "https://files.pythonhosted.org/packages/37/c5/ce5fffd9d9fb2a9e03dfeceece0e5cea07b28b548343fd0e9c469d2013a2/dragonfly_energy-1.35.47.tar.gz",
"platform": null,
"description": "\n\n[](https://github.com/ladybug-tools/dragonfly-energy/actions)\n[](https://coveralls.io/github/ladybug-tools/dragonfly-energy)\n\n[](https://www.python.org/downloads/release/python-3100/) [](https://www.python.org/downloads/release/python-370/) [](https://www.python.org/downloads/release/python-270/) [](https://github.com/IronLanguages/ironpython2/releases/tag/ipy-2.7.8/)\n\n# dragonfly-energy\n\nDragonfly extension for energy simulation, including integration with the \n[EnergyPlus](https://github.com/NREL/EnergyPlus) simulation engine, the \n[OpenStudio](https://github.com/NREL/OpenStudio) SDK, and the\n[URBANopt](https://docs.urbanopt.net/) SDK.\n\n## Installation\n\n`pip install dragonfly-energy`\n\nTo check if Dragonfly command line interface is installed correctly\nuse `dragonfly-energy --help`.\n\n## QuickStart\n\n```python\nimport dragonfly_energy\n```\n\n## [API Documentation](http://ladybug-tools.github.io/dragonfly-energy/docs)\n\n## Usage\nSince the building geometry in dragonfly is fundamentally 2D, creating a model of\na building and assigning energy model properties can be done with a few lines of\ncode. Here is an example:\n\n```python\nfrom dragonfly.model import Model\nfrom dragonfly.building import Building\nfrom dragonfly.story import Story\nfrom dragonfly.room2d import Room2D\nfrom dragonfly.windowparameter import SimpleWindowRatio\nfrom honeybee_energy.lib.programtypes import office_program\n\n# create the Building object\npts_1 = (Point3D(0, 0, 3), Point3D(0, 10, 3), Point3D(10, 10, 3), Point3D(10, 0, 3))\npts_2 = (Point3D(10, 0, 3), Point3D(10, 10, 3), Point3D(20, 10, 3), Point3D(20, 0, 3))\npts_3 = (Point3D(0, 10, 3), Point3D(0, 20, 3), Point3D(10, 20, 3), Point3D(10, 10, 3))\npts_4 = (Point3D(10, 10, 3), Point3D(10, 20, 3), Point3D(20, 20, 3), Point3D(20, 10, 3))\nroom2d_1 = Room2D('Office1', Face3D(pts_1), 3)\nroom2d_2 = Room2D('Office2', Face3D(pts_2), 3)\nroom2d_3 = Room2D('Office3', Face3D(pts_3), 3)\nroom2d_4 = Room2D('Office4', Face3D(pts_4), 3)\nstory = Story('OfficeFloor', [room2d_1, room2d_2, room2d_3, room2d_4])\nstory.solve_room_2d_adjacency(0.01)\nstory.set_outdoor_window_parameters(SimpleWindowRatio(0.4))\nstory.multiplier = 4\nbuilding = Building('OfficeBuilding', [story])\n\n# assign energy properties\nfor room in story.room_2ds:\n room.properties.energy.program_type = office_program\n room.properties.energy.add_default_ideal_air()\n\n# create the Model object\nmodel = Model('NewDevelopment', [building])\n```\n\nOnce a Dragonfly Model has been created, it can be converted to a honeybee Model,\nwhich can then be converted to IDF format like so:\n\n```python\n# create the dragonfly Model object\nmodel = Model('NewDevelopment', [building])\n\n# serialize the dragonfly Model to Honeybee Models and convert them to IDF\nhb_models = model.to_honeybee('Building', use_multiplier=False, tolerance=0.01)\nidfs = [hb_model.to.idf(hb_model) for hb_model in hb_models]\n```\n\nThe dragonfly model can also be serialized to a geoJSON to be simulated with URBANopt.\n\n```python\nfrom ladybug.location import Location\n\n# create the dragonfly Model object\nmodel = Model('NewDevelopment', [building])\n\n# create a location for the geoJSON and write it to a folder\nlocation = Location('Boston', 'MA', 'USA', 42.366151, -71.019357)\nsim_folder = './tests/urbanopt_model'\ngeojson, hb_model_jsons, hb_models = model.to.urbanopt(model, location, folder=sim_folder)\n```\n\n## Local Development\n\n1. Clone this repo locally\n```\ngit clone git@github.com:ladybug-tools/dragonfly-energy\n\n# or\n\ngit clone https://github.com/ladybug-tools/dragonfly-energy\n```\n2. Install dependencies:\n```\ncd dragonfly-energy\npip install -r dev-requirements.txt\npip install -r requirements.txt\n```\n\n3. Run Tests:\n```\npython -m pytest tests/\n```\n\n4. Generate Documentation:\n```\nsphinx-apidoc -f -e -d 4 -o ./docs ./dragonfly_energy\nsphinx-build -b html ./docs ./docs/_build/docs\n```\n",
"bugtrack_url": null,
"license": "AGPL-3.0",
"summary": "Dragonfly extension for energy simulation.",
"version": "1.35.47",
"project_urls": {
"Homepage": "https://github.com/ladybug-tools/dragonfly-energy"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "265b7ea92b65b5afc8a0c5bd08ade8e64d5de8d5c3665a62579668295fae758e",
"md5": "573345b4022ecd895897a44c026c6f50",
"sha256": "ee6e6789af95f2f20cc4149ff93e456c613e5b152c09e71a1f7d8fe52f888494"
},
"downloads": -1,
"filename": "dragonfly_energy-1.35.47-py3-none-any.whl",
"has_sig": false,
"md5_digest": "573345b4022ecd895897a44c026c6f50",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 165497,
"upload_time": "2025-10-22T02:05:19",
"upload_time_iso_8601": "2025-10-22T02:05:19.983690Z",
"url": "https://files.pythonhosted.org/packages/26/5b/7ea92b65b5afc8a0c5bd08ade8e64d5de8d5c3665a62579668295fae758e/dragonfly_energy-1.35.47-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "37c5ce5fffd9d9fb2a9e03dfeceece0e5cea07b28b548343fd0e9c469d2013a2",
"md5": "3937b9c5320a91bf1d9359b682dd5c18",
"sha256": "ac4f70a13f738c4aea23c5a199e1dbb37f83962277f69172bb67d98162084aba"
},
"downloads": -1,
"filename": "dragonfly_energy-1.35.47.tar.gz",
"has_sig": false,
"md5_digest": "3937b9c5320a91bf1d9359b682dd5c18",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 142489,
"upload_time": "2025-10-22T02:05:23",
"upload_time_iso_8601": "2025-10-22T02:05:23.034044Z",
"url": "https://files.pythonhosted.org/packages/37/c5/ce5fffd9d9fb2a9e03dfeceece0e5cea07b28b548343fd0e9c469d2013a2/dragonfly_energy-1.35.47.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-22 02:05:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ladybug-tools",
"github_project": "dragonfly-energy",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "dragonfly-core",
"specs": [
[
"==",
"1.74.2"
]
]
},
{
"name": "honeybee-energy",
"specs": [
[
"==",
"1.116.93"
]
]
}
],
"lcname": "dragonfly-energy"
}