Repository: santoshphilip/eppy

Issue:
Issues when importing eppy in Ghpython editor of Grasshopper 
This post is cross-posted [here](https://unmethours.com/question/23188/importing-eppy-in-ghpython/)
I was trying to import eppy in the ghpython editor of Grasshopper, got the error: 
```
Runtime error (InvalidOperationException): Unsupported param dictionary type: IronPython.Runtime.PythonDictionary
Traceback:
  line 44, in initpkg, "C:\Python27\Lib\site-packages\py\_apipkg.py"
  line 19, in <module>, "C:\Python27\Lib\site-packages\py\__init__.py"
  line 22, in <module>, "C:\Python27\Lib\site-packages\eppy\modeleditor.py"
  line 5, in script
```
The line 22 in my **modeleditor.py** is 

> from py._log import warning

I tried to comment line 22 and line 740 out in **modeleditor.py**, yet got another error:

```
Runtime error (ImportException): No module named multiprocessing
Traceback:
  line 23, in <module>, "C:\Python27\Lib\site-packages\eppy\runner\run_functions.py"
  line 28, in <module>, "C:\Python27\Lib\site-packages\eppy\modeleditor.py"
  line 5, in script

```

Discussion:

Patch:
diff --git a/eppy/bunch_subclass.py b/eppy/bunch_subclass.py
index 012d7f3..a15ce60 100644
--- a/eppy/bunch_subclass.py
+++ b/eppy/bunch_subclass.py
@@ -34,7 +34,7 @@ class RangeError(ValueError):
 def almostequal(first, second, places=7, printit=True):
     """
     Test if two values are equal to a given number of places.
-    This is based on python's unittest so may be covered by Python's 
+    This is based on python's unittest so may be covered by Python's
     license.
 
     """
@@ -59,30 +59,30 @@ def extendlist(lst, i, value=''):
         pass
     else:
         lst.extend([value, ] * (i - len(lst) + 1))
-        
+
 
 
 def return42(self, *args, **kwargs):
     # proof of concept - to be removed
-    return 42        
+    return 42
 
 def addfunctions(abunch):
     """add functions to epbunch"""
 
     # proof of concept - remove
-    abunch['__functions'].update({'return42':return42}) 
-    abunch['__functions'].update({'buildingname':fh.buildingname}) 
+    abunch['__functions'].update({'return42':return42})
+    abunch['__functions'].update({'buildingname':fh.buildingname})
     # proof of concept
-    
+
     key = abunch.obj[0].upper()
-    
+
     #-----------------
     # TODO : alternate strategy to avoid listing the objkeys in snames
     # check if epbunch has field "Zone_Name" or "Building_Surface_Name"
     # and is in group u'Thermal Zones and Surfaces'
     # then it is likely to be a surface.
     # of course we need to recode for surfaces that do not have coordinates :-(
-    # or we can filter those out since they do not have 
+    # or we can filter those out since they do not have
     # the field "Number_of_Vertices"
     snames = [
         "BuildingSurface:Detailed",
@@ -129,8 +129,8 @@ def addfunctions(abunch):
         func_dict = {
             'rvalue': fh.rvalue,
             'ufactor': fh.ufactor,
-            'rvalue_ip': fh.rvalue_ip,# quick fix for Santosh. Needs to thought thru
-            'ufactor_ip': fh.ufactor_ip,# quick fix for Santosh. Needs to thought thru
+            'rvalue_ip': fh.rvalue_ip,  # quick fix for Santosh. Needs to thought thru
+            'ufactor_ip': fh.ufactor_ip,  # quick fix for Santosh. Needs to thought thru
             'heatcapacity': fh.heatcapacity,
         }
         abunch.__functions.update(func_dict)
@@ -146,13 +146,13 @@ def addfunctions(abunch):
     #-----------------
     # add function subsurfaces
     # going to cheat here a bit
-    # check if epbunch has field "Zone_Name" 
+    # check if epbunch has field "Zone_Name"
     # and is in group u'Thermal Zones and Surfaces'
     # then it is likely to be a surface attached to a zone
     fields = abunch.fieldnames
     try:
         group = abunch.getfieldidd('key')['group']
-    except KeyError as e: # some pytests don't have group
+    except KeyError as e:  # some pytests don't have group
         group = None
     if group == u'Thermal Zones and Surfaces':
         if "Zone_Name" in fields:
@@ -163,22 +163,22 @@ def addfunctions(abunch):
 
 class EpBunch(Bunch):
     """
-    Fields, values, and descriptions of fields in an EnergyPlus IDF object 
-    stored in a `bunch` which is a `dict` extended to allow access to dict 
+    Fields, values, and descriptions of fields in an EnergyPlus IDF object
+    stored in a `bunch` which is a `dict` extended to allow access to dict
     fields as attributes as well as by keys.
-    
+
     """
     def __init__(self, obj, objls, objidd, *args, **kwargs):
         super(EpBunch, self).__init__(*args, **kwargs)
-        self.obj = obj        # field names
-        self.objls = objls    # field values
+        self.obj = obj  # field names
+        self.objls = objls  # field values
         self.objidd = objidd  # field metadata (minimum, maximum, type, etc.)
-        self.theidf = None    # pointer to the idf this epbunch belongs to
-                              # This is None if there is no idf - a standalone epbunch      
+        self.theidf = None  # pointer to the idf this epbunch belongs to
+                              # This is None if there is no idf - a standalone epbunch
                               # This will be set by Idf_MSequence
-        self['__functions'] = {} # initialize the functions
+        self['__functions'] = {}  # initialize the functions
         addfunctions(self)
-        
+
     @property
     def fieldnames(self):
         """Friendly name for objls.
@@ -189,70 +189,70 @@ class EpBunch(Bunch):
     def fieldvalues(self):
         """Friendly name for obj.
         """
-        return self.obj    
-    
+        return self.obj
+
     def checkrange(self, fieldname):
         """Check if the value for a field is within the allowed range.
         """
         return checkrange(self, fieldname)
-    
+
     def getrange(self, fieldname):
         """Get the allowed range of values for a field.
         """
         return getrange(self, fieldname)
-        
+
     def getfieldidd(self, fieldname):
         """get the idd dict for this field
         Will return {} if the fieldname does not exist"""
         return getfieldidd(self, fieldname)
-        
+
     def getfieldidd_item(self, fieldname, iddkey):
         """return an item from the fieldidd, given the iddkey
         will return and empty list if it does not have the iddkey
         or if the fieldname does not exist"""
         return getfieldidd_item(self, fieldname, iddkey)
-        
+
     def get_retaincase(self, fieldname):
         """check if the field should retain case"""
         return get_retaincase(self, fieldname)
-        
+
     def isequal(self, fieldname, value, places=7):
         """return True if the field == value
         Will retain case if get_retaincase == True
         for real value will compare to decimal 'places'
         """
         return isequal(self, fieldname, value, places=places)
-        
+
     def getreferingobjs(self, iddgroups=None, fields=None):
         """Get a list of objects that refer to this object"""
-        return getreferingobjs(self, iddgroups=iddgroups, fields=fields) 
-        
+        return getreferingobjs(self, iddgroups=iddgroups, fields=fields)
+
     def get_referenced_object(self, fieldname):
         """
         Get an object referred to by a field in another object.
-        
+
         For example an object of type Construction has fields for each layer, each
-        of which refers to a Material. This functions allows the object 
+        of which refers to a Material. This functions allows the object
         representing a Material to be fetched using the name of the layer.
-        
+
         Returns the first item found since if there is more than one matching item,
         it is a malformed IDF.
-        
+
         Parameters
         ----------
         referring_object : EpBunch
             The object which contains a reference to another object,
         fieldname : str
-            The name of the field in the referring object which contains the 
+            The name of the field in the referring object which contains the
             reference to another object.
-            
+
         Returns
         -------
         EpBunch
-    
+
         """
         return get_referenced_object(self, fieldname)
-        
+
     def __setattr__(self, name, value):
         try:
             origname = self['__functions'][name]
@@ -280,9 +280,9 @@ class EpBunch(Bunch):
                 extendlist(self.fieldvalues, i)
                 self.fieldvalues[i] = value
         else:
-            astr = "unable to find field %s" % (name, )
+            astr = "unable to find field %s" % (name,)
             raise BadEPFieldError(astr)  # TODO: could raise AttributeError
-        
+
     def __getattr__(self, name):
         try:
             func = self['__functions'][name]
@@ -307,11 +307,11 @@ class EpBunch(Bunch):
             except IndexError:
                 return ''
         else:
-            astr = "unable to find field %s" % (name, )
+            astr = "unable to find field %s" % (name,)
             raise BadEPFieldError(astr)
-        
+
     def __getitem__(self, key):
-        if key in ('obj', 'objls', 'objidd', 
+        if key in ('obj', 'objls', 'objidd',
                 '__functions', '__aliases', 'theidf'):
             return super(EpBunch, self).__getitem__(key)
         elif key in self.fieldnames:
@@ -321,11 +321,11 @@ class EpBunch(Bunch):
             except IndexError:
                 return ''
         else:
-            astr = "unknown field %s" % (key, )
+            astr = "unknown field %s" % (key,)
             raise BadEPFieldError(astr)
-    
+
     def __setitem__(self, key, value):
-        if key in ('obj', 'objls', 'objidd', 
+        if key in ('obj', 'objls', 'objidd',
                 '__functions', '__aliases', 'theidf'):
             super(EpBunch, self).__setitem__(key, value)
             return None
@@ -337,25 +337,25 @@ class EpBunch(Bunch):
                 extendlist(self.fieldvalues, i)
                 self.fieldvalues[i] = value
         else:
-            astr = "unknown field %s" % (key, )
+            astr = "unknown field %s" % (key,)
             raise BadEPFieldError(astr)
 
     def __repr__(self):
         """print this as an idf snippet"""
         lines = [str(val) for val in self.obj]
         comments = [comm.replace('_', ' ') for comm in self.objls]
-        lines[0] = "%s," % (lines[0], ) # comma after first line
+        lines[0] = "%s," % (lines[0],)  # comma after first line
         for i, line in enumerate(lines[1:-1]):
-            lines[i + 1] = '    %s,' % (line, ) # indent and comma
-        lines[-1] = '    %s;' % (lines[-1], )# ';' after last line
-        lines = [line.ljust(26) for line in lines] # ljsut the lines
+            lines[i + 1] = '    %s,' % (line,)  # indent and comma
+        lines[-1] = '    %s;' % (lines[-1],)  # ';' after last line
+        lines = lines[:1] + [line.ljust(26) for line in lines[1:]]  # ljsut the lines
         filler = '%s    !- %s'
         nlines = [filler % (line, comm) for line,
-                  comm in zip(lines[1:], comments[1:])]# adds comments to line
-        nlines.insert(0, lines[0])# first line without comment
+                  comm in zip(lines[1:], comments[1:])]  # adds comments to line
+        nlines.insert(0, lines[0])  # first line without comment
         astr = '\n'.join(nlines)
-        return '\n%s\n' % (astr, )
-    
+        return '\n%s\n' % (astr,)
+
     def __str__(self):
         """same as __repr__"""
         # needed if YAML is installed. See issue 67
@@ -366,7 +366,7 @@ class EpBunch(Bunch):
         fnames = self.fieldnames
         func_names = self['__functions'].keys()
         return super(EpBunch, self).__dir__() + fnames + func_names
-    
+
 
 def getrange(bch, fieldname):
     """get the ranges for this field"""
@@ -417,7 +417,7 @@ def checkrange(bch, fieldname):
     return fieldvalue
     """get the idd dict for this field
     Will return {} if the fieldname does not exist"""
-    
+
 def getfieldidd(bch, fieldname):
     """get the idd dict for this field
     Will return {} if the fieldname does not exist"""
@@ -425,11 +425,11 @@ def getfieldidd(bch, fieldname):
     try:
         fieldindex = bch.objls.index(fieldname)
     except ValueError as e:
-        return {}   # the fieldname does not exist
+        return {}  # the fieldname does not exist
                     # so there is no idd
     fieldidd = bch.objidd[fieldindex]
     return fieldidd
-    
+
 def getfieldidd_item(bch, fieldname, iddkey):
     """return an item from the fieldidd, given the iddkey
     will return and empty list if it does not have the iddkey
@@ -439,14 +439,14 @@ def getfieldidd_item(bch, fieldname, iddkey):
         return fieldidd[iddkey]
     except KeyError as e:
         return []
-    
-    
+
+
 def get_retaincase(bch, fieldname):
     """Check if the field should retain case"""
     fieldidd = bch.getfieldidd(fieldname)
     return 'retaincase' in fieldidd
-    
-    
+
+
 def isequal(bch, fieldname, value, places=7):
     """return True if the field is equal to value"""
     def equalalphanumeric(bch, fieldname, value):
@@ -454,7 +454,7 @@ def isequal(bch, fieldname, value, places=7):
             return bch[fieldname] == value
         else:
             return bch[fieldname].upper() == value.upper()
-            
+
     fieldidd = bch.getfieldidd(fieldname)
     try:
         ftype = fieldidd['type'][0]
@@ -464,7 +464,7 @@ def isequal(bch, fieldname, value, places=7):
             return equalalphanumeric(bch, fieldname, value)
     except KeyError as e:
         return equalalphanumeric(bch, fieldname, value)
-    
+
 
 def getreferingobjs(referedobj, iddgroups=None, fields=None):
     """Get a list of objects that refer to this object"""
@@ -485,8 +485,8 @@ def getreferingobjs(referedobj, iddgroups=None, fields=None):
     referedidd = referedobj.getfieldidd("Name")
     references = referedidd['reference']
     idfobjs = idf.idfobjects.values()
-    idfobjs = list(itertools.chain.from_iterable(idfobjs)) # flatten list
-    if iddgroups: # optional filter
+    idfobjs = list(itertools.chain.from_iterable(idfobjs))  # flatten list
+    if iddgroups:  # optional filter
         idfobjs = [anobj for anobj in idfobjs
             if anobj.getfieldidd('key')['group'] in iddgroups]
     for anobj in idfobjs:
@@ -510,22 +510,22 @@ def getreferingobjs(referedobj, iddgroups=None, fields=None):
 def get_referenced_object(referring_object, fieldname):
     """
     Get an object referred to by a field in another object.
-    
+
     For example an object of type Construction has fields for each layer, each
-    of which refers to a Material. This functions allows the object 
+    of which refers to a Material. This functions allows the object
     representing a Material to be fetched using the name of the layer.
-    
+
     Returns the first item found since if there is more than one matching item,
     it is a malformed IDF.
-    
+
     Parameters
     ----------
     referring_object : EpBunch
         The object which contains a reference to another object,
     fieldname : str
-        The name of the field in the referring object which contains the 
+        The name of the field in the referring object which contains the
         reference to another object.
-        
+
     Returns
     -------
     EpBunch
@@ -540,6 +540,6 @@ def get_referenced_object(referring_object, fieldname):
                 referenced_obj_name = referring_object[fieldname]
                 if obj.Name == referenced_obj_name:
                     return obj
-            
 
-    
+
+
diff --git a/eppy/hvacbuilder.py b/eppy/hvacbuilder.py
index cea040b..eec8c6f 100644
--- a/eppy/hvacbuilder.py
+++ b/eppy/hvacbuilder.py
@@ -13,9 +13,8 @@ from __future__ import unicode_literals
 
 import copy
 
-from eppy.modeleditor import IDF
-
 import eppy.bunch_subclass as bunch_subclass
+from eppy.modeleditor import IDF
 import eppy.modeleditor as modeleditor
 from six.moves import xrange
 
@@ -57,43 +56,43 @@ def flattencopy(lst):
     # http://stackoverflow.com/questions/2158395/flatten-an-irregular-list-of-lists-in-python
     thelist = copy.deepcopy(lst)
     list_is_nested = True
-    while list_is_nested:                 #outer loop
+    while list_is_nested:  # outer loop
         keepchecking = False
         atemp = []
-        for element in thelist:         #inner loop
+        for element in thelist:  # inner loop
             if isinstance(element, list):
                 atemp.extend(element)
                 keepchecking = True
             else:
                 atemp.append(element)
-        list_is_nested = keepchecking     #determine if outer loop exits
+        list_is_nested = keepchecking  # determine if outer loop exits
         thelist = atemp[:]
     return thelist
 
 def makepipecomponent(idf, pname):
     """make a pipe component
     generate inlet outlet names"""
-    apipe = idf.newidfobject("Pipe:Adiabatic".upper(), pname)
-    apipe.Inlet_Node_Name = "%s_inlet" % (pname, )
-    apipe.Outlet_Node_Name = "%s_outlet" % (pname, )
+    apipe = idf.newidfobject("Pipe:Adiabatic".upper(), Name=pname)
+    apipe.Inlet_Node_Name = "%s_inlet" % (pname,)
+    apipe.Outlet_Node_Name = "%s_outlet" % (pname,)
     return apipe
 
 def makeductcomponent(idf, dname):
     """make a duct component
     generate inlet outlet names"""
-    aduct = idf.newidfobject("duct".upper(), dname)
-    aduct.Inlet_Node_Name = "%s_inlet" % (dname, )
-    aduct.Outlet_Node_Name = "%s_outlet" % (dname, )
+    aduct = idf.newidfobject("duct".upper(), Name=dname)
+    aduct.Inlet_Node_Name = "%s_inlet" % (dname,)
+    aduct.Outlet_Node_Name = "%s_outlet" % (dname,)
     return aduct
 
 def makepipebranch(idf, bname):
     """make a branch with a pipe
     use standard inlet outlet names"""
     # make the pipe component first
-    pname = "%s_pipe" % (bname, )
+    pname = "%s_pipe" % (bname,)
     apipe = makepipecomponent(idf, pname)
     # now make the branch with the pipe in it
-    abranch = idf.newidfobject("BRANCH", bname)
+    abranch = idf.newidfobject("BRANCH", Name=bname)
     abranch.Component_1_Object_Type = 'Pipe:Adiabatic'
     abranch.Component_1_Name = pname
     abranch.Component_1_Inlet_Node_Name = apipe.Inlet_Node_Name
@@ -105,10 +104,10 @@ def makeductbranch(idf, bname):
     """make a branch with a duct
     use standard inlet outlet names"""
     # make the duct component first
-    pname = "%s_duct" % (bname, )
+    pname = "%s_duct" % (bname,)
     aduct = makeductcomponent(idf, pname)
     # now make the branch with the duct in it
-    abranch = idf.newidfobject("BRANCH", bname)
+    abranch = idf.newidfobject("BRANCH", Name=bname)
     abranch.Component_1_Object_Type = 'duct'
     abranch.Component_1_Name = pname
     abranch.Component_1_Inlet_Node_Name = aduct.Inlet_Node_Name
@@ -123,10 +122,10 @@ def getbranchcomponents(idf, branch, utest=False):
     complist = []
     for i in range(1, 100000):
         try:
-            objtype = branch[fobjtype % (i, )]
+            objtype = branch[fobjtype % (i,)]
             if objtype.strip() == '':
                 break
-            objname = branch[fobjname % (i, )]
+            objname = branch[fobjname % (i,)]
             complist.append((objtype, objname))
         except bunch_subclass.BadEPFieldError:
             break
@@ -231,7 +230,7 @@ def initinletoutlet(idf, idfobject, thisnode, force=False):
                 return True
             else:
                 return False
-        except AttributeError: # field may be a list
+        except AttributeError:  # field may be a list
             return False
     def trimfields(fields, thisnode):
         if len(fields) > 1:
@@ -249,12 +248,12 @@ def initinletoutlet(idf, idfobject, thisnode, force=False):
             return fields
 
     inletfields = getfieldnamesendswith(idfobject, "Inlet_Node_Name")
-    inletfields = trimfields(inletfields, thisnode) # or warn with exception
+    inletfields = trimfields(inletfields, thisnode)  # or warn with exception
     for inletfield in inletfields:
         if blankfield(idfobject[inletfield]) == True or force == True:
             idfobject[inletfield] = "%s_%s" % (idfobject.Name, inletfield)
     outletfields = getfieldnamesendswith(idfobject, "Outlet_Node_Name")
-    outletfields = trimfields(outletfields, thisnode) # or warn with exception
+    outletfields = trimfields(outletfields, thisnode)  # or warn with exception
     for outletfield in outletfields:
         if blankfield(idfobject[outletfield]) == True or force == True:
             idfobject[outletfield] = "%s_%s" % (idfobject.Name, outletfield)
@@ -271,12 +270,12 @@ def componentsintobranch(idf, branch, listofcomponents, fluid=None):
     # assumes that the nodes of the component connect to each other
     # empty branch if it has existing components
     thebranchname = branch.Name
-    thebranch = idf.removeextensibles('BRANCH', thebranchname) # empty the branch
+    thebranch = idf.removeextensibles('BRANCH', thebranchname)  # empty the branch
     # fill in the new components with the node names into this branch
         # find the first extensible field and fill in the data in obj.
     e_index = idf.getextensibleindex('BRANCH', thebranchname)
     theobj = thebranch.obj
-    modeleditor.extendlist(theobj, e_index) # just being careful here
+    modeleditor.extendlist(theobj, e_index)  # just being careful here
     for comp, compnode in listofcomponents:
         theobj.append(comp.key)
         theobj.append(comp.Name)
@@ -308,7 +307,7 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
     # -------- testing ---------
     testn = 0
     # -------- testing ---------
-    newairloop = idf.newidfobject("AirLoopHVAC".upper(), loopname)
+    newairloop = idf.newidfobject("AirLoopHVAC".upper(), Name=loopname)
     # -------- testing ---------
     testn = doingtesting(testing, testn, newairloop)
     if testn == None:
@@ -340,7 +339,7 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
 
     # make the branch lists for this air loop
     sbranchlist = idf.newidfobject("BRANCHLIST",
-                                   newairloop[flnames[0]])
+                                   Name=newairloop[flnames[0]])
 
     # -------- testing ---------
     testn = doingtesting(testing, testn, newairloop)
@@ -369,10 +368,10 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
     # -------- testing ---------
     # rename inlet outlet of endpoints of loop
     anode = "Component_1_Inlet_Node_Name"
-    sameinnode = "Supply_Side_Inlet_Node_Name" # TODO : change ?
+    sameinnode = "Supply_Side_Inlet_Node_Name"  # TODO : change ?
     sbranchs[0][anode] = newairloop[sameinnode]
     anode = "Component_1_Outlet_Node_Name"
-    sameoutnode = "Supply_Side_Outlet_Node_Names" # TODO : change ?
+    sameoutnode = "Supply_Side_Outlet_Node_Names"  # TODO : change ?
     sbranchs[-1][anode] = newairloop[sameoutnode]
     # -------- testing ---------
     testn = doingtesting(testing, testn, newairloop)
@@ -380,11 +379,11 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
         returnnone()
     # -------- testing ---------
     # rename inlet outlet of endpoints of loop - rename in pipe
-    dname = sbranchs[0]['Component_1_Name'] # get the duct name
-    aduct = idf.getobject('duct'.upper(), dname) # get duct
+    dname = sbranchs[0]['Component_1_Name']  # get the duct name
+    aduct = idf.getobject('duct'.upper(), dname)  # get duct
     aduct.Inlet_Node_Name = newairloop[sameinnode]
-    dname = sbranchs[-1]['Component_1_Name'] # get the duct name
-    aduct = idf.getobject('duct'.upper(), dname) # get duct
+    dname = sbranchs[-1]['Component_1_Name']  # get the duct name
+    aduct = idf.getobject('duct'.upper(), dname)  # get duct
     aduct.Outlet_Node_Name = newairloop[sameoutnode]
     # -------- testing ---------
     testn = doingtesting(testing, testn, newairloop)
@@ -395,16 +394,16 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
     # # TODO : test if there are parallel branches
     # make the connectorlist an fill fields
     sconnlist = idf.newidfobject("CONNECTORLIST",
-                                 newairloop.Connector_List_Name)
+                                 Name=newairloop.Connector_List_Name)
     # -------- testing ---------
     testn = doingtesting(testing, testn, newairloop)
     if testn == None:
         returnnone()
     # -------- testing ---------
     sconnlist.Connector_1_Object_Type = "Connector:Splitter"
-    sconnlist.Connector_1_Name = "%s_supply_splitter" % (loopname, )
+    sconnlist.Connector_1_Name = "%s_supply_splitter" % (loopname,)
     sconnlist.Connector_2_Object_Type = "Connector:Mixer"
-    sconnlist.Connector_2_Name = "%s_supply_mixer" % (loopname, )
+    sconnlist.Connector_2_Name = "%s_supply_mixer" % (loopname,)
     # -------- testing ---------
     testn = doingtesting(testing, testn, newairloop)
     if testn == None:
@@ -412,10 +411,10 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
     # -------- testing ---------
     # make splitters and mixers
     s_splitter = idf.newidfobject("CONNECTOR:SPLITTER",
-                                  sconnlist.Connector_1_Name)
+                                  Name=sconnlist.Connector_1_Name)
     s_splitter.obj.extend([sloop[0]] + sloop[1])
     s_mixer = idf.newidfobject("CONNECTOR:MIXER",
-                               sconnlist.Connector_2_Name)
+                               Name=sconnlist.Connector_2_Name)
     s_mixer.obj.extend([sloop[-1]] + sloop[1])
     # -------- testing ---------
     testn = doingtesting(testing, testn, newairloop)
@@ -423,18 +422,18 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
         returnnone()
     # -------- testing ---------
     # demand side loop for airloop is made below
-    #ZoneHVAC:EquipmentConnections
+    # ZoneHVAC:EquipmentConnections
     for zone in dloop:
         equipconn = idf.newidfobject("ZoneHVAC:EquipmentConnections".upper())
         equipconn.Zone_Name = zone
         fldname = "Zone_Conditioning_Equipment_List_Name"
-        equipconn[fldname] = "%s equip list" % (zone, )
+        equipconn[fldname] = "%s equip list" % (zone,)
         fldname = "Zone_Air_Inlet_Node_or_NodeList_Name"
-        equipconn[fldname] = "%s Inlet Node" % (zone, )
+        equipconn[fldname] = "%s Inlet Node" % (zone,)
         fldname = "Zone_Air_Node_Name"
-        equipconn[fldname] = "%s Node" % (zone, )
+        equipconn[fldname] = "%s Node" % (zone,)
         fldname = "Zone_Return_Air_Node_Name"
-        equipconn[fldname] = "%s Outlet Node" % (zone, )
+        equipconn[fldname] = "%s Outlet Node" % (zone,)
     # -------- testing ---------
     testn = doingtesting(testing, testn, newairloop)
     if testn == None:
@@ -446,12 +445,12 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
         z_equipconn = modeleditor.getobjects(
             idf.idfobjects,
             idf.model, idf.idd_info,
-            "ZoneHVAC:EquipmentConnections".upper(), #places=7,
+            "ZoneHVAC:EquipmentConnections".upper(),  # places=7,
             **dict(Zone_Name=zone))[0]
         z_equiplst.Name = z_equipconn.Zone_Conditioning_Equipment_List_Name
         fld = "Zone_Equipment_1_Object_Type"
         z_equiplst[fld] = "AirTerminal:SingleDuct:Uncontrolled"
-        z_equiplst.Zone_Equipment_1_Name = "%sDirectAir" % (zone, )
+        z_equiplst.Zone_Equipment_1_Name = "%sDirectAir" % (zone,)
         z_equiplst.Zone_Equipment_1_Cooling_Sequence = 1
         z_equiplst.Zone_Equipment_1_Heating_or_NoLoad_Sequence = 1
     # -------- testing ---------
@@ -464,11 +463,11 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
         z_equipconn = modeleditor.getobjects(
             idf.idfobjects,
             idf.model, idf.idd_info,
-            "ZoneHVAC:EquipmentConnections".upper(), #places=7,
+            "ZoneHVAC:EquipmentConnections".upper(),  # places=7,
             **dict(Zone_Name=zone))[0]
         key = "AirTerminal:SingleDuct:Uncontrolled".upper()
         z_airterm = idf.newidfobject(key)
-        z_airterm.Name = "%sDirectAir" % (zone, )
+        z_airterm.Name = "%sDirectAir" % (zone,)
         fld1 = "Zone_Supply_Air_Node_Name"
         fld2 = "Zone_Air_Inlet_Node_or_NodeList_Name"
         z_airterm[fld1] = z_equipconn[fld2]
@@ -487,15 +486,15 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
     if testn == None:
         returnnone()
     # -------- testing ---------
-    z_splitter.Name = "%s Demand Side Splitter" % (loopname, )
+    z_splitter.Name = "%s Demand Side Splitter" % (loopname,)
     z_splitter.Inlet_Node_Name = newairloop.Demand_Side_Inlet_Node_Names
     for i, zone in enumerate(dloop):
         z_equipconn = modeleditor.getobjects(
             idf.idfobjects,
             idf.model, idf.idd_info,
-            "ZoneHVAC:EquipmentConnections".upper(), #places=7,
+            "ZoneHVAC:EquipmentConnections".upper(),  # places=7,
             **dict(Zone_Name=zone))[0]
-        fld = "Outlet_%s_Node_Name" % (i + 1, )
+        fld = "Outlet_%s_Node_Name" % (i + 1,)
         z_splitter[fld] = z_equipconn.Zone_Air_Inlet_Node_or_NodeList_Name
     # -------- testing ---------
     testn = doingtesting(testing, testn, newairloop)
@@ -505,7 +504,7 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
     # make AirLoopHVAC:SupplyPath
     key = "AirLoopHVAC:SupplyPath".upper()
     z_supplypth = idf.newidfobject(key)
-    z_supplypth.Name = "%sSupplyPath" % (loopname, )
+    z_supplypth.Name = "%sSupplyPath" % (loopname,)
     # -------- testing ---------
     testn = doingtesting(testing, testn, newairloop)
     if testn == None:
@@ -529,7 +528,7 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
     if testn == None:
         returnnone()
     # -------- testing ---------
-    z_mixer.Name = "%s Demand Side Mixer" % (loopname, )
+    z_mixer.Name = "%s Demand Side Mixer" % (loopname,)
     # -------- testing ---------
     testn = doingtesting(testing, testn, newairloop)
     if testn == None:
@@ -545,9 +544,9 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
         z_equipconn = modeleditor.getobjects(
             idf.idfobjects,
             idf.model, idf.idd_info,
-            "ZoneHVAC:EquipmentConnections".upper(), #places=7,
+            "ZoneHVAC:EquipmentConnections".upper(),  # places=7,
             **dict(Zone_Name=zone))[0]
-        fld = "Inlet_%s_Node_Name" % (i + 1, )
+        fld = "Inlet_%s_Node_Name" % (i + 1,)
         z_mixer[fld] = z_equipconn.Zone_Return_Air_Node_Name
     # -------- testing ---------
     testn = doingtesting(testing, testn, newairloop)
@@ -562,7 +561,7 @@ def makeairloop(idf, loopname, sloop, dloop, testing=None):
     if testn == None:
         returnnone()
     # -------- testing ---------
-    z_returnpth.Name = "%sReturnPath" % (loopname, )
+    z_returnpth.Name = "%sReturnPath" % (loopname,)
     z_returnpth.Return_Air_Path_Outlet_Node_Name = newairloop.Demand_Side_Outlet_Node_Name
     z_returnpth.Component_1_Object_Type = "AirLoopHVAC:ZoneMixer"
     z_returnpth.Component_1_Name = z_mixer.Name
@@ -578,7 +577,7 @@ def makeplantloop(idf, loopname, sloop, dloop, testing=None):
     # -------- <testing ---------
     testn = 0
     # -------- testing> ---------
-    newplantloop = idf.newidfobject("PLANTLOOP", loopname)
+    newplantloop = idf.newidfobject("PLANTLOOP", Name=loopname)
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newplantloop)
     if testn == None:
@@ -610,7 +609,7 @@ def makeplantloop(idf, loopname, sloop, dloop, testing=None):
     # make the branch lists for this plant loop
     sbranchlist = idf.newidfobject(
         "BRANCHLIST",
-        newplantloop.Plant_Side_Branch_List_Name)
+        Name=newplantloop.Plant_Side_Branch_List_Name)
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newplantloop)
     if testn == None:
@@ -618,7 +617,7 @@ def makeplantloop(idf, loopname, sloop, dloop, testing=None):
     # -------- testing> ---------
     dbranchlist = idf.newidfobject(
         "BRANCHLIST",
-        newplantloop.Demand_Side_Branch_List_Name)
+        Name=newplantloop.Demand_Side_Branch_List_Name)
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newplantloop)
     if testn == None:
@@ -669,11 +668,11 @@ def makeplantloop(idf, loopname, sloop, dloop, testing=None):
         returnnone()
     # -------- testing> ---------
     # rename inlet outlet of endpoints of loop - rename in pipe
-    pname = sbranchs[0]['Component_1_Name'] # get the pipe name
-    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname) # get pipe
+    pname = sbranchs[0]['Component_1_Name']  # get the pipe name
+    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname)  # get pipe
     apipe.Inlet_Node_Name = newplantloop[sameinnode]
-    pname = sbranchs[-1]['Component_1_Name'] # get the pipe name
-    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname) # get pipe
+    pname = sbranchs[-1]['Component_1_Name']  # get the pipe name
+    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname)  # get pipe
     apipe.Outlet_Node_Name = newplantloop[sameoutnode]
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newplantloop)
@@ -704,11 +703,11 @@ def makeplantloop(idf, loopname, sloop, dloop, testing=None):
         returnnone()
     # -------- testing> ---------
     # rename inlet outlet of endpoints of loop - rename in pipe
-    pname = dbranchs[0]['Component_1_Name'] # get the pipe name
-    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname) # get pipe
+    pname = dbranchs[0]['Component_1_Name']  # get the pipe name
+    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname)  # get pipe
     apipe.Inlet_Node_Name = newplantloop[sameinnode]
-    pname = dbranchs[-1]['Component_1_Name'] # get the pipe name
-    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname) # get pipe
+    pname = dbranchs[-1]['Component_1_Name']  # get the pipe name
+    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname)  # get pipe
     apipe.Outlet_Node_Name = newplantloop[sameoutnode]
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newplantloop)
@@ -721,18 +720,18 @@ def makeplantloop(idf, loopname, sloop, dloop, testing=None):
     # make the connectorlist an fill fields
     sconnlist = idf.newidfobject(
         "CONNECTORLIST",
-        newplantloop.Plant_Side_Connector_List_Name)
+        Name=newplantloop.Plant_Side_Connector_List_Name)
     sconnlist.Connector_1_Object_Type = "Connector:Splitter"
-    sconnlist.Connector_1_Name = "%s_supply_splitter" % (loopname, )
+    sconnlist.Connector_1_Name = "%s_supply_splitter" % (loopname,)
     sconnlist.Connector_2_Object_Type = "Connector:Mixer"
-    sconnlist.Connector_2_Name = "%s_supply_mixer" % (loopname, )
+    sconnlist.Connector_2_Name = "%s_supply_mixer" % (loopname,)
     dconnlist = idf.newidfobject(
         "CONNECTORLIST",
-        newplantloop.Demand_Side_Connector_List_Name)
+        Name=newplantloop.Demand_Side_Connector_List_Name)
     dconnlist.Connector_1_Object_Type = "Connector:Splitter"
-    dconnlist.Connector_1_Name = "%s_demand_splitter" % (loopname, )
+    dconnlist.Connector_1_Name = "%s_demand_splitter" % (loopname,)
     dconnlist.Connector_2_Object_Type = "Connector:Mixer"
-    dconnlist.Connector_2_Name = "%s_demand_mixer" % (loopname, )
+    dconnlist.Connector_2_Name = "%s_demand_mixer" % (loopname,)
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newplantloop)
     if testn == None:
@@ -742,20 +741,20 @@ def makeplantloop(idf, loopname, sloop, dloop, testing=None):
     # make splitters and mixers
     s_splitter = idf.newidfobject(
         "CONNECTOR:SPLITTER",
-        sconnlist.Connector_1_Name)
+        Name=sconnlist.Connector_1_Name)
     s_splitter.obj.extend([sloop[0]] + sloop[1])
     s_mixer = idf.newidfobject(
         "CONNECTOR:MIXER",
-        sconnlist.Connector_2_Name)
+        Name=sconnlist.Connector_2_Name)
     s_mixer.obj.extend([sloop[-1]] + sloop[1])
     # -
     d_splitter = idf.newidfobject(
         "CONNECTOR:SPLITTER",
-        dconnlist.Connector_1_Name)
+        Name=dconnlist.Connector_1_Name)
     d_splitter.obj.extend([dloop[0]] + dloop[1])
     d_mixer = idf.newidfobject(
         "CONNECTOR:MIXER",
-        dconnlist.Connector_2_Name)
+        Name=dconnlist.Connector_2_Name)
     d_mixer.obj.extend([dloop[-1]] + dloop[1])
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newplantloop)
@@ -770,7 +769,7 @@ def makecondenserloop(idf, loopname, sloop, dloop, testing=None):
     # -------- <testing ---------
     testn = 0
     # -------- testing> ---------
-    newcondenserloop = idf.newidfobject("CondenserLoop".upper(), loopname)
+    newcondenserloop = idf.newidfobject("CondenserLoop".upper(), Name=loopname)
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newcondenserloop)
     if testn == None:
@@ -805,10 +804,10 @@ def makecondenserloop(idf, loopname, sloop, dloop, testing=None):
     # make the branch lists for this condenser loop
     sbranchlist = idf.newidfobject(
         "BRANCHLIST",
-        newcondenserloop.Condenser_Side_Branch_List_Name)
+        Name=newcondenserloop.Condenser_Side_Branch_List_Name)
     dbranchlist = idf.newidfobject(
         "BRANCHLIST",
-        newcondenserloop.Condenser_Demand_Side_Branch_List_Name)
+        Name=newcondenserloop.Condenser_Demand_Side_Branch_List_Name)
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newcondenserloop)
     if testn == None:
@@ -844,10 +843,10 @@ def makecondenserloop(idf, loopname, sloop, dloop, testing=None):
     # -------- testing> ---------
     # rename inlet outlet of endpoints of loop
     anode = "Component_1_Inlet_Node_Name"
-    sameinnode = "Condenser_Side_Inlet_Node_Name" # TODO : change ?
+    sameinnode = "Condenser_Side_Inlet_Node_Name"  # TODO : change ?
     sbranchs[0][anode] = newcondenserloop[sameinnode]
     anode = "Component_1_Outlet_Node_Name"
-    sameoutnode = "Condenser_Side_Outlet_Node_Name" # TODO : change ?
+    sameoutnode = "Condenser_Side_Outlet_Node_Name"  # TODO : change ?
     sbranchs[-1][anode] = newcondenserloop[sameoutnode]
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newcondenserloop)
@@ -855,11 +854,11 @@ def makecondenserloop(idf, loopname, sloop, dloop, testing=None):
         returnnone()
     # -------- testing> ---------
     # rename inlet outlet of endpoints of loop - rename in pipe
-    pname = sbranchs[0]['Component_1_Name'] # get the pipe name
-    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname) # get pipe
+    pname = sbranchs[0]['Component_1_Name']  # get the pipe name
+    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname)  # get pipe
     apipe.Inlet_Node_Name = newcondenserloop[sameinnode]
-    pname = sbranchs[-1]['Component_1_Name'] # get the pipe name
-    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname) # get pipe
+    pname = sbranchs[-1]['Component_1_Name']  # get the pipe name
+    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname)  # get pipe
     apipe.Outlet_Node_Name = newcondenserloop[sameoutnode]
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newcondenserloop)
@@ -879,10 +878,10 @@ def makecondenserloop(idf, loopname, sloop, dloop, testing=None):
     # -------- testing> ---------
     # rename inlet outlet of endpoints of loop - rename in branch
     anode = "Component_1_Inlet_Node_Name"
-    sameinnode = "Demand_Side_Inlet_Node_Name" # TODO : change ?
+    sameinnode = "Demand_Side_Inlet_Node_Name"  # TODO : change ?
     dbranchs[0][anode] = newcondenserloop[sameinnode]
     anode = "Component_1_Outlet_Node_Name"
-    sameoutnode = "Demand_Side_Outlet_Node_Name" # TODO : change ?
+    sameoutnode = "Demand_Side_Outlet_Node_Name"  # TODO : change ?
     dbranchs[-1][anode] = newcondenserloop[sameoutnode]
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newcondenserloop)
@@ -890,11 +889,11 @@ def makecondenserloop(idf, loopname, sloop, dloop, testing=None):
         returnnone()
     # -------- testing> ---------
     # rename inlet outlet of endpoints of loop - rename in pipe
-    pname = dbranchs[0]['Component_1_Name'] # get the pipe name
-    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname) # get pipe
+    pname = dbranchs[0]['Component_1_Name']  # get the pipe name
+    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname)  # get pipe
     apipe.Inlet_Node_Name = newcondenserloop[sameinnode]
-    pname = dbranchs[-1]['Component_1_Name'] # get the pipe name
-    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname) # get pipe
+    pname = dbranchs[-1]['Component_1_Name']  # get the pipe name
+    apipe = idf.getobject('Pipe:Adiabatic'.upper(), pname)  # get pipe
     apipe.Outlet_Node_Name = newcondenserloop[sameoutnode]
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newcondenserloop)
@@ -907,11 +906,11 @@ def makecondenserloop(idf, loopname, sloop, dloop, testing=None):
     # make the connectorlist an fill fields
     sconnlist = idf.newidfobject(
         "CONNECTORLIST",
-        newcondenserloop.Condenser_Side_Connector_List_Name)
+        Name=newcondenserloop.Condenser_Side_Connector_List_Name)
     sconnlist.Connector_1_Object_Type = "Connector:Splitter"
-    sconnlist.Connector_1_Name = "%s_supply_splitter" % (loopname, )
+    sconnlist.Connector_1_Name = "%s_supply_splitter" % (loopname,)
     sconnlist.Connector_2_Object_Type = "Connector:Mixer"
-    sconnlist.Connector_2_Name = "%s_supply_mixer" % (loopname, )
+    sconnlist.Connector_2_Name = "%s_supply_mixer" % (loopname,)
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newcondenserloop)
     if testn == None:
@@ -919,11 +918,11 @@ def makecondenserloop(idf, loopname, sloop, dloop, testing=None):
     # -------- testing> ---------
     dconnlist = idf.newidfobject(
         "CONNECTORLIST",
-        newcondenserloop.Condenser_Demand_Side_Connector_List_Name)
+        Name=newcondenserloop.Condenser_Demand_Side_Connector_List_Name)
     dconnlist.Connector_1_Object_Type = "Connector:Splitter"
-    dconnlist.Connector_1_Name = "%s_demand_splitter" % (loopname, )
+    dconnlist.Connector_1_Name = "%s_demand_splitter" % (loopname,)
     dconnlist.Connector_2_Object_Type = "Connector:Mixer"
-    dconnlist.Connector_2_Name = "%s_demand_mixer" % (loopname, )
+    dconnlist.Connector_2_Name = "%s_demand_mixer" % (loopname,)
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newcondenserloop)
     if testn == None:
@@ -933,11 +932,11 @@ def makecondenserloop(idf, loopname, sloop, dloop, testing=None):
     # make splitters and mixers
     s_splitter = idf.newidfobject(
         "CONNECTOR:SPLITTER",
-        sconnlist.Connector_1_Name)
+        Name=sconnlist.Connector_1_Name)
     s_splitter.obj.extend([sloop[0]] + sloop[1])
     s_mixer = idf.newidfobject(
         "CONNECTOR:MIXER",
-        sconnlist.Connector_2_Name)
+        Name=sconnlist.Connector_2_Name)
     s_mixer.obj.extend([sloop[-1]] + sloop[1])
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newcondenserloop)
@@ -947,11 +946,11 @@ def makecondenserloop(idf, loopname, sloop, dloop, testing=None):
     # -
     d_splitter = idf.newidfobject(
         "CONNECTOR:SPLITTER",
-        dconnlist.Connector_1_Name)
+        Name=dconnlist.Connector_1_Name)
     d_splitter.obj.extend([dloop[0]] + dloop[1])
     d_mixer = idf.newidfobject(
         "CONNECTOR:MIXER",
-        dconnlist.Connector_2_Name)
+        Name=dconnlist.Connector_2_Name)
     d_mixer.obj.extend([dloop[-1]] + dloop[1])
     # -------- <testing ---------
     testn = doingtesting(testing, testn, newcondenserloop)
@@ -984,7 +983,7 @@ def getmakeidfobject(idf, key, name):
     """get idfobject or make it if it does not exist"""
     idfobject = idf.getobject(key, name)
     if not idfobject:
-        return idf.newidfobject(key, name)
+        return idf.newidfobject(key, Name=name)
     else:
         return idfobject
 
@@ -994,7 +993,7 @@ def replacebranch1(idf, loop, branchname, listofcomponents_tuples, fluid=None,
     if fluid is None:
         fluid = ''
     listofcomponents_tuples = _clean_listofcomponents_tuples(listofcomponents_tuples)
-    branch = idf.getobject('BRANCH', branchname) # args are (key, name)
+    branch = idf.getobject('BRANCH', branchname)  # args are (key, name)
     listofcomponents = []
     for comp_type, comp_name, compnode in listofcomponents_tuples:
         comp = getmakeidfobject(idf, comp_type.upper(), comp_name)
@@ -1069,17 +1068,17 @@ def replacebranch(idf, loop, branch,
         supplyconlistname = loop[flnames[3]]
         # Plant_Side_Connector_List_Name or Condenser_Side_Connector_List_Name
     elif fluid.upper() == 'AIR':
-        supplyconlistname = loop[flnames[1]] # Connector_List_Name'
+        supplyconlistname = loop[flnames[1]]  # Connector_List_Name'
     supplyconlist = idf.getobject('CONNECTORLIST', supplyconlistname)
-    for i in range(1, 100000): # large range to hit end
+    for i in range(1, 100000):  # large range to hit end
         try:
-            fieldname = 'Connector_%s_Object_Type' % (i, )
+            fieldname = 'Connector_%s_Object_Type' % (i,)
             ctype = supplyconlist[fieldname]
         except bunch_subclass.BadEPFieldError:
             break
         if ctype.strip() == '':
             break
-        fieldname = 'Connector_%s_Name' % (i, )
+        fieldname = 'Connector_%s_Name' % (i,)
         cname = supplyconlist[fieldname]
         connector = idf.getobject(ctype.upper(), cname)
         if connector.key == 'CONNECTOR:SPLITTER':
@@ -1100,7 +1099,7 @@ def replacebranch(idf, loop, branch,
                     "Inlet_Node_Name", fluid)
                 comp[inletnodename] = [
                     comp[inletnodename],
-                    loop[flnames[0]]] # Plant_Side_Inlet_Node_Name
+                    loop[flnames[0]]]  # Plant_Side_Inlet_Node_Name
             else:
                 comp = comps[-1]
                 outletnodename = getnodefieldname(
@@ -1108,7 +1107,7 @@ def replacebranch(idf, loop, branch,
                     "Outlet_Node_Name", fluid)
                 comp[outletnodename] = [
                     comp[outletnodename],
-                    loop[flnames[1]]] # .Plant_Side_Outlet_Node_Name
+                    loop[flnames[1]]]  # .Plant_Side_Outlet_Node_Name
     # -------- testing ---------
     testn = doingtesting(testing, testn)
     if testn == None:
@@ -1116,17 +1115,17 @@ def replacebranch(idf, loop, branch,
     # -------- testing ---------
 
     if fluid.upper() == 'WATER':
-        demandconlistname = loop[flnames[7]] # .Demand_Side_Connector_List_Name
+        demandconlistname = loop[flnames[7]]  # .Demand_Side_Connector_List_Name
         demandconlist = idf.getobject('CONNECTORLIST', demandconlistname)
-        for i in range(1, 100000): # large range to hit end
+        for i in range(1, 100000):  # large range to hit end
             try:
-                fieldname = 'Connector_%s_Object_Type' % (i, )
+                fieldname = 'Connector_%s_Object_Type' % (i,)
                 ctype = demandconlist[fieldname]
             except bunch_subclass.BadEPFieldError:
                 break
             if ctype.strip() == '':
                 break
-            fieldname = 'Connector_%s_Name' % (i, )
+            fieldname = 'Connector_%s_Name' % (i,)
             cname = demandconlist[fieldname]
             connector = idf.getobject(ctype.upper(), cname)
             if connector.key == 'CONNECTOR:SPLITTER':
@@ -1147,7 +1146,7 @@ def replacebranch(idf, loop, branch,
                         "Inlet_Node_Name", fluid)
                     comp[inletnodename] = [
                         comp[inletnodename],
-                        loop[flnames[4]]] #.Demand_Side_Inlet_Node_Name
+                        loop[flnames[4]]]  # .Demand_Side_Inlet_Node_Name
                 if not isfirst:
                     comp = comps[-1]
                     outletnodename = getnodefieldname(
@@ -1155,7 +1154,7 @@ def replacebranch(idf, loop, branch,
                         "Outlet_Node_Name", fluid)
                     comp[outletnodename] = [
                         comp[outletnodename],
-                        loop[flnames[5]]] # .Demand_Side_Outlet_Node_Name
+                        loop[flnames[5]]]  # .Demand_Side_Outlet_Node_Name
 
     # -------- testing ---------
     testn = doingtesting(testing, testn)
diff --git a/eppy/modeleditor.py b/eppy/modeleditor.py
index d3bebb9..d848a53 100644
--- a/eppy/modeleditor.py
+++ b/eppy/modeleditor.py
@@ -1,4 +1,5 @@
 # Copyright (c) 2012 Santosh Philip
+# Copyright (c) 2016 Jamie Bull
 # =======================================================================
 #  Distributed under the MIT License.
 #  (See accompanying file LICENSE or copy at
@@ -15,16 +16,16 @@ import copy
 import itertools
 import os
 import platform
+import warnings
 
-from eppy.iddcurrent import iddcurrent
-from eppy.idfreader import idfreader1
-from eppy.idfreader import makeabunch
-from py._log import warning
 from six import StringIO
 from six import iteritems
 
 import eppy.EPlusInterfaceFunctions.iddgroups as iddgroups
 import eppy.function_helpers as function_helpers
+from eppy.iddcurrent import iddcurrent
+from eppy.idfreader import idfreader1
+from eppy.idfreader import makeabunch
 from eppy.runner.run_functions import run
 from eppy.runner.run_functions import wrapped_help_text
 
@@ -56,7 +57,7 @@ class IDDAlreadySetError(Exception):
 def almostequal(first, second, places=7, printit=True):
     """
     Test if two values are equal to a given number of places.
-    This is based on python's unittest so may be covered by Python's 
+    This is based on python's unittest so may be covered by Python's
     license.
 
     """
@@ -500,13 +501,13 @@ def refname2key(idf, refname):
 class IDF(object):
 
     """
-    The IDF class holds all the information about an EnergyPlus IDF. 
+    The IDF class holds all the information about an EnergyPlus IDF.
 
     Class attributes
     ---------------
     iddname : str
         Name of the IDD currently being used by eppy. As a class attribute, this
-        is set for all IDFs which are currently being processed and cannot be 
+        is set for all IDFs which are currently being processed and cannot be
         changed for an individual IDF.
     iddinfo : list
         Comments and metadata about fields in the IDD.
@@ -577,7 +578,7 @@ class IDF(object):
             pass
         else:
             if testing == False:
-                errortxt = "IDD file is set to: %s" % (cls.iddname, )
+                errortxt = "IDD file is set to: %s" % (cls.iddname,)
                 raise IDDAlreadySetError(errortxt)
 
     @classmethod
@@ -723,11 +724,11 @@ class IDF(object):
         key : str
             The type of IDF object. This must be in ALL_CAPS.
         aname : str, deprecated
-            This parameter is not used. It is left there for backward 
+            This parameter is not used. It is left there for backward
             compatibility.
         **kwargs
             Keyword arguments in the format `field=value` used to set the value
-            of fields in the IDF object when it is created. 
+            of fields in the IDF object when it is created.
 
         Returns
         -------
@@ -737,7 +738,7 @@ class IDF(object):
         obj = newrawobject(self.model, self.idd_info, key)
         abunch = obj2bunch(self.model, self.idd_info, obj)
         if aname:
-            warning.warn("The aname parameter should no longer be used.")
+            warnings.warn("The aname parameter should no longer be used.")
             namebunch(abunch, aname)
         self.idfobjects[key].append(abunch)
         for k, v in list(kwargs.items()):
@@ -895,7 +896,7 @@ class IDF(object):
         return astr
 
     def save(self, filename=None, lineendings='default', encoding='latin-1'):
-        """ 
+        """
         Save the IDF as a text file with the optional filename passed, or with
         the current idfname of the IDF.
 
@@ -982,7 +983,7 @@ class IDF(object):
 
         """
         self.save(filename, lineendings, encoding)
-        
+
     @wrapped_help_text(run)
     def run(self, **kwargs):
         """
@@ -1001,7 +1002,7 @@ class IDF(object):
         run('in.idf', self.epw, **kwargs)
         # remove in.idf
         os.remove('in.idf')
-                
+
     def getiddgroupdict(self):
         """Return a idd group dictionary
         sample: {'Plant-Condenser Loops': ['PlantLoop', 'CondenserLoop'],
@@ -1009,11 +1010,11 @@ class IDF(object):
          ['Controller:WaterCoil',
           'Controller:OutdoorAir',
           'Controller:MechanicalVentilation',
-          'AirLoopHVAC:ControllerList'], 
+          'AirLoopHVAC:ControllerList'],
         ...}
-        
+
         Returns
         -------
-        dict 
+        dict
         """
         return iddgroups.commdct2grouplist(self.idd_info)
diff --git a/eppy/runner/run_functions.py b/eppy/runner/run_functions.py
index a051330..6fba22c 100644
--- a/eppy/runner/run_functions.py
+++ b/eppy/runner/run_functions.py
@@ -20,7 +20,10 @@ from subprocess import CalledProcessError
 from subprocess import check_call
 import tempfile
 
-import multiprocessing as mp
+try:
+    import multiprocessing as mp
+except ImportError:
+    pass
 
 try:
     VERSION = os.environ["ENERGYPLUS_INSTALL_VERSION"]  # used in CI files
@@ -89,10 +92,14 @@ def runIDFs(jobs_list, processors=1):
         idf.saveas(idf_path)
         processed_runs.append([[idf_path, epw], kwargs])
 
-    pool = mp.Pool(processors)
-    pool.map(multirunner, processed_runs)
-    pool.close()
-
+    try:
+        pool = mp.Pool(processors)
+        pool.map(multirunner, processed_runs)
+        pool.close()
+    except NameError:
+        # multiprocessing not present so pass the jobs one at a time
+        for job in processed_runs:
+            multirunner([job])
     shutil.rmtree("multi_runs", ignore_errors=True)
 
 


Test patch:
diff --git a/eppy/tests/test_bunch_subclass.py b/eppy/tests/test_bunch_subclass.py
index bcfd7c9..df6faf4 100644
--- a/eppy/tests/test_bunch_subclass.py
+++ b/eppy/tests/test_bunch_subclass.py
@@ -11,21 +11,20 @@ from __future__ import division
 from __future__ import print_function
 from __future__ import unicode_literals
 
-# This test is ugly because I have to send file names and not able to send file handles
-
 import pytest
 from six import StringIO
 
-
 from eppy.EPlusInterfaceFunctions import readidf
-import eppy.bunchhelpers as bunchhelpers
 import eppy.bunch_subclass as bunch_subclass
+import eppy.bunchhelpers as bunchhelpers
+from eppy.iddcurrent import iddcurrent
+import eppy.idfreader as idfreader
 from eppy.modeleditor import IDF
 
 
+# This test is ugly because I have to send file names and not able to send file handles
 EpBunch = bunch_subclass.EpBunch
 
-from eppy.iddcurrent import iddcurrent
 iddtxt = iddcurrent.iddtxt
 
 # idd is read only once in this test
@@ -388,7 +387,7 @@ def test_EpBunch():
 
     iddfile = StringIO(iddtxt)
     fname = StringIO(idftxt)
-    block, data, commdct, idd_index = readidf.readdatacommdct1(fname, 
+    block, data, commdct, idd_index = readidf.readdatacommdct1(fname,
                 iddfile=iddfile)
 
     # setup code walls - can be generic for any object
@@ -516,10 +515,10 @@ def test_EpBunch():
 def test_extendlist():
     """py.test for extendlist"""
     data = (
-        ([1, 2, 3], 2, 0, [1, 2, 3]), # lst, i, value, nlst
-        ([1, 2, 3], 3, 0, [1, 2, 3, 0]), # lst, i, value, nlst
-        ([1, 2, 3], 5, 0, [1, 2, 3, 0, 0, 0]), # lst, i, value, nlst
-        ([1, 2, 3], 7, 0, [1, 2, 3, 0, 0, 0, 0, 0]), # lst, i, value, nlst
+        ([1, 2, 3], 2, 0, [1, 2, 3]),  # lst, i, value, nlst
+        ([1, 2, 3], 3, 0, [1, 2, 3, 0]),  # lst, i, value, nlst
+        ([1, 2, 3], 5, 0, [1, 2, 3, 0, 0, 0]),  # lst, i, value, nlst
+        ([1, 2, 3], 7, 0, [1, 2, 3, 0, 0, 0, 0, 0]),  # lst, i, value, nlst
     )
     for lst, i, value, nlst in data:
         bunch_subclass.extendlist(lst, i, value=value)
@@ -529,7 +528,7 @@ class TestEpBunch(object):
     """
     py.test for EpBunch.getrange, EpBunch.checkrange, EpBunch.fieldnames,
     EpBunch.fieldvalues, EpBunch.getidd.
-    
+
     """
     def initdata(self):
         obj, objls, objidd = (
@@ -542,7 +541,7 @@ class TestEpBunch(object):
                 0.4,
                 'FullExterior',
                 25,
-                6], #obj
+                6],  # obj
 
             [
                 'key',
@@ -592,29 +591,29 @@ class TestEpBunch(object):
                     'type': ['real']},
                 ])
         return obj, objls, objidd
-    
+
     def test_fieldnames(self):
         """
         Test that the contents of idfobject.fieldnames are the same as those
         of objls.
-        
+
         """
         obj, objls, objidd = self.initdata()
         idfobject = EpBunch(obj, objls, objidd)
         for fn_item, objls_item in zip(idfobject.fieldnames, idfobject.objls):
             assert fn_item == objls_item
-        
+
     def test_fieldvalues(self):
         """
         Test that the contents of idfobject.fieldvalues are the same as those
         of obj.
-        
+
         """
         obj, objls, objidd = self.initdata()
         idfobject = EpBunch(obj, objls, objidd)
         for fv_item, objls_item in zip(idfobject.fieldvalues, idfobject.obj):
             assert fv_item == objls_item
-    
+
 
     def test_getrange(self):
         data = (
@@ -622,12 +621,12 @@ class TestEpBunch(object):
                 "Loads_Convergence_Tolerance_Value",
                 {
                     'maximum': .5, 'minimum>': 0.0, 'maximum<':None,
-                    'minimum':None, 'type': 'real'},), # fieldname, theranges
+                    'minimum':None, 'type': 'real'},),  # fieldname, theranges
             (
                 "Maximum_Number_of_Warmup_Days",
                 {
-                    'maximum': None, 'minimum>': -3, 'maximum<':5,
-                    'minimum':None, 'type': 'integer'},), # fieldname, theranges
+                    'maximum': None, 'minimum>':-3, 'maximum<':5,
+                    'minimum':None, 'type': 'integer'},),  # fieldname, theranges
         )
         obj, objls, objidd = self.initdata()
         idfobject = EpBunch(obj, objls, objidd)
@@ -647,10 +646,10 @@ class TestEpBunch(object):
              5, False, None),
             # fieldname, fieldvalue, isexception, theexception
             ("Minimum_Number_of_Warmup_Days",
-             -3, False, None),
+             - 3, False, None),
             # fieldname, fieldvalue, isexception, theexception
             ("Minimum_Number_of_Warmup_Days",
-             -4, True, bunch_subclass.RangeError),
+             - 4, True, bunch_subclass.RangeError),
             # fieldname, fieldvalue, isexception, theexception
             # -
             ("Maximum_Number_of_Warmup_Days",
@@ -660,7 +659,7 @@ class TestEpBunch(object):
              5, True, bunch_subclass.RangeError),
             # fieldname, fieldvalue, isexception, theexception
             ("Maximum_Number_of_Warmup_Days",
-             -3, True, bunch_subclass.RangeError),
+             - 3, True, bunch_subclass.RangeError),
             # fieldname, fieldvalue, isexception, theexception
             ("Loads_Convergence_Tolerance_Value",
              0.3, False, bunch_subclass.RangeError),
@@ -698,7 +697,7 @@ class TestEpBunch(object):
         assert result == {'type': ['real']}
         result = idfobject.getfieldidd('No_such_field')
         assert result == {}
-        
+
     def test_getfieldidd_item(self):
         """py.test for test_getfieldidd_item"""
         obj, objls, objidd = self.initdata()
@@ -709,7 +708,7 @@ class TestEpBunch(object):
         assert result == []
         result = idfobject.getfieldidd_item('no_such_field', 'type')
         assert result == []
-        
+
     def test_get_retaincase(self):
         """py.test for get_retaincase"""
         obj, objls, objidd = self.initdata()
@@ -718,7 +717,7 @@ class TestEpBunch(object):
         assert result == True
         result = idfobject.get_retaincase('Terrain')
         assert result == False
-        
+
     def test_isequal(self):
         """py.test for isequal"""
         obj, objls, objidd = self.initdata()
@@ -752,7 +751,7 @@ class TestEpBunch(object):
         assert result == True
         result = idfobject.isequal('Maximum_Number_of_Warmup_Days', 25.00001)
         assert result == False
-        
+
     def test_getreferingobjs(self):
         """py.test for getreferingobjs"""
         thedata = ((
@@ -779,15 +778,15 @@ class TestEpBunch(object):
         5.000000000000,  !- Vertex 1 X-coordinate {m}
         6.000000000000,  !- Vertex 1 Y-coordinate {m}
         3.000000000000;  !- Vertex 1 Z-coordinate {m}
-    
-      WALL:EXTERIOR,            
+
+      WALL:EXTERIOR,
           WallExterior,                    !- Name
           ,                         !- Construction Name
           Box,                         !- Zone Name
           ,                         !- Azimuth Angle
           90;                       !- Tilt Angle
 
-        BUILDINGSURFACE:DETAILED, 
+        BUILDINGSURFACE:DETAILED,
             EWall,                    !- Name
             ,                         !- Surface Type
             ,                         !- Construction Name
@@ -799,7 +798,7 @@ class TestEpBunch(object):
             autocalculate,            !- View Factor to Ground
             autocalculate;            !- Number of Vertices
 
-        BUILDINGSURFACE:DETAILED, 
+        BUILDINGSURFACE:DETAILED,
             EWall1,                    !- Name
             ,                         !- Surface Type
             ,                         !- Construction Name
@@ -830,7 +829,7 @@ class TestEpBunch(object):
         autocalculate;            !- Number of Vertices
       """,
         'Box',
-        ['N_Wall', 'EWall', 'WallExterior']), # idftxt, zname, surfnamelst
+        ['N_Wall', 'EWall', 'WallExterior']),  # idftxt, zname, surfnamelst
         )
         for idftxt, zname, surfnamelst in thedata:
             # import pdb; pdb.set_trace()
@@ -854,7 +853,7 @@ class TestEpBunch(object):
         for idftxt, zname, surfnamelst in thedata:
             idf = IDF(StringIO(idftxt))
             zone = idf.getobject('zone'.upper(), zname)
-            kwargs = {'fields':[u'Zone_Name', ],}
+            kwargs = {'fields':[u'Zone_Name', ], }
             result = zone.getreferingobjs(**kwargs)
             rnames = [item.Name for item in result]
             rnames.sort()
@@ -883,41 +882,41 @@ class TestEpBunch(object):
             rnames.sort()
             surfnamelst.sort()
             assert rnames == windownamelist
-        
+
     def test_get_referenced_object(self):
         """py.test for get_referenced_object"""
         idf = IDF()
         idf.initnew('test.idf')
-        idf.newidfobject('VERSION') # does not have a field "Name"
+        idf.newidfobject('VERSION')  # does not have a field "Name"
 
-        # construction material        
-        construction = idf.newidfobject('CONSTRUCTION', 'construction')
+        # construction material
+        construction = idf.newidfobject('CONSTRUCTION', Name='construction')
         construction.Outside_Layer = 'TestMaterial'
-        
-        expected = idf.newidfobject('MATERIAL', 'TestMaterial')
-        
+
+        expected = idf.newidfobject('MATERIAL', Name='TestMaterial')
+
         fetched = idf.getobject('MATERIAL', 'TestMaterial')
         assert fetched == expected
-    
+
         material = construction.get_referenced_object('Outside_Layer')
         assert material == expected
-        
+
         # window material
         glazing_group = idf.newidfobject(
-            'WINDOWMATERIAL:GLAZINGGROUP:THERMOCHROMIC', 'glazing_group')
+            'WINDOWMATERIAL:GLAZINGGROUP:THERMOCHROMIC', Name='glazing_group')
         glazing_group.Window_Material_Glazing_Name_1 = 'TestWindowMaterial'
 
         expected = idf.newidfobject(
-            'WINDOWMATERIAL:GLAZING', 'TestWindowMaterial') # has several \references
-        
+            'WINDOWMATERIAL:GLAZING', Name='TestWindowMaterial')  # has several \references
+
         fetched = idf.getobject('WINDOWMATERIAL:GLAZING', 'TestWindowMaterial')
         assert fetched == expected
-        
+
         material = glazing_group.get_referenced_object(
             'Window_Material_Glazing_Name_1')
         assert material == expected
-    
-    
+
+
 bldfidf = """
 Version,
     6.0;
@@ -950,13 +949,12 @@ BuildingSurface:Detailed,
 """
 # test_EpBunch1()
 # import idfreader
-import eppy.idfreader as idfreader
 
 def test_EpBunch1():
     """py.test for EpBunch1"""
     iddfile = StringIO(iddtxt)
     idffile = StringIO(bldfidf)
-    block, data, commdct, idd_index = readidf.readdatacommdct1(idffile, 
+    block, data, commdct, idd_index = readidf.readdatacommdct1(idffile,
             iddfile=iddfile)
     key = "BUILDING"
     objs = data.dt[key]
@@ -970,7 +968,7 @@ def test_EpBunch1():
     assert bunchobj.Name == "Kutub Minar"
     prnt = bunchobj.__repr__()
     result = """
-BUILDING,                 
+BUILDING,
     Kutub Minar,              !- Name
     30.0,                     !- North Axis
     City,                     !- Terrain
diff --git a/eppy/tests/test_hvacbuilder.py b/eppy/tests/test_hvacbuilder.py
index f4c71d8..82fa39f 100644
--- a/eppy/tests/test_hvacbuilder.py
+++ b/eppy/tests/test_hvacbuilder.py
@@ -11,13 +11,15 @@ from __future__ import division
 from __future__ import print_function
 from __future__ import unicode_literals
 
+from six import StringIO
+
 import eppy.hvacbuilder as hvacbuilder
+from eppy.iddcurrent import iddcurrent
 from eppy.modeleditor import IDF
-from six import StringIO
+
 
 # idd is read only once in this test
 # if it has already been read from some other test, it will continue with the old reading
-from eppy.iddcurrent import iddcurrent
 iddfhandle = StringIO(iddcurrent.iddtxt)
 if IDF.getiddname() == None:
     IDF.setiddname(iddfhandle)
@@ -26,11 +28,11 @@ if IDF.getiddname() == None:
 def test_flattencopy():
     """py.test for flattencopy"""
     tdata = (
-        ([1, 2], [1, 2]), #lst , nlst
-        ([1, 2, [3, 4]], [1, 2, 3, 4]), #lst , nlst
-        ([1, 2, [3, [4, 5, 6], 7, 8]], [1, 2, 3, 4, 5, 6, 7, 8]), #lst , nlst
+        ([1, 2], [1, 2]),  # lst , nlst
+        ([1, 2, [3, 4]], [1, 2, 3, 4]),  # lst , nlst
+        ([1, 2, [3, [4, 5, 6], 7, 8]], [1, 2, 3, 4, 5, 6, 7, 8]),  # lst , nlst
         ([1, 2, [3, [4, 5, [6, 7], 8], 9]], [1, 2, 3, 4, 5, 6, 7, 8, 9]),
-        #lst , nlst
+        # lst , nlst
     )
     for lst, nlst in tdata:
         result = hvacbuilder.flattencopy(lst)
@@ -82,7 +84,7 @@ def test_makeplantloop():
         p_loop Supply Connectors, p_loop Demand Inlet, p_loop Demand Outlet,
         p_loop Demand Branchs, p_loop Demand Connectors, Sequential, ,
         SingleSetpoint, None, None;"""
-    ), # blankidf, loopname, sloop, dloop, nidf
+    ),  # blankidf, loopname, sloop, dloop, nidf
             )
     for blankidf, loopname, sloop, dloop, nidf in tdata:
         fhandle = StringIO("")
@@ -142,7 +144,7 @@ def test_makecondenserloop():
         c_loop Cond_Supply Connectors, c_loop Demand Inlet,
         c_loop Demand Outlet, c_loop Condenser Demand Branchs,
         c_loop Condenser Demand Connectors, Sequential, None;  """
-        ), # blankidf, loopname, sloop, dloop, nidf
+        ),  # blankidf, loopname, sloop, dloop, nidf
             )
     for blankidf, loopname, sloop, dloop, nidf in tdata:
 
@@ -178,7 +180,7 @@ def test_getbranchcomponents():
             [
                 ('PIPE:ADIABATIC', 'np1'),
                 ('PIPE:ADIABATIC', 'np2')
-            ]), # idftxt, utest, componentlist
+            ]),  # idftxt, utest, componentlist
         (
             """BRANCH,
             sb1,
@@ -260,7 +262,7 @@ def test_renamenodes():
     fhandle = StringIO(idftxt)
     idf = IDF(fhandle)
     pipe = idf.idfobjects['PIPE:ADIABATIC'][0]
-    pipe.Outlet_Node_Name = ['np1_outlet', 'np1_np2_node'] # this is the first step of the replace
+    pipe.Outlet_Node_Name = ['np1_outlet', 'np1_np2_node']  # this is the first step of the replace
     hvacbuilder.renamenodes(idf, fieldtype='node')
     outidf = IDF(StringIO(outtxt))
     result = idf.idfobjects['PIPE:ADIABATIC'][0].obj
@@ -276,17 +278,17 @@ def test_getfieldnamesendswith():
     """
     tdata = (
         ("Inlet_Node_Name", ["Inlet_Node_Name"]
-        ), # endswith, fieldnames
+        ),  # endswith, fieldnames
         (
             "Node_Name",
             ["Inlet_Node_Name",
-             "Outlet_Node_Name"]), # endswith, fieldnames
+             "Outlet_Node_Name"]),  # endswith, fieldnames
         (
             "Name",
             [
                 "Name",
                 "Inlet_Node_Name",
-                "Outlet_Node_Name"]), # endswith, fieldnames
+                "Outlet_Node_Name"]),  # endswith, fieldnames
     )
     fhandle = StringIO(idftxt)
     idf = IDF(fhandle)
@@ -316,7 +318,7 @@ def test_getnodefieldname():
     for objtype, objname, endswith, fluid, nodefieldname in tdata:
         fhandle = StringIO("")
         idf = IDF(fhandle)
-        idfobject = idf.newidfobject(objtype, objname)
+        idfobject = idf.newidfobject(objtype, Name=objname)
         result = hvacbuilder.getnodefieldname(idfobject, endswith, fluid)
         assert result == nodefieldname
 
@@ -327,8 +329,8 @@ def test_connectcomponents():
 
     tdata = (
         (
-            [(idf.newidfobject("PIPE:ADIABATIC", "pipe1"), None),
-             (idf.newidfobject("PIPE:ADIABATIC", "pipe2"), None)],
+            [(idf.newidfobject("PIPE:ADIABATIC", Name="pipe1"), None),
+             (idf.newidfobject("PIPE:ADIABATIC", Name="pipe2"), None)],
             ["pipe1_Inlet_Node_Name", ["pipe2_Inlet_Node_Name",
                                        "pipe1_pipe2_node"]],
             [["pipe1_Outlet_Node_Name", "pipe1_pipe2_node"],
@@ -336,9 +338,9 @@ def test_connectcomponents():
         ),
         # components_thisnodes, inlets, outlets, fluid
         (
-            [(idf.newidfobject("Coil:Cooling:Water".upper(), "pipe1"),
+            [(idf.newidfobject("Coil:Cooling:Water".upper(), Name="pipe1"),
               'Water_'),
-             (idf.newidfobject("Coil:Cooling:Water".upper(), "pipe2"),
+             (idf.newidfobject("Coil:Cooling:Water".upper(), Name="pipe2"),
               'Water_')],
             ['pipe1_Water_Inlet_Node_Name', '',
              'pipe2_Water_Inlet_Node_Name',
@@ -349,8 +351,8 @@ def test_connectcomponents():
         ),
         # components_thisnodes, inlets, outlets, fluid
         (
-            [(idf.newidfobject("PIPE:ADIABATIC".upper(), "pipe1"), None),
-             (idf.newidfobject("Coil:Cooling:Water".upper(), "pipe2"),
+            [(idf.newidfobject("PIPE:ADIABATIC".upper(), Name="pipe1"), None),
+             (idf.newidfobject("Coil:Cooling:Water".upper(), Name="pipe2"),
               'Water_')],
             ["pipe1_Inlet_Node_Name", "pipe2_Water_Inlet_Node_Name",
              ['pipe2_Air_Inlet_Node_Name', 'pipe1_pipe2_node']],
@@ -415,7 +417,7 @@ def test_initinletoutlet():
     fhandle = StringIO("")
     idf = IDF(fhandle)
     for idfobjectkey, idfobjname, thisnode, force, inlets, outlets in tdata:
-        idfobject = idf.newidfobject(idfobjectkey, idfobjname)
+        idfobject = idf.newidfobject(idfobjectkey, Name=idfobjname)
         inodefields = hvacbuilder.getfieldnamesendswith(
             idfobject,
             "Inlet_Node_Name")
@@ -487,7 +489,7 @@ def test_componentsintobranch():
     for ii, (idftxt, complst, fluid, branchcomps) in enumerate(tdata):
         fhandle = StringIO(idftxt)
         idf = IDF(fhandle)
-        components_thisnodes = [(idf.newidfobject(key, nm), thisnode)
+        components_thisnodes = [(idf.newidfobject(key, Name=nm), thisnode)
                                 for key, nm, thisnode in complst]
         fnc = hvacbuilder.initinletoutlet
         components_thisnodes = [(fnc(idf, cp, thisnode), thisnode)
@@ -519,14 +521,14 @@ def test_replacebranch():
                 'PIPE:ADIABATIC',
                 'np2', 'np1_np2_node', 'np2_Outlet_Node_Name', ''
             ]
-        ), # loopname, sloop, dloop, branchname, componenttuple, fluid, outbranch
+        ),  # loopname, sloop, dloop, branchname, componenttuple, fluid, outbranch
     )
     for (loopname, sloop, dloop, branchname,
          componenttuple, fluid, outbranch) in tdata:
         fhandle = StringIO("")
         idf = IDF(fhandle)
         loop = hvacbuilder.makeplantloop(idf, loopname, sloop, dloop)
-        components_thisnodes = [(idf.newidfobject(key, nm), thisnode)
+        components_thisnodes = [(idf.newidfobject(key, Name=nm), thisnode)
                                 for key, nm, thisnode in componenttuple]
         branch = idf.getobject('BRANCH', branchname)
         newbr = hvacbuilder.replacebranch(idf, loop, branch,
@@ -539,11 +541,11 @@ def test_makepipecomponent():
         (
             "apipe",
             ['PIPE:ADIABATIC', 'apipe',
-             'apipe_inlet', 'apipe_outlet']), # pname, pipe_obj
+             'apipe_inlet', 'apipe_outlet']),  # pname, pipe_obj
         (
             "bpipe",
             ['PIPE:ADIABATIC', 'bpipe',
-             'bpipe_inlet', 'bpipe_outlet']), # pname, pipe_obj
+             'bpipe_inlet', 'bpipe_outlet']),  # pname, pipe_obj
         )
     for pname, pipe_obj in tdata:
         fhandle = StringIO("")
@@ -556,7 +558,7 @@ def test_makeductcomponent():
     tdata = ((
         'aduct',
         ['DUCT', 'aduct', 'aduct_inlet', 'aduct_outlet']
-        ), # dname, duct_obj
+        ),  # dname, duct_obj
             )
     for dname, duct_obj in tdata:
         fhandle = StringIO("")
@@ -582,7 +584,7 @@ def test_makepipebranch():
             'p_branch_pipe',
             'p_branch_pipe_inlet',
             'p_branch_pipe_outlet']
-        ), # pb_name, branch_obj, pipe_obj
+        ),  # pb_name, branch_obj, pipe_obj
             )
     for pb_name, branch_obj, pipe_obj in tdata:
         fhandle = StringIO("")
