Dragonfly Energy
raw JSON → 1.42.11 verified Fri May 01 auth: no python
Dragonfly extension for energy simulation. Part of Ladybug Tools, it enables urban-scale energy modeling using EnergyPlus via Honeybee-Energy. Current version: 1.42.11. Regular releases (weekly).
pip install dragonfly-energy Common errors
error ModuleNotFoundError: No module named 'dragonfly' ↓
cause Incorrect import path. The library is installed as dragonfly-energy but the import module is dragonfly_energy.
fix
Use import dragonfly_energy instead of import dragonfly
error TypeError: SimulateModel.__init__() got an unexpected keyword argument 'run_type' ↓
cause Parameter renamed from 'run_type' to 'simulation_type' in v1.40.0.
fix
Use simulation_type='as_expected' instead of run_type='as_expected'
error OSError: [Errno 2] No such file or directory: '.../EnergyPlus' ↓
cause EnergyPlus executable not installed or not in PATH.
fix
Install EnergyPlus (e.g., via ladybug-tools/ladybug-docker) and ensure it's on PATH, or set environment variable ENERGYPLUS_DIR
Warnings
breaking Python 3.7 support dropped in v1.40.0. Only Python 3.8+ supported. ↓
fix Upgrade Python to 3.8 or later
breaking Deprecated attributes in SimulateModel changed names; old 'run_type' replaced by 'simulation_type'. ↓
fix Use 'simulation_type' instead of 'run_type'
deprecated The 'Model.load_model' method is deprecated; use Model.from_file instead. ↓
fix Replace Model.load_model(path, **kw) with Model.from_file(path, **kw)
gotcha SimulateModel output folder is overwritten by default unless you set 'overwrite=False'. ↓
fix SimulateModel(model_path, overwrite=False)
Imports
- DragonflyEnergyProperties wrong
from dragonfly.energy import DragonflyEnergyPropertiescorrectfrom dragonfly_energy.properties import DragonflyEnergyProperties - EnergySimulation wrong
from dragonfly_energy.simulate import EnergySimulationcorrectfrom dragonfly_energy.simulation import EnergySimulation - SimulateModel
from dragonfly_energy.simulation import SimulateModel
Quickstart
from dragonfly_energy.simulation import SimulateModel
from ladybug.futil import preparedir
from pathlib import Path
# Create a simulation model
model_path = Path('./model.dfjson')
sim = SimulateModel(model_path)
sim.run()
print(f'Simulation completed. Results in: {sim.output_folder}')