# eppy.EPlusInterfaceFunctions package¶

## eppy.EPlusInterfaceFunctions.eplusdata module¶

Legacy code from EPlusInterface

class eppy.EPlusInterfaceFunctions.eplusdata.Eplusdata(dictfile=None, fname=None)[source]

Bases: object

add2node(othereplus, node)[source]

add the node here with the node from othereplus this will potentially have duplicates

addinnode(otherplus, node, objectname)[source]

add an item to the node. example: add a new zone to the element ‘ZONE’

getrefs(reflist)[source]

reflist is got from getobjectref in parse_idd.py getobjectref returns a dictionary. reflist is an item in the dictionary getrefs gathers all the fields refered by reflist

initdict(fname)[source]

create a blank dictionary

makedict(dictfile, fnamefobject)[source]

stuff file data into the blank dictionary

replacenode(othereplus, node)[source]

replace the node here with the node from othereplus

class eppy.EPlusInterfaceFunctions.eplusdata.Idd(dictfile, version=2)[source]

Bases: object

Idd object

initdict(fname)[source]
initdict2(dictfile)[source]
eppy.EPlusInterfaceFunctions.eplusdata.removecomment(astr, cphrase)[source]

the comment is similar to that in python. any charachter after the # is treated as a comment until the end of the line astr is the string to be de-commented cphrase is the comment phrase

## eppy.EPlusInterfaceFunctions.iddgroups module¶

extract the groups from the iddfile

eppy.EPlusInterfaceFunctions.iddgroups.commdct2grouplist(gcommdct)[source]

extract embedded group data from commdct. return gdict -> {g1:[obj1, obj2, obj3], g2:[obj4, ..]}

eppy.EPlusInterfaceFunctions.iddgroups.group2commdct(commdct, glist)[source]

eppy.EPlusInterfaceFunctions.iddgroups.group2commlst(commlst, glist)[source]

eppy.EPlusInterfaceFunctions.iddgroups.idd2group(fhandle)[source]

wrapper for iddtxt2groups

eppy.EPlusInterfaceFunctions.iddgroups.idd2grouplist(fhandle)[source]

wrapper for iddtxt2grouplist

eppy.EPlusInterfaceFunctions.iddgroups.iddtxt2grouplist(txt)[source]

return a list of group names the list in the same order as the idf objects in idd file

eppy.EPlusInterfaceFunctions.iddgroups.iddtxt2groups(txt)[source]

extract the groups from the idd file

eppy.EPlusInterfaceFunctions.iddgroups.nocomment(astr, com)[source]

just like the comment in python. removes any text after the phrase ‘com’

## eppy.EPlusInterfaceFunctions.iddindex module¶

module for idd_index data structure and functions to work with it - idd_index indexes idd_info so that it is easy to search through it. - idd_info is the datastructure that holds the info in the Energy+.idd file

eppy.EPlusInterfaceFunctions.iddindex.makename2refdct(commdct)[source]

make the name2refs dict in the idd_index

eppy.EPlusInterfaceFunctions.iddindex.makeref2namesdct(name2refdct)[source]

make the ref2namesdct in the idd_index

eppy.EPlusInterfaceFunctions.iddindex.ref2names2commdct(ref2names, commdct)[source]

embed ref2names into commdct

## eppy.EPlusInterfaceFunctions.mylib1 module¶

Legacy code from EPlusInterface

eppy.EPlusInterfaceFunctions.mylib1.readfile(pathname)[source]

retrun the data in the file

eppy.EPlusInterfaceFunctions.mylib1.readfileasmac()[source]

eppy.EPlusInterfaceFunctions.mylib1.write_str2file(pathname, astr)[source]

writes a string to file

## eppy.EPlusInterfaceFunctions.mylib2 module¶

leagacy code from EPlusInterface

eppy.EPlusInterfaceFunctions.mylib2.doestr2tabstr(astr, kword)[source]
eppy.EPlusInterfaceFunctions.mylib2.fsliceafter(astr, sub)[source]

Return the slice after at sub in string astr

eppy.EPlusInterfaceFunctions.mylib2.fslicebefore(astr, sub)[source]

Return the slice starting at sub in string astr

eppy.EPlusInterfaceFunctions.mylib2.getoneblock(astr, start, end)[source]

get the block bounded by start and end doesn’t work for multiple blocks