@@ -610,7 +612,7 @@ def test_makeductbranch():
             'DUCT',
             'd_branch_duct',
             'd_branch_duct_inlet',
-            'd_branch_duct_outlet']), # db_name, branch_obj, duct_obj
+            'd_branch_duct_outlet']),  # db_name, branch_obj, duct_obj
             )
     for db_name, branch_obj, duct_obj in tdata:
         fhandle = StringIO("")
@@ -620,39 +622,25 @@ def test_makeductbranch():
         theduct = idf.getobject('DUCT', result.Component_1_Name)
         assert theduct.obj == duct_obj
 
-def test_flattencopy():
-    """py.test for flattencopy"""
-    tdata = (([1, 2], [1, 2]), #lst , nlst -a
-             ([1, 2, [3, 4]], [1, 2, 3, 4]), #lst , nlst
-             ([1, 2, [3, [4, 5, 6], 7, 8]], [1, 2, 3, 4, 5, 6, 7, 8]),
-             #lst , nlst
-             ([1, 2, [3, [4, 5, [6, 7], 8], 9]], [1, 2, 3, 4, 5, 6, 7, 8, 9]),
-             #lst , nlst
-            )
-    for lst, nlst in tdata:
-        result = hvacbuilder.flattencopy(lst)
-        assert result == nlst
-
-def test__clean_listofcomponents():
+def test_clean_listofcomponents():
     """py.test for _clean_listofcomponents"""
     data = (
-        ([1, 2], [(1, None), (2, None)]), # lst, clst
-        ([(1, None), 2], [(1, None), (2, None)]), # lst, clst
-        ([(1, 'stuff'), 2], [(1, 'stuff'), (2, None)]), # lst, clst
+        ([1, 2], [(1, None), (2, None)]),  # lst, clst
+        ([(1, None), 2], [(1, None), (2, None)]),  # lst, clst
+        ([(1, 'stuff'), 2], [(1, 'stuff'), (2, None)]),  # lst, clst
     )
     for lst, clst in data:
         result = hvacbuilder._clean_listofcomponents(lst)
         assert result == clst
 
