Eppy Documentation

Authors: Santosh Philip, Leora Tanjuatco

Eppy is a scripting language for E+ idf files, and E+ output files. Eppy is written in the programming language Python. As a result it takes full advantage of the rich data structure and idioms that are avaliable in python. You can programmatically navigate, search, and modify E+ idf files useing eppy. The power of using a scripting language allows you to do the following:

  • Make a large number of changes in an idf file with a few lines of eppy code.
  • Use conditions and filters when making changes to a idf file
  • Make changes to multiple idf files.
  • Read data from the output files of a E+ simulation run.
  • Based to the results of a E+ simulation run, generate the input file for the next simulation run.

So what does this matter?
Here are some of the things you can do with eppy:

  • Change construction for all north facing walls.
  • Change the glass type for all windows larger than 2 square meters.
  • Change the number of people in all the interior zones.
  • Change the lighting power in all south facing zones.
  • Change the efficiency and fan power of all rooftop units.
  • Find the energy use of all the models in a folder (or of models that were run after a certain date)
  • If a model is using more energy than expected, keep increasing the R-value of the roof until you get to the expected energy use.

Quick Start

Here is a short IDF file that I’ll be using as an example to start us off:

VERSION, 7.2; !- Version Identifier SIMULATIONCONTROL, Yes, !- Do Zone Sizing Calculation Yes, !- Do System Sizing Calculation Yes, !- Do Plant Sizing Calculation No, !- Run Simulation for Sizing Periods Yes; !- Run Simulation for Weather File Run Periods BUILDING, White House, !- Name 30., !- North Axis {deg} City, !- Terrain 0.04, !- Loads Convergence Tolerance Value 0.4, !- Temperature Convergence Tolerance Value {deltaC} FullExterior, !- Solar Distribution 25, !- Maximum Number of Warmup Days 6; !- Minimum Number of Warmup Days SITE:LOCATION, CHICAGO_IL_USA TMY2-94846, !- Name 41.78, !- Latitude {deg} -87.75, !- Longitude {deg} -6.00, !- Time Zone {hr} 190.00; !- Elevation {m}

To use eppy to look at this model, we have to run a little code first:


In [1]:
import modeleditor
from modeleditor import IDF

iddfile = "../iddfiles/Energy+V7_2_0.idd"
IDF.setiddname(iddfile)

fname1 = "../idffiles/V_7_2/smallfile.idf"
idf1 = IDF(fname1)

Now that the behind-the-scenes work is done, we can print the model using this command:

filename.printidf()

For this example, we have named the file "idf1". So the command looks like this:


In [2]:
idf1.printidf()


VERSION,
     7.3;

SIMULATIONCONTROL,
     Yes,
     Yes,
     Yes,
     No,
     Yes;

BUILDING,
     White House,
     30.0,
     City,
     0.04,
     0.4,
     FullExterior,
     25,
     6;

SITE:LOCATION,
     CHICAGO_IL_USA TMY2-94846,
     41.78,
     -87.75,
     -6.0,
     190.0;


Looks like the same file as before, except that all the comments have been removed. Well ... this version of eppy is not smart enough to deal with comments. It just removes all of them :-(

As you can see, this file has four objects:

  • VERSION
  • SIMULATIONCONTROL
  • BUILDING
  • SITE:LOCATION

So, let us look take a closer look at the BUILDING object:


In [3]:
print idf1.idfobjects['BUILDING']  # put the name of the object you'd like to look at in brackets


[
BUILDING,                 
    White House,              !- Name
    30.0,                     !- North Axis
    City,                     !- Terrain
    0.04,                     !- Loads Convergence Tolerance Value
    0.4,                      !- Temperature Convergence Tolerance Value
    FullExterior,             !- Solar Distribution
    25,                       !- Maximum Number of Warmup Days
    6;                        !- Minimum Number of Warmup Days
]

We can also zoom in on the object and look just at its individual parts.
For example, let us look at the name of the building:


In [4]:
building = idf1.idfobjects['BUILDING'][0] # more behind-the-scenes work
                                          # we'll explain the [0] later

In [5]:
print building.Name


White House

Now that we've isolated the building name, we can change it.


In [6]:
building.Name = "Empire State Building"

In [7]:
print building.Name


Empire State Building

Did this actually change the name in the model ? Let us print the entire model and see.


In [8]:
idf1.printidf()


VERSION,
     7.3;

SIMULATIONCONTROL,
     Yes,
     Yes,
     Yes,
     No,
     Yes;

BUILDING,
     Empire State Building,
     30.0,
     City,
     0.04,
     0.4,
     FullExterior,
     25,
     6;

SITE:LOCATION,
     CHICAGO_IL_USA TMY2-94846,
     41.78,
     -87.75,
     -6.0,
     190.0;


Yes! It did. So we know we can change any field in any object.


In [ ]: