Skip to main content

Dragonfly extension for energy simulation.

Project description

Build Status Coverage Status

Python 2.7 Python 3.6

dragonfly-energy

Dragonfly extension for energy simulation.

Installation

pip install dragonfly-energy

If you want to also include the command line interface try:

pip install -U dragonfly-energy[cli]

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

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

dragonfly-energy-1.9.3.tar.gz (295.4 kB view details)

Uploaded Source

Built Distribution

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

dragonfly_energy-1.9.3-py2.py3-none-any.whl (45.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dragonfly-energy-1.9.3.tar.gz.

File metadata

  • Download URL: dragonfly-energy-1.9.3.tar.gz
  • Upload date:
  • Size: 295.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.1

File hashes

Hashes for dragonfly-energy-1.9.3.tar.gz
Algorithm Hash digest
SHA256 27487547cf7f28fe84731154d46ac09f31ae05a0fd79e1000d0021ec17c832cd
MD5 eac3e98e99548a87613299e391e724a9
BLAKE2b-256 b43fe8eb39b6f5f631aaaed3e3bcfa34567ec49ae9ce224a7716836898f93d14

See more details on using hashes here.

File details

Details for the file dragonfly_energy-1.9.3-py2.py3-none-any.whl.

File metadata

  • Download URL: dragonfly_energy-1.9.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 45.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.1

File hashes

Hashes for dragonfly_energy-1.9.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ea0f773f7c6d00b7dc7512b1db8d3532e407ef011dee9564e85a1243350c85c8
MD5 7ac840e6561a0f9926ba26fae0ab55d8
BLAKE2b-256 4f56905629e34e962aeebdd0d2fea3871df656a1449eade12650861d027952d1

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