-def test__clean_listofcomponents_tuples():
+def test_clean_listofcomponents_tuples():
     """py.test for _clean_listofcomponents_tuples"""
     data = (
-        ([(1, 2), (2, 3)], [(1, 2, None), (2, 3, None)]), #lst, clst
-        ([(1, 2, None), (2, 3)], [(1, 2, None), (2, 3, None)]), #lst, clst
-        ([(1, 2, 'stuff'), (2, 3)], [(1, 2, 'stuff'), (2, 3, None)]), #lst, clst
+        ([(1, 2), (2, 3)], [(1, 2, None), (2, 3, None)]),  # lst, clst
+        ([(1, 2, None), (2, 3)], [(1, 2, None), (2, 3, None)]),  # lst, clst
+        ([(1, 2, 'stuff'), (2, 3)], [(1, 2, 'stuff'), (2, 3, None)]),  # lst, clst
     )
     for lst, clst in data:
         result = hvacbuilder._clean_listofcomponents_tuples(lst)
         assert result == clst
 
-        
\ No newline at end of file
diff --git a/eppy/tests/test_modeleditor.py b/eppy/tests/test_modeleditor.py
index 469669c..8dabb19 100644
--- a/eppy/tests/test_modeleditor.py
+++ b/eppy/tests/test_modeleditor.py
@@ -5,25 +5,28 @@
 #  http://opensource.org/licenses/MIT)
 # =======================================================================
 """py.test for modeleditor"""
+
 from __future__ import absolute_import
 from __future__ import division
 from __future__ import print_function
 from __future__ import unicode_literals
 
-from six import StringIO
-from six import string_types
-from eppy import modeleditor
-from eppy.iddcurrent import iddcurrent
-from eppy.modeleditor import IDF
-from eppy.pytest_helpers import almostequal
 from itertools import product
 import os
+import warnings
 
 import pytest
+from six import StringIO
+from six import string_types
 
+from eppy import modeleditor
+from eppy.bunch_subclass import Bunch
+from eppy.iddcurrent import iddcurrent
 import eppy.idfreader as idfreader
+from eppy.modeleditor import IDF
+from eppy.pytest_helpers import almostequal
 import eppy.snippet as snippet
-from eppy.bunch_subclass import Bunch
+
 
 iddsnippet = iddcurrent.iddtxt
 idfsnippet = snippet.idfsnippet
@@ -39,7 +42,7 @@ iddfhandle = StringIO(iddcurrent.iddtxt)
 if IDF.getiddname() == None:
     IDF.setiddname(iddfhandle)
 
-        
+
 def test_poptrailing():
     """py.test for poptrailing"""
     tdata = (
@@ -340,6 +343,30 @@ def test_newidfobject():
     assert obj.fieldvalues[1] == 'A Wall'
 
 
+def test_newidfobject_warning():
+    """Test that the warning for newidfobject created with `aname` is working.
+
+    Fails if the warning is not issued when `aname` is used, or if the warning
+    is issued when `aname` is not used.
+    """
+    # make a blank idf
+    # make a function for this and then continue.
+    idf = IDF()
+    idf.new()
+    objtype = 'material:airgap'.upper()
+    # expect warnings here
+    pytest.warns(UserWarning, idf.newidfobject, objtype, aname="Krypton")
+    pytest.warns(UserWarning, idf.newidfobject, objtype, "Krypton")
+    # expect no warnings here
+    # This works because pytest.warn raises an exception if no warning is
+    # produced. We expect this and catch it with pytest.raises.
+    pytest.raises(
+        Exception,
+        pytest.warns, UserWarning,
+        idf.newidfobject,
+        objtype, Name="Krypton")
+
+
 def test_save():
     """
     Test the IDF.save() function using a filehandle to avoid external effects.
@@ -358,7 +385,7 @@ def test_save():
 
 def test_save_with_lineendings_and_encodings():
     """
-    Test the IDF.save() function with combinations of encodings and line 
+    Test the IDF.save() function with combinations of encodings and line
     endings.
 
     """
@@ -442,7 +469,7 @@ def test_initread():
     idf = IDF()
     idf.initread(fname)
     assert idf.getobject('BUILDING', 'Building')
-    
+
     # test fname as str
     fname = str('tmp.idf')
     assert isinstance(fname, string_types)
@@ -474,7 +501,7 @@ def test_initreadtxt():
           0.16,                    !- Conductivity {W/m-K}
           800,                     !- Density {kg/m3}
           1090;                    !- Specific Heat {J/kg-K}
-        
+
         Construction,
           Interior Wall,           !- Name
           G01a 19mm gypsum board,  !- Outside Layer
@@ -542,8 +569,8 @@ def test_refname2key():
         ),  # refname, key
         (
             'AllCurves',
-            [u'PUMP:VARIABLESPEED', 
-            u'PUMP:CONSTANTSPEED', u'BOILER:HOTWATER', 
+            [u'PUMP:VARIABLESPEED',
+            u'PUMP:CONSTANTSPEED', u'BOILER:HOTWATER',
             u'ENERGYMANAGEMENTSYSTEM:CURVEORTABLEINDEXVARIABLE'],
         ),  # refname, key
     )
@@ -559,7 +586,7 @@ def test_getiddgroupdict():
     {
         None: ['Lead Input', 'Simulation Data']
     },
-    ), # gdict,
+    ),  # gdict,
     )
     for gdict, in data:
         fhandle = StringIO("")
@@ -584,8 +611,8 @@ def test_idfinmsequence():
     material = materials.pop(0)
     assert material.theidf == None
     assert materials[0].theidf == idf
-    
-    
+
+
 def test_idd_index():
     """py.test to see if idd_index is returned"""
     idftxt = """"""