eppy.EPlusInterfaceFunctions.mylib2.list2doe(alist)[source]
eppy.EPlusInterfaceFunctions.mylib2.makedoedict(str1)[source]
eppy.EPlusInterfaceFunctions.mylib2.makedoetree(ddict, bdict)[source]
eppy.EPlusInterfaceFunctions.mylib2.mtabstr2doestr(st1)[source]
eppy.EPlusInterfaceFunctions.mylib2.myreplace(astr, thefind, thereplace)[source]

in string astr replace all occurences of thefind with thereplace

eppy.EPlusInterfaceFunctions.mylib2.pickledump(theobject, fname)[source]

same as pickle.dump(theobject, fhandle).takes filename as parameter

eppy.EPlusInterfaceFunctions.mylib2.pickleload(fname)[source]

same as pickle.load(fhandle).takes filename as parameter

eppy.EPlusInterfaceFunctions.mylib2.printdict(adict)[source]
eppy.EPlusInterfaceFunctions.mylib2.printlist(alist)[source]
eppy.EPlusInterfaceFunctions.mylib2.readfile(filename)[source]
eppy.EPlusInterfaceFunctions.mylib2.tabfile2doefile(tabfile, doefile)[source]
eppy.EPlusInterfaceFunctions.mylib2.tabfile2list(fname)[source]
eppy.EPlusInterfaceFunctions.mylib2.tabstr2doestr(astr)[source]
eppy.EPlusInterfaceFunctions.mylib2.tabstr2list(data)[source]
eppy.EPlusInterfaceFunctions.mylib2.tree2doe(str1)[source]

## eppy.EPlusInterfaceFunctions.parse_idd module¶

legacy code from EPlusInterface

eppy.EPlusInterfaceFunctions.parse_idd.extractidddata(fname, debug=False)[source]

extracts all the needed information out of the idd file if debug is True, it generates a series of text files. Each text file is incrementally different. You can do a diff see what the change is - this code is from 2004. it works. I am trying not to change it (until I rewrite the whole thing) to add functionality to it, I am using decorators So if Does not integrate group data into the results (@embedgroupdata does it) Does not integrate iddindex into the results (@make_idd_index does it)

eppy.EPlusInterfaceFunctions.parse_idd.get_nocom_vars(astr)[source]

input ‘astr’ which is the Energy+.idd file as a string returns (st1, st2, lss) st1 = with all the ! comments striped st2 = strips all comments - both the ‘!’ and ‘’ lss = nested list of all the variables in Energy+.idd file

eppy.EPlusInterfaceFunctions.parse_idd.getobjectref(blocklst, commdct)[source]

makes a dictionary of object-lists each item in the dictionary points to a list of tuples the tuple is (objectname, fieldindex)

eppy.EPlusInterfaceFunctions.parse_idd.nocomment(astr, com)[source]

just like the comment in python. removes any text after the phrase ‘com’

eppy.EPlusInterfaceFunctions.parse_idd.removeblanklines(astr)[source]

remove the blank lines in astr

eppy.EPlusInterfaceFunctions.readidf.readdatacommdct(idfname, iddfile='Energy+.idd', commdct=None)[source]

eppy.EPlusInterfaceFunctions.readidf.readdatacommdct1(idfname, iddfile='Energy+.idd', commdct=None, block=None)[source]

eppy.EPlusInterfaceFunctions.readidf.readdatacommlst(idfname)[source]

eppy.EPlusInterfaceFunctions.readidf.readiddidf(idfname)[source]

eppy.EPlusInterfaceFunctions.readidf.readiddstuff(idfname)[source]

eppy.EPlusInterfaceFunctions.readidf.readidf(idfname)[source]

## eppy.EPlusInterfaceFunctions.structures module¶

Implements a case-insensitive dict, based on https://stackoverflow.com/a/32888599/1706564

class eppy.EPlusInterfaceFunctions.structures.CaseInsensitiveDict(*args, **kwargs)[source]

Bases: dict

get(key, *args, **kwargs)[source]

Return the value for key if key is in the dictionary, else default.

has_key(key)[source]
pop(k[, d]) → v, remove specified key and return the corresponding value.[source]

If key is not found, d is returned if given, otherwise KeyError is raised

setdefault(key, *args, **kwargs)[source]

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) → None. Update D from dict/iterable E and F.[source]

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]