dragonfly-energy


Namedragonfly-energy JSON
Version 1.10.20 PyPI version JSON
download
home_pagehttps://github.com/ladybug-tools/dragonfly-energy
SummaryDragonfly extension for energy simulation.
upload_time2020-09-30 00:53:55
maintainer
docs_urlNone
authorLadybug Tools
requires_python
licenseAGPL-3.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Build Status](https://travis-ci.org/ladybug-tools/dragonfly-energy.svg?branch=master)](https://travis-ci.org/ladybug-tools/dragonfly-energy)
[![Coverage Status](https://coveralls.io/repos/github/ladybug-tools/dragonfly-energy/badge.svg?branch=master)](https://coveralls.io/github/ladybug-tools/dragonfly-energy)

[![Python 2.7](https://img.shields.io/badge/python-2.7-green.svg)](https://www.python.org/downloads/release/python-270/) [![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/)

# 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](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:
```
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
```
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": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Ladybug Tools",
    "author_email": "info@ladybug.tools",
    "download_url": "https://files.pythonhosted.org/packages/f2/b3/3291c0a86db704ea5822e8859c624fda3ceae3c36e41a57c3ba303ce5496/dragonfly-energy-1.10.20.tar.gz",
    "platform": "",
    "description": "[![Build Status](https://travis-ci.org/ladybug-tools/dragonfly-energy.svg?branch=master)](https://travis-ci.org/ladybug-tools/dragonfly-energy)\n[![Coverage Status](https://coveralls.io/repos/github/ladybug-tools/dragonfly-energy/badge.svg?branch=master)](https://coveralls.io/github/ladybug-tools/dragonfly-energy)\n\n[![Python 2.7](https://img.shields.io/badge/python-2.7-green.svg)](https://www.python.org/downloads/release/python-270/) [![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/)\n\n# dragonfly-energy\n\nDragonfly extension for energy simulation.\n\n## Installation\n`pip install dragonfly-energy`\n\nIf you want to also include the command line interface try:\n\n`pip install -U dragonfly-energy[cli]`\n\n## QuickStart\n```\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```\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# 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```\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\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\n\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0",
    "summary": "Dragonfly extension for energy simulation.",
    "version": "1.10.20",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "407ab0982009d790c05b2476d1b430b7",
                "sha256": "fc610a38e883a512740d7243d6a98372c3b1608e11bdc5beaab9b8dea905869b"
            },
            "downloads": -1,
            "filename": "dragonfly_energy-1.10.20-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "407ab0982009d790c05b2476d1b430b7",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 45142,
            "upload_time": "2020-09-30T00:53:54",
            "upload_time_iso_8601": "2020-09-30T00:53:54.632270Z",
            "url": "https://files.pythonhosted.org/packages/f8/af/4d3b53d6b642f2530da0d945ebd81d9428ea5d9190df92ab2ba1e6029d8e/dragonfly_energy-1.10.20-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "9d8f0e778178272939677cb42d1ff34a",
                "sha256": "68acc6d4204ba2247504767c1ad9a3eb2f3e33fd5be409057ccdbf40dde71af2"
            },
            "downloads": -1,
            "filename": "dragonfly-energy-1.10.20.tar.gz",
            "has_sig": false,
            "md5_digest": "9d8f0e778178272939677cb42d1ff34a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 295379,
            "upload_time": "2020-09-30T00:53:55",
            "upload_time_iso_8601": "2020-09-30T00:53:55.732064Z",
            "url": "https://files.pythonhosted.org/packages/f2/b3/3291c0a86db704ea5822e8859c624fda3ceae3c36e41a57c3ba303ce5496/dragonfly-energy-1.10.20.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-09-30 00:53:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "ladybug-tools",
    "error": "Could not fetch GitHub repository",
    "lcname": "dragonfly-energy"
}
        
Elapsed time: 0.16026s