partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | iddofobject | from commdct, return the idd of the object key | eppy/modeleditor.py | def iddofobject(data, commdct, key):
"""from commdct, return the idd of the object key"""
dtls = data.dtls
i = dtls.index(key)
return commdct[i] | def iddofobject(data, commdct, key):
"""from commdct, return the idd of the object key"""
dtls = data.dtls
i = dtls.index(key)
return commdct[i] | [
"from",
"commdct",
"return",
"the",
"idd",
"of",
"the",
"object",
"key"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L241-L245 | [
"def",
"iddofobject",
"(",
"data",
",",
"commdct",
",",
"key",
")",
":",
"dtls",
"=",
"data",
".",
"dtls",
"i",
"=",
"dtls",
".",
"index",
"(",
"key",
")",
"return",
"commdct",
"[",
"i",
"]"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | getextensibleindex | get the index of the first extensible item | eppy/modeleditor.py | def getextensibleindex(bunchdt, data, commdct, key, objname):
"""get the index of the first extensible item"""
theobject = getobject(bunchdt, key, objname)
if theobject == None:
return None
theidd = iddofobject(data, commdct, key)
extensible_i = [
i for i in range(len(theidd)) if 'be... | def getextensibleindex(bunchdt, data, commdct, key, objname):
"""get the index of the first extensible item"""
theobject = getobject(bunchdt, key, objname)
if theobject == None:
return None
theidd = iddofobject(data, commdct, key)
extensible_i = [
i for i in range(len(theidd)) if 'be... | [
"get",
"the",
"index",
"of",
"the",
"first",
"extensible",
"item"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L248-L259 | [
"def",
"getextensibleindex",
"(",
"bunchdt",
",",
"data",
",",
"commdct",
",",
"key",
",",
"objname",
")",
":",
"theobject",
"=",
"getobject",
"(",
"bunchdt",
",",
"key",
",",
"objname",
")",
"if",
"theobject",
"==",
"None",
":",
"return",
"None",
"theid... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | removeextensibles | remove the extensible items in the object | eppy/modeleditor.py | def removeextensibles(bunchdt, data, commdct, key, objname):
"""remove the extensible items in the object"""
theobject = getobject(bunchdt, key, objname)
if theobject == None:
return theobject
theidd = iddofobject(data, commdct, key)
extensible_i = [
i for i in range(len(theidd)) if ... | def removeextensibles(bunchdt, data, commdct, key, objname):
"""remove the extensible items in the object"""
theobject = getobject(bunchdt, key, objname)
if theobject == None:
return theobject
theidd = iddofobject(data, commdct, key)
extensible_i = [
i for i in range(len(theidd)) if ... | [
"remove",
"the",
"extensible",
"items",
"in",
"the",
"object"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L262-L279 | [
"def",
"removeextensibles",
"(",
"bunchdt",
",",
"data",
",",
"commdct",
",",
"key",
",",
"objname",
")",
":",
"theobject",
"=",
"getobject",
"(",
"bunchdt",
",",
"key",
",",
"objname",
")",
"if",
"theobject",
"==",
"None",
":",
"return",
"theobject",
"t... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | getfieldcomm | get the idd comment for the field | eppy/modeleditor.py | def getfieldcomm(bunchdt, data, commdct, idfobject, fieldname):
"""get the idd comment for the field"""
key = idfobject.obj[0].upper()
keyi = data.dtls.index(key)
fieldi = idfobject.objls.index(fieldname)
thiscommdct = commdct[keyi][fieldi]
return thiscommdct | def getfieldcomm(bunchdt, data, commdct, idfobject, fieldname):
"""get the idd comment for the field"""
key = idfobject.obj[0].upper()
keyi = data.dtls.index(key)
fieldi = idfobject.objls.index(fieldname)
thiscommdct = commdct[keyi][fieldi]
return thiscommdct | [
"get",
"the",
"idd",
"comment",
"for",
"the",
"field"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L282-L288 | [
"def",
"getfieldcomm",
"(",
"bunchdt",
",",
"data",
",",
"commdct",
",",
"idfobject",
",",
"fieldname",
")",
":",
"key",
"=",
"idfobject",
".",
"obj",
"[",
"0",
"]",
".",
"upper",
"(",
")",
"keyi",
"=",
"data",
".",
"dtls",
".",
"index",
"(",
"key"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | is_retaincase | test if case has to be retained for that field | eppy/modeleditor.py | def is_retaincase(bunchdt, data, commdct, idfobject, fieldname):
"""test if case has to be retained for that field"""
thiscommdct = getfieldcomm(bunchdt, data, commdct, idfobject, fieldname)
return 'retaincase' in thiscommdct | def is_retaincase(bunchdt, data, commdct, idfobject, fieldname):
"""test if case has to be retained for that field"""
thiscommdct = getfieldcomm(bunchdt, data, commdct, idfobject, fieldname)
return 'retaincase' in thiscommdct | [
"test",
"if",
"case",
"has",
"to",
"be",
"retained",
"for",
"that",
"field"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L291-L294 | [
"def",
"is_retaincase",
"(",
"bunchdt",
",",
"data",
",",
"commdct",
",",
"idfobject",
",",
"fieldname",
")",
":",
"thiscommdct",
"=",
"getfieldcomm",
"(",
"bunchdt",
",",
"data",
",",
"commdct",
",",
"idfobject",
",",
"fieldname",
")",
"return",
"'retaincas... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | isfieldvalue | test if idfobj.field == value | eppy/modeleditor.py | def isfieldvalue(bunchdt, data, commdct, idfobj, fieldname, value, places=7):
"""test if idfobj.field == value"""
# do a quick type check
# if type(idfobj[fieldname]) != type(value):
# return False # takes care of autocalculate and real
# check float
thiscommdct = getfieldcomm(bunchdt, data, com... | def isfieldvalue(bunchdt, data, commdct, idfobj, fieldname, value, places=7):
"""test if idfobj.field == value"""
# do a quick type check
# if type(idfobj[fieldname]) != type(value):
# return False # takes care of autocalculate and real
# check float
thiscommdct = getfieldcomm(bunchdt, data, com... | [
"test",
"if",
"idfobj",
".",
"field",
"==",
"value"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L297-L318 | [
"def",
"isfieldvalue",
"(",
"bunchdt",
",",
"data",
",",
"commdct",
",",
"idfobj",
",",
"fieldname",
",",
"value",
",",
"places",
"=",
"7",
")",
":",
"# do a quick type check",
"# if type(idfobj[fieldname]) != type(value):",
"# return False # takes care of autocalculate a... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | equalfield | returns true if the two fields are equal
will test for retaincase
places is used if the field is float/real | eppy/modeleditor.py | def equalfield(bunchdt, data, commdct, idfobj1, idfobj2, fieldname, places=7):
"""returns true if the two fields are equal
will test for retaincase
places is used if the field is float/real"""
# TODO test if both objects are of same type
key1 = idfobj1.obj[0].upper()
key2 = idfobj2.obj[0].upper(... | def equalfield(bunchdt, data, commdct, idfobj1, idfobj2, fieldname, places=7):
"""returns true if the two fields are equal
will test for retaincase
places is used if the field is float/real"""
# TODO test if both objects are of same type
key1 = idfobj1.obj[0].upper()
key2 = idfobj2.obj[0].upper(... | [
"returns",
"true",
"if",
"the",
"two",
"fields",
"are",
"equal",
"will",
"test",
"for",
"retaincase",
"places",
"is",
"used",
"if",
"the",
"field",
"is",
"float",
"/",
"real"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L321-L333 | [
"def",
"equalfield",
"(",
"bunchdt",
",",
"data",
",",
"commdct",
",",
"idfobj1",
",",
"idfobj2",
",",
"fieldname",
",",
"places",
"=",
"7",
")",
":",
"# TODO test if both objects are of same type",
"key1",
"=",
"idfobj1",
".",
"obj",
"[",
"0",
"]",
".",
"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | getrefnames | get the reference names for this object | eppy/modeleditor.py | def getrefnames(idf, objname):
"""get the reference names for this object"""
iddinfo = idf.idd_info
dtls = idf.model.dtls
index = dtls.index(objname)
fieldidds = iddinfo[index]
for fieldidd in fieldidds:
if 'field' in fieldidd:
if fieldidd['field'][0].endswith('Name'):
... | def getrefnames(idf, objname):
"""get the reference names for this object"""
iddinfo = idf.idd_info
dtls = idf.model.dtls
index = dtls.index(objname)
fieldidds = iddinfo[index]
for fieldidd in fieldidds:
if 'field' in fieldidd:
if fieldidd['field'][0].endswith('Name'):
... | [
"get",
"the",
"reference",
"names",
"for",
"this",
"object"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L336-L348 | [
"def",
"getrefnames",
"(",
"idf",
",",
"objname",
")",
":",
"iddinfo",
"=",
"idf",
".",
"idd_info",
"dtls",
"=",
"idf",
".",
"model",
".",
"dtls",
"index",
"=",
"dtls",
".",
"index",
"(",
"objname",
")",
"fieldidds",
"=",
"iddinfo",
"[",
"index",
"]"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | getallobjlists | get all object-list fields for refname
return a list:
[('OBJKEY', refname, fieldindexlist), ...] where
fieldindexlist = index of the field where the object-list = refname | eppy/modeleditor.py | def getallobjlists(idf, refname):
"""get all object-list fields for refname
return a list:
[('OBJKEY', refname, fieldindexlist), ...] where
fieldindexlist = index of the field where the object-list = refname
"""
dtls = idf.model.dtls
objlists = []
for i, fieldidds in enumerate(idf.idd_in... | def getallobjlists(idf, refname):
"""get all object-list fields for refname
return a list:
[('OBJKEY', refname, fieldindexlist), ...] where
fieldindexlist = index of the field where the object-list = refname
"""
dtls = idf.model.dtls
objlists = []
for i, fieldidds in enumerate(idf.idd_in... | [
"get",
"all",
"object",
"-",
"list",
"fields",
"for",
"refname",
"return",
"a",
"list",
":",
"[",
"(",
"OBJKEY",
"refname",
"fieldindexlist",
")",
"...",
"]",
"where",
"fieldindexlist",
"=",
"index",
"of",
"the",
"field",
"where",
"the",
"object",
"-",
"... | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L351-L368 | [
"def",
"getallobjlists",
"(",
"idf",
",",
"refname",
")",
":",
"dtls",
"=",
"idf",
".",
"model",
".",
"dtls",
"objlists",
"=",
"[",
"]",
"for",
"i",
",",
"fieldidds",
"in",
"enumerate",
"(",
"idf",
".",
"idd_info",
")",
":",
"indexlist",
"=",
"[",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | rename | rename all the refrences to this objname | eppy/modeleditor.py | def rename(idf, objkey, objname, newname):
"""rename all the refrences to this objname"""
refnames = getrefnames(idf, objkey)
for refname in refnames:
objlists = getallobjlists(idf, refname)
# [('OBJKEY', refname, fieldindexlist), ...]
for refname in refnames:
# TODO : there ... | def rename(idf, objkey, objname, newname):
"""rename all the refrences to this objname"""
refnames = getrefnames(idf, objkey)
for refname in refnames:
objlists = getallobjlists(idf, refname)
# [('OBJKEY', refname, fieldindexlist), ...]
for refname in refnames:
# TODO : there ... | [
"rename",
"all",
"the",
"refrences",
"to",
"this",
"objname"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L371-L389 | [
"def",
"rename",
"(",
"idf",
",",
"objkey",
",",
"objname",
",",
"newname",
")",
":",
"refnames",
"=",
"getrefnames",
"(",
"idf",
",",
"objkey",
")",
"for",
"refname",
"in",
"refnames",
":",
"objlists",
"=",
"getallobjlists",
"(",
"idf",
",",
"refname",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | zonearea | zone area | eppy/modeleditor.py | def zonearea(idf, zonename, debug=False):
"""zone area"""
zone = idf.getobject('ZONE', zonename)
surfs = idf.idfobjects['BuildingSurface:Detailed'.upper()]
zone_surfs = [s for s in surfs if s.Zone_Name == zone.Name]
floors = [s for s in zone_surfs if s.Surface_Type.upper() == 'FLOOR']
if debug:
... | def zonearea(idf, zonename, debug=False):
"""zone area"""
zone = idf.getobject('ZONE', zonename)
surfs = idf.idfobjects['BuildingSurface:Detailed'.upper()]
zone_surfs = [s for s in surfs if s.Zone_Name == zone.Name]
floors = [s for s in zone_surfs if s.Surface_Type.upper() == 'FLOOR']
if debug:
... | [
"zone",
"area"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L392-L406 | [
"def",
"zonearea",
"(",
"idf",
",",
"zonename",
",",
"debug",
"=",
"False",
")",
":",
"zone",
"=",
"idf",
".",
"getobject",
"(",
"'ZONE'",
",",
"zonename",
")",
"surfs",
"=",
"idf",
".",
"idfobjects",
"[",
"'BuildingSurface:Detailed'",
".",
"upper",
"(",... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | zone_height_min2max | zone height = max-min | eppy/modeleditor.py | def zone_height_min2max(idf, zonename, debug=False):
"""zone height = max-min"""
zone = idf.getobject('ZONE', zonename)
surfs = idf.idfobjects['BuildingSurface:Detailed'.upper()]
zone_surfs = [s for s in surfs if s.Zone_Name == zone.Name]
surf_xyzs = [eppy.function_helpers.getcoords(s) for s in zone... | def zone_height_min2max(idf, zonename, debug=False):
"""zone height = max-min"""
zone = idf.getobject('ZONE', zonename)
surfs = idf.idfobjects['BuildingSurface:Detailed'.upper()]
zone_surfs = [s for s in surfs if s.Zone_Name == zone.Name]
surf_xyzs = [eppy.function_helpers.getcoords(s) for s in zone... | [
"zone",
"height",
"=",
"max",
"-",
"min"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L436-L447 | [
"def",
"zone_height_min2max",
"(",
"idf",
",",
"zonename",
",",
"debug",
"=",
"False",
")",
":",
"zone",
"=",
"idf",
".",
"getobject",
"(",
"'ZONE'",
",",
"zonename",
")",
"surfs",
"=",
"idf",
".",
"idfobjects",
"[",
"'BuildingSurface:Detailed'",
".",
"upp... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | zoneheight | zone height | eppy/modeleditor.py | def zoneheight(idf, zonename, debug=False):
"""zone height"""
zone = idf.getobject('ZONE', zonename)
surfs = idf.idfobjects['BuildingSurface:Detailed'.upper()]
zone_surfs = [s for s in surfs if s.Zone_Name == zone.Name]
floors = [s for s in zone_surfs if s.Surface_Type.upper() == 'FLOOR']
roofs ... | def zoneheight(idf, zonename, debug=False):
"""zone height"""
zone = idf.getobject('ZONE', zonename)
surfs = idf.idfobjects['BuildingSurface:Detailed'.upper()]
zone_surfs = [s for s in surfs if s.Zone_Name == zone.Name]
floors = [s for s in zone_surfs if s.Surface_Type.upper() == 'FLOOR']
roofs ... | [
"zone",
"height"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L450-L461 | [
"def",
"zoneheight",
"(",
"idf",
",",
"zonename",
",",
"debug",
"=",
"False",
")",
":",
"zone",
"=",
"idf",
".",
"getobject",
"(",
"'ZONE'",
",",
"zonename",
")",
"surfs",
"=",
"idf",
".",
"idfobjects",
"[",
"'BuildingSurface:Detailed'",
".",
"upper",
"(... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | zone_floor2roofheight | zone floor to roof height | eppy/modeleditor.py | def zone_floor2roofheight(idf, zonename, debug=False):
"""zone floor to roof height"""
zone = idf.getobject('ZONE', zonename)
surfs = idf.idfobjects['BuildingSurface:Detailed'.upper()]
zone_surfs = [s for s in surfs if s.Zone_Name == zone.Name]
floors = [s for s in zone_surfs if s.Surface_Type.upper... | def zone_floor2roofheight(idf, zonename, debug=False):
"""zone floor to roof height"""
zone = idf.getobject('ZONE', zonename)
surfs = idf.idfobjects['BuildingSurface:Detailed'.upper()]
zone_surfs = [s for s in surfs if s.Zone_Name == zone.Name]
floors = [s for s in zone_surfs if s.Surface_Type.upper... | [
"zone",
"floor",
"to",
"roof",
"height"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L464-L487 | [
"def",
"zone_floor2roofheight",
"(",
"idf",
",",
"zonename",
",",
"debug",
"=",
"False",
")",
":",
"zone",
"=",
"idf",
".",
"getobject",
"(",
"'ZONE'",
",",
"zonename",
")",
"surfs",
"=",
"idf",
".",
"idfobjects",
"[",
"'BuildingSurface:Detailed'",
".",
"u... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | zonevolume | zone volume | eppy/modeleditor.py | def zonevolume(idf, zonename):
"""zone volume"""
area = zonearea(idf, zonename)
height = zoneheight(idf, zonename)
volume = area * height
return volume | def zonevolume(idf, zonename):
"""zone volume"""
area = zonearea(idf, zonename)
height = zoneheight(idf, zonename)
volume = area * height
return volume | [
"zone",
"volume"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L490-L496 | [
"def",
"zonevolume",
"(",
"idf",
",",
"zonename",
")",
":",
"area",
"=",
"zonearea",
"(",
"idf",
",",
"zonename",
")",
"height",
"=",
"zoneheight",
"(",
"idf",
",",
"zonename",
")",
"volume",
"=",
"area",
"*",
"height",
"return",
"volume"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.setiddname | Set the path to the EnergyPlus IDD for the version of EnergyPlus which
is to be used by eppy.
Parameters
----------
iddname : str
Path to the IDD file.
testing : bool
Flag to use if running tests since we may want to ignore the
`IDDAlreadySetE... | eppy/modeleditor.py | def setiddname(cls, iddname, testing=False):
"""
Set the path to the EnergyPlus IDD for the version of EnergyPlus which
is to be used by eppy.
Parameters
----------
iddname : str
Path to the IDD file.
testing : bool
Flag to use if running ... | def setiddname(cls, iddname, testing=False):
"""
Set the path to the EnergyPlus IDD for the version of EnergyPlus which
is to be used by eppy.
Parameters
----------
iddname : str
Path to the IDD file.
testing : bool
Flag to use if running ... | [
"Set",
"the",
"path",
"to",
"the",
"EnergyPlus",
"IDD",
"for",
"the",
"version",
"of",
"EnergyPlus",
"which",
"is",
"to",
"be",
"used",
"by",
"eppy",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L557-L584 | [
"def",
"setiddname",
"(",
"cls",
",",
"iddname",
",",
"testing",
"=",
"False",
")",
":",
"if",
"cls",
".",
"iddname",
"==",
"None",
":",
"cls",
".",
"iddname",
"=",
"iddname",
"cls",
".",
"idd_info",
"=",
"None",
"cls",
".",
"block",
"=",
"None",
"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.setidd | Set the IDD to be used by eppy.
Parameters
----------
iddinfo : list
Comments and metadata about fields in the IDD.
block : list
Field names in the IDD. | eppy/modeleditor.py | def setidd(cls, iddinfo, iddindex, block, idd_version):
"""Set the IDD to be used by eppy.
Parameters
----------
iddinfo : list
Comments and metadata about fields in the IDD.
block : list
Field names in the IDD.
"""
cls.idd_info = iddinfo... | def setidd(cls, iddinfo, iddindex, block, idd_version):
"""Set the IDD to be used by eppy.
Parameters
----------
iddinfo : list
Comments and metadata about fields in the IDD.
block : list
Field names in the IDD.
"""
cls.idd_info = iddinfo... | [
"Set",
"the",
"IDD",
"to",
"be",
"used",
"by",
"eppy",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L598-L612 | [
"def",
"setidd",
"(",
"cls",
",",
"iddinfo",
",",
"iddindex",
",",
"block",
",",
"idd_version",
")",
":",
"cls",
".",
"idd_info",
"=",
"iddinfo",
"cls",
".",
"block",
"=",
"block",
"cls",
".",
"idd_index",
"=",
"iddindex",
"cls",
".",
"idd_version",
"=... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.initread | Use the current IDD and read an IDF from file. If the IDD has not yet
been initialised then this is done first.
Parameters
----------
idf_name : str
Path to an IDF file. | eppy/modeleditor.py | def initread(self, idfname):
"""
Use the current IDD and read an IDF from file. If the IDD has not yet
been initialised then this is done first.
Parameters
----------
idf_name : str
Path to an IDF file.
"""
with open(idfname, 'r') as _:
... | def initread(self, idfname):
"""
Use the current IDD and read an IDF from file. If the IDD has not yet
been initialised then this is done first.
Parameters
----------
idf_name : str
Path to an IDF file.
"""
with open(idfname, 'r') as _:
... | [
"Use",
"the",
"current",
"IDD",
"and",
"read",
"an",
"IDF",
"from",
"file",
".",
"If",
"the",
"IDD",
"has",
"not",
"yet",
"been",
"initialised",
"then",
"this",
"is",
"done",
"first",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L616-L634 | [
"def",
"initread",
"(",
"self",
",",
"idfname",
")",
":",
"with",
"open",
"(",
"idfname",
",",
"'r'",
")",
"as",
"_",
":",
"# raise nonexistent file error early if idfname doesn't exist",
"pass",
"iddfhandle",
"=",
"StringIO",
"(",
"iddcurrent",
".",
"iddtxt",
"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.initreadtxt | Use the current IDD and read an IDF from text data. If the IDD has not
yet been initialised then this is done first.
Parameters
----------
idftxt : str
Text representing an IDF file. | eppy/modeleditor.py | def initreadtxt(self, idftxt):
"""
Use the current IDD and read an IDF from text data. If the IDD has not
yet been initialised then this is done first.
Parameters
----------
idftxt : str
Text representing an IDF file.
"""
iddfhandle = StringI... | def initreadtxt(self, idftxt):
"""
Use the current IDD and read an IDF from text data. If the IDD has not
yet been initialised then this is done first.
Parameters
----------
idftxt : str
Text representing an IDF file.
"""
iddfhandle = StringI... | [
"Use",
"the",
"current",
"IDD",
"and",
"read",
"an",
"IDF",
"from",
"text",
"data",
".",
"If",
"the",
"IDD",
"has",
"not",
"yet",
"been",
"initialised",
"then",
"this",
"is",
"done",
"first",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L636-L652 | [
"def",
"initreadtxt",
"(",
"self",
",",
"idftxt",
")",
":",
"iddfhandle",
"=",
"StringIO",
"(",
"iddcurrent",
".",
"iddtxt",
")",
"if",
"self",
".",
"getiddname",
"(",
")",
"==",
"None",
":",
"self",
".",
"setiddname",
"(",
"iddfhandle",
")",
"idfhandle"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.read | Read the IDF file and the IDD file. If the IDD file had already been
read, it will not be read again.
Read populates the following data structures:
- idfobjects : list
- model : list
- idd_info : list
- idd_index : dict | eppy/modeleditor.py | def read(self):
"""
Read the IDF file and the IDD file. If the IDD file had already been
read, it will not be read again.
Read populates the following data structures:
- idfobjects : list
- model : list
- idd_info : list
- idd_index : dict
"""
... | def read(self):
"""
Read the IDF file and the IDD file. If the IDD file had already been
read, it will not be read again.
Read populates the following data structures:
- idfobjects : list
- model : list
- idd_info : list
- idd_index : dict
"""
... | [
"Read",
"the",
"IDF",
"file",
"and",
"the",
"IDD",
"file",
".",
"If",
"the",
"IDD",
"file",
"had",
"already",
"been",
"read",
"it",
"will",
"not",
"be",
"read",
"again",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L654-L676 | [
"def",
"read",
"(",
"self",
")",
":",
"if",
"self",
".",
"getiddname",
"(",
")",
"==",
"None",
":",
"errortxt",
"=",
"(",
"\"IDD file needed to read the idf file. \"",
"\"Set it using IDF.setiddname(iddfile)\"",
")",
"raise",
"IDDNotSetError",
"(",
"errortxt",
")",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.initnew | Use the current IDD and create a new empty IDF. If the IDD has not yet
been initialised then this is done first.
Parameters
----------
fname : str, optional
Path to an IDF. This does not need to be set at this point. | eppy/modeleditor.py | def initnew(self, fname):
"""
Use the current IDD and create a new empty IDF. If the IDD has not yet
been initialised then this is done first.
Parameters
----------
fname : str, optional
Path to an IDF. This does not need to be set at this point.
"""... | def initnew(self, fname):
"""
Use the current IDD and create a new empty IDF. If the IDD has not yet
been initialised then this is done first.
Parameters
----------
fname : str, optional
Path to an IDF. This does not need to be set at this point.
"""... | [
"Use",
"the",
"current",
"IDD",
"and",
"create",
"a",
"new",
"empty",
"IDF",
".",
"If",
"the",
"IDD",
"has",
"not",
"yet",
"been",
"initialised",
"then",
"this",
"is",
"done",
"first",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L691-L709 | [
"def",
"initnew",
"(",
"self",
",",
"fname",
")",
":",
"iddfhandle",
"=",
"StringIO",
"(",
"iddcurrent",
".",
"iddtxt",
")",
"if",
"self",
".",
"getiddname",
"(",
")",
"==",
"None",
":",
"self",
".",
"setiddname",
"(",
"iddfhandle",
")",
"idfhandle",
"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.newidfobject | Add a new idfobject to the model. If you don't specify a value for a
field, the default value will be set.
For example ::
newidfobject("CONSTRUCTION")
newidfobject("CONSTRUCTION",
Name='Interior Ceiling_class',
Outside_Layer='LW Concrete',
... | eppy/modeleditor.py | def newidfobject(self, key, aname='', defaultvalues=True, **kwargs):
"""
Add a new idfobject to the model. If you don't specify a value for a
field, the default value will be set.
For example ::
newidfobject("CONSTRUCTION")
newidfobject("CONSTRUCTION",
... | def newidfobject(self, key, aname='', defaultvalues=True, **kwargs):
"""
Add a new idfobject to the model. If you don't specify a value for a
field, the default value will be set.
For example ::
newidfobject("CONSTRUCTION")
newidfobject("CONSTRUCTION",
... | [
"Add",
"a",
"new",
"idfobject",
"to",
"the",
"model",
".",
"If",
"you",
"don",
"t",
"specify",
"a",
"value",
"for",
"a",
"field",
"the",
"default",
"value",
"will",
"be",
"set",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L713-L755 | [
"def",
"newidfobject",
"(",
"self",
",",
"key",
",",
"aname",
"=",
"''",
",",
"defaultvalues",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"obj",
"=",
"newrawobject",
"(",
"self",
".",
"model",
",",
"self",
".",
"idd_info",
",",
"key",
",",
"bl... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.removeidfobject | Remove an IDF object from the IDF.
Parameters
----------
idfobject : EpBunch object
The IDF object to remove. | eppy/modeleditor.py | def removeidfobject(self, idfobject):
"""Remove an IDF object from the IDF.
Parameters
----------
idfobject : EpBunch object
The IDF object to remove.
"""
key = idfobject.key.upper()
self.idfobjects[key].remove(idfobject) | def removeidfobject(self, idfobject):
"""Remove an IDF object from the IDF.
Parameters
----------
idfobject : EpBunch object
The IDF object to remove.
"""
key = idfobject.key.upper()
self.idfobjects[key].remove(idfobject) | [
"Remove",
"an",
"IDF",
"object",
"from",
"the",
"IDF",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L774-L784 | [
"def",
"removeidfobject",
"(",
"self",
",",
"idfobject",
")",
":",
"key",
"=",
"idfobject",
".",
"key",
".",
"upper",
"(",
")",
"self",
".",
"idfobjects",
"[",
"key",
"]",
".",
"remove",
"(",
"idfobject",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.copyidfobject | Add an IDF object to the IDF.
Parameters
----------
idfobject : EpBunch object
The IDF object to remove. This usually comes from another idf file,
or it can be used to copy within this idf file. | eppy/modeleditor.py | def copyidfobject(self, idfobject):
"""Add an IDF object to the IDF.
Parameters
----------
idfobject : EpBunch object
The IDF object to remove. This usually comes from another idf file,
or it can be used to copy within this idf file.
"""
return a... | def copyidfobject(self, idfobject):
"""Add an IDF object to the IDF.
Parameters
----------
idfobject : EpBunch object
The IDF object to remove. This usually comes from another idf file,
or it can be used to copy within this idf file.
"""
return a... | [
"Add",
"an",
"IDF",
"object",
"to",
"the",
"IDF",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L786-L799 | [
"def",
"copyidfobject",
"(",
"self",
",",
"idfobject",
")",
":",
"return",
"addthisbunch",
"(",
"self",
".",
"idfobjects",
",",
"self",
".",
"model",
",",
"self",
".",
"idd_info",
",",
"idfobject",
",",
"self",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.getextensibleindex | Get the index of the first extensible item.
Only for internal use. # TODO : hide this
Parameters
----------
key : str
The type of IDF object. This must be in ALL_CAPS.
name : str
The name of the object to fetch.
Returns
-------
i... | eppy/modeleditor.py | def getextensibleindex(self, key, name):
"""
Get the index of the first extensible item.
Only for internal use. # TODO : hide this
Parameters
----------
key : str
The type of IDF object. This must be in ALL_CAPS.
name : str
The name of th... | def getextensibleindex(self, key, name):
"""
Get the index of the first extensible item.
Only for internal use. # TODO : hide this
Parameters
----------
key : str
The type of IDF object. This must be in ALL_CAPS.
name : str
The name of th... | [
"Get",
"the",
"index",
"of",
"the",
"first",
"extensible",
"item",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L818-L838 | [
"def",
"getextensibleindex",
"(",
"self",
",",
"key",
",",
"name",
")",
":",
"return",
"getextensibleindex",
"(",
"self",
".",
"idfobjects",
",",
"self",
".",
"model",
",",
"self",
".",
"idd_info",
",",
"key",
",",
"name",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.removeextensibles | Remove extensible items in the object of key and name.
Only for internal use. # TODO : hide this
Parameters
----------
key : str
The type of IDF object. This must be in ALL_CAPS.
name : str
The name of the object to fetch.
Returns
------... | eppy/modeleditor.py | def removeextensibles(self, key, name):
"""
Remove extensible items in the object of key and name.
Only for internal use. # TODO : hide this
Parameters
----------
key : str
The type of IDF object. This must be in ALL_CAPS.
name : str
The ... | def removeextensibles(self, key, name):
"""
Remove extensible items in the object of key and name.
Only for internal use. # TODO : hide this
Parameters
----------
key : str
The type of IDF object. This must be in ALL_CAPS.
name : str
The ... | [
"Remove",
"extensible",
"items",
"in",
"the",
"object",
"of",
"key",
"and",
"name",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L840-L860 | [
"def",
"removeextensibles",
"(",
"self",
",",
"key",
",",
"name",
")",
":",
"return",
"removeextensibles",
"(",
"self",
".",
"idfobjects",
",",
"self",
".",
"model",
",",
"self",
".",
"idd_info",
",",
"key",
",",
"name",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.idfstr | String representation of the IDF.
Returns
-------
str | eppy/modeleditor.py | def idfstr(self):
"""String representation of the IDF.
Returns
-------
str
"""
if self.outputtype == 'standard':
astr = ''
else:
astr = self.model.__repr__()
if self.outputtype == 'standard':
astr = ''
dtl... | def idfstr(self):
"""String representation of the IDF.
Returns
-------
str
"""
if self.outputtype == 'standard':
astr = ''
else:
astr = self.model.__repr__()
if self.outputtype == 'standard':
astr = ''
dtl... | [
"String",
"representation",
"of",
"the",
"IDF",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L869-L905 | [
"def",
"idfstr",
"(",
"self",
")",
":",
"if",
"self",
".",
"outputtype",
"==",
"'standard'",
":",
"astr",
"=",
"''",
"else",
":",
"astr",
"=",
"self",
".",
"model",
".",
"__repr__",
"(",
")",
"if",
"self",
".",
"outputtype",
"==",
"'standard'",
":",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.save | Save the IDF as a text file with the optional filename passed, or with
the current idfname of the IDF.
Parameters
----------
filename : str, optional
Filepath to save the file. If None then use the IDF.idfname
parameter. Also accepts a file handle.
linee... | eppy/modeleditor.py | 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.
Parameters
----------
filename : str, optional
Filepath to save the file. If N... | 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.
Parameters
----------
filename : str, optional
Filepath to save the file. If N... | [
"Save",
"the",
"IDF",
"as",
"a",
"text",
"file",
"with",
"the",
"optional",
"filename",
"passed",
"or",
"with",
"the",
"current",
"idfname",
"of",
"the",
"IDF",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L907-L953 | [
"def",
"save",
"(",
"self",
",",
"filename",
"=",
"None",
",",
"lineendings",
"=",
"'default'",
",",
"encoding",
"=",
"'latin-1'",
")",
":",
"if",
"filename",
"is",
"None",
":",
"filename",
"=",
"self",
".",
"idfname",
"s",
"=",
"self",
".",
"idfstr",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.saveas | Save the IDF as a text file with the filename passed.
Parameters
----------
filename : str
Filepath to to set the idfname attribute to and save the file as.
lineendings : str, optional
Line endings to use in the saved file. Options are 'default',
'wi... | eppy/modeleditor.py | def saveas(self, filename, lineendings='default', encoding='latin-1'):
""" Save the IDF as a text file with the filename passed.
Parameters
----------
filename : str
Filepath to to set the idfname attribute to and save the file as.
lineendings : str, optional
... | def saveas(self, filename, lineendings='default', encoding='latin-1'):
""" Save the IDF as a text file with the filename passed.
Parameters
----------
filename : str
Filepath to to set the idfname attribute to and save the file as.
lineendings : str, optional
... | [
"Save",
"the",
"IDF",
"as",
"a",
"text",
"file",
"with",
"the",
"filename",
"passed",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L955-L974 | [
"def",
"saveas",
"(",
"self",
",",
"filename",
",",
"lineendings",
"=",
"'default'",
",",
"encoding",
"=",
"'latin-1'",
")",
":",
"self",
".",
"idfname",
"=",
"filename",
"self",
".",
"save",
"(",
"filename",
",",
"lineendings",
",",
"encoding",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.savecopy | Save a copy of the file with the filename passed.
Parameters
----------
filename : str
Filepath to save the file.
lineendings : str, optional
Line endings to use in the saved file. Options are 'default',
'windows' and 'unix' the default is 'default' ... | eppy/modeleditor.py | def savecopy(self, filename, lineendings='default', encoding='latin-1'):
"""Save a copy of the file with the filename passed.
Parameters
----------
filename : str
Filepath to save the file.
lineendings : str, optional
Line endings to use in the saved fil... | def savecopy(self, filename, lineendings='default', encoding='latin-1'):
"""Save a copy of the file with the filename passed.
Parameters
----------
filename : str
Filepath to save the file.
lineendings : str, optional
Line endings to use in the saved fil... | [
"Save",
"a",
"copy",
"of",
"the",
"file",
"with",
"the",
"filename",
"passed",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L976-L994 | [
"def",
"savecopy",
"(",
"self",
",",
"filename",
",",
"lineendings",
"=",
"'default'",
",",
"encoding",
"=",
"'latin-1'",
")",
":",
"self",
".",
"save",
"(",
"filename",
",",
"lineendings",
",",
"encoding",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | IDF.run | Run an IDF file with a given EnergyPlus weather file. This is a
wrapper for the EnergyPlus command line interface.
Parameters
----------
**kwargs
See eppy.runner.functions.run() | eppy/modeleditor.py | def run(self, **kwargs):
"""
Run an IDF file with a given EnergyPlus weather file. This is a
wrapper for the EnergyPlus command line interface.
Parameters
----------
**kwargs
See eppy.runner.functions.run()
"""
# write the IDF to the current ... | def run(self, **kwargs):
"""
Run an IDF file with a given EnergyPlus weather file. This is a
wrapper for the EnergyPlus command line interface.
Parameters
----------
**kwargs
See eppy.runner.functions.run()
"""
# write the IDF to the current ... | [
"Run",
"an",
"IDF",
"file",
"with",
"a",
"given",
"EnergyPlus",
"weather",
"file",
".",
"This",
"is",
"a",
"wrapper",
"for",
"the",
"EnergyPlus",
"command",
"line",
"interface",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/modeleditor.py#L997-L1016 | [
"def",
"run",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# write the IDF to the current directory",
"self",
".",
"saveas",
"(",
"'in.idf'",
")",
"# if `idd` is not passed explicitly, use the IDF.iddname",
"idd",
"=",
"kwargs",
".",
"pop",
"(",
"'idd'",
",",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | readfile | readfile | eppy/EPlusInterfaceFunctions/mylib2.py | def readfile(filename):
"""readfile"""
fhandle = open(filename, 'rb')
data = fhandle.read()
try:
data = data.decode('ISO-8859-2')
except AttributeError:
pass
fhandle.close()
return data | def readfile(filename):
"""readfile"""
fhandle = open(filename, 'rb')
data = fhandle.read()
try:
data = data.decode('ISO-8859-2')
except AttributeError:
pass
fhandle.close()
return data | [
"readfile"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L22-L31 | [
"def",
"readfile",
"(",
"filename",
")",
":",
"fhandle",
"=",
"open",
"(",
"filename",
",",
"'rb'",
")",
"data",
"=",
"fhandle",
".",
"read",
"(",
")",
"try",
":",
"data",
"=",
"data",
".",
"decode",
"(",
"'ISO-8859-2'",
")",
"except",
"AttributeError"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | printdict | printdict | eppy/EPlusInterfaceFunctions/mylib2.py | def printdict(adict):
"""printdict"""
dlist = list(adict.keys())
dlist.sort()
for i in range(0, len(dlist)):
print(dlist[i], adict[dlist[i]]) | def printdict(adict):
"""printdict"""
dlist = list(adict.keys())
dlist.sort()
for i in range(0, len(dlist)):
print(dlist[i], adict[dlist[i]]) | [
"printdict"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L38-L43 | [
"def",
"printdict",
"(",
"adict",
")",
":",
"dlist",
"=",
"list",
"(",
"adict",
".",
"keys",
"(",
")",
")",
"dlist",
".",
"sort",
"(",
")",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"len",
"(",
"dlist",
")",
")",
":",
"print",
"(",
"dlist",
"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | tabfile2list | tabfile2list | eppy/EPlusInterfaceFunctions/mylib2.py | def tabfile2list(fname):
"tabfile2list"
#dat = mylib1.readfileasmac(fname)
#data = string.strip(dat)
data = mylib1.readfileasmac(fname)
#data = data[:-2]#remove the last return
alist = data.split('\r')#since I read it as a mac file
blist = alist[1].split('\t')
clist = []
for num in ... | def tabfile2list(fname):
"tabfile2list"
#dat = mylib1.readfileasmac(fname)
#data = string.strip(dat)
data = mylib1.readfileasmac(fname)
#data = data[:-2]#remove the last return
alist = data.split('\r')#since I read it as a mac file
blist = alist[1].split('\t')
clist = []
for num in ... | [
"tabfile2list"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L45-L59 | [
"def",
"tabfile2list",
"(",
"fname",
")",
":",
"#dat = mylib1.readfileasmac(fname)",
"#data = string.strip(dat)",
"data",
"=",
"mylib1",
".",
"readfileasmac",
"(",
"fname",
")",
"#data = data[:-2]#remove the last return",
"alist",
"=",
"data",
".",
"split",
"(",
"'\\r'"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | tabstr2list | tabstr2list | eppy/EPlusInterfaceFunctions/mylib2.py | def tabstr2list(data):
"""tabstr2list"""
alist = data.split(os.linesep)
blist = alist[1].split('\t')
clist = []
for num in range(0, len(alist)):
ilist = alist[num].split('\t')
clist = clist+[ilist]
cclist = clist[:-1]
#the last element is turning out to be empty
#thi... | def tabstr2list(data):
"""tabstr2list"""
alist = data.split(os.linesep)
blist = alist[1].split('\t')
clist = []
for num in range(0, len(alist)):
ilist = alist[num].split('\t')
clist = clist+[ilist]
cclist = clist[:-1]
#the last element is turning out to be empty
#thi... | [
"tabstr2list"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L61-L73 | [
"def",
"tabstr2list",
"(",
"data",
")",
":",
"alist",
"=",
"data",
".",
"split",
"(",
"os",
".",
"linesep",
")",
"blist",
"=",
"alist",
"[",
"1",
"]",
".",
"split",
"(",
"'\\t'",
")",
"clist",
"=",
"[",
"]",
"for",
"num",
"in",
"range",
"(",
"0... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | list2doe | list2doe | eppy/EPlusInterfaceFunctions/mylib2.py | def list2doe(alist):
"""list2doe"""
theequal = ''
astr = ''
lenj = len(alist)
leni = len(alist[0])
for i in range(0, leni-1):
for j in range(0, lenj):
if j == 0:
astr = astr + alist[j][i + 1] + theequal + alist[j][0] + RET
else:
ast... | def list2doe(alist):
"""list2doe"""
theequal = ''
astr = ''
lenj = len(alist)
leni = len(alist[0])
for i in range(0, leni-1):
for j in range(0, lenj):
if j == 0:
astr = astr + alist[j][i + 1] + theequal + alist[j][0] + RET
else:
ast... | [
"list2doe"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L75-L88 | [
"def",
"list2doe",
"(",
"alist",
")",
":",
"theequal",
"=",
"''",
"astr",
"=",
"''",
"lenj",
"=",
"len",
"(",
"alist",
")",
"leni",
"=",
"len",
"(",
"alist",
"[",
"0",
"]",
")",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"leni",
"-",
"1",
")",... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | tabfile2doefile | tabfile2doefile | eppy/EPlusInterfaceFunctions/mylib2.py | def tabfile2doefile(tabfile, doefile):
"""tabfile2doefile"""
alist = tabfile2list(tabfile)
astr = list2doe(alist)
mylib1.write_str2file(doefile, astr) | def tabfile2doefile(tabfile, doefile):
"""tabfile2doefile"""
alist = tabfile2list(tabfile)
astr = list2doe(alist)
mylib1.write_str2file(doefile, astr) | [
"tabfile2doefile"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L90-L94 | [
"def",
"tabfile2doefile",
"(",
"tabfile",
",",
"doefile",
")",
":",
"alist",
"=",
"tabfile2list",
"(",
"tabfile",
")",
"astr",
"=",
"list2doe",
"(",
"alist",
")",
"mylib1",
".",
"write_str2file",
"(",
"doefile",
",",
"astr",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | makedoedict | makedoedict | eppy/EPlusInterfaceFunctions/mylib2.py | def makedoedict(str1):
"""makedoedict"""
blocklist = str1.split('..')
blocklist = blocklist[:-1]#remove empty item after last '..'
blockdict = {}
belongsdict = {}
for num in range(0, len(blocklist)):
blocklist[num] = blocklist[num].strip()
linelist = blocklist[num].split(os.lines... | def makedoedict(str1):
"""makedoedict"""
blocklist = str1.split('..')
blocklist = blocklist[:-1]#remove empty item after last '..'
blockdict = {}
belongsdict = {}
for num in range(0, len(blocklist)):
blocklist[num] = blocklist[num].strip()
linelist = blocklist[num].split(os.lines... | [
"makedoedict"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L102-L121 | [
"def",
"makedoedict",
"(",
"str1",
")",
":",
"blocklist",
"=",
"str1",
".",
"split",
"(",
"'..'",
")",
"blocklist",
"=",
"blocklist",
"[",
":",
"-",
"1",
"]",
"#remove empty item after last '..'",
"blockdict",
"=",
"{",
"}",
"belongsdict",
"=",
"{",
"}",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | makedoetree | makedoetree | eppy/EPlusInterfaceFunctions/mylib2.py | def makedoetree(ddict, bdict):
"""makedoetree"""
dlist = list(ddict.keys())
blist = list(bdict.keys())
dlist.sort()
blist.sort()
#make space dict
doesnot = 'DOES NOT'
lst = []
for num in range(0, len(blist)):
if bdict[blist[num]] == doesnot:#belong
lst = lst + [bl... | def makedoetree(ddict, bdict):
"""makedoetree"""
dlist = list(ddict.keys())
blist = list(bdict.keys())
dlist.sort()
blist.sort()
#make space dict
doesnot = 'DOES NOT'
lst = []
for num in range(0, len(blist)):
if bdict[blist[num]] == doesnot:#belong
lst = lst + [bl... | [
"makedoetree"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L123-L173 | [
"def",
"makedoetree",
"(",
"ddict",
",",
"bdict",
")",
":",
"dlist",
"=",
"list",
"(",
"ddict",
".",
"keys",
"(",
")",
")",
"blist",
"=",
"list",
"(",
"bdict",
".",
"keys",
"(",
")",
")",
"dlist",
".",
"sort",
"(",
")",
"blist",
".",
"sort",
"(... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | tree2doe | tree2doe | eppy/EPlusInterfaceFunctions/mylib2.py | def tree2doe(str1):
"""tree2doe"""
retstuff = makedoedict(str1)
ddict = makedoetree(retstuff[0], retstuff[1])
ddict = retstuff[0]
retstuff[1] = {}# don't need it anymore
str1 = ''#just re-using it
l1list = list(ddict.keys())
l1list.sort()
for i in range(0, len(l1list)):
str1... | def tree2doe(str1):
"""tree2doe"""
retstuff = makedoedict(str1)
ddict = makedoetree(retstuff[0], retstuff[1])
ddict = retstuff[0]
retstuff[1] = {}# don't need it anymore
str1 = ''#just re-using it
l1list = list(ddict.keys())
l1list.sort()
for i in range(0, len(l1list)):
str1... | [
"tree2doe"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L175-L195 | [
"def",
"tree2doe",
"(",
"str1",
")",
":",
"retstuff",
"=",
"makedoedict",
"(",
"str1",
")",
"ddict",
"=",
"makedoetree",
"(",
"retstuff",
"[",
"0",
"]",
",",
"retstuff",
"[",
"1",
"]",
")",
"ddict",
"=",
"retstuff",
"[",
"0",
"]",
"retstuff",
"[",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | mtabstr2doestr | mtabstr2doestr | eppy/EPlusInterfaceFunctions/mylib2.py | def mtabstr2doestr(st1):
"""mtabstr2doestr"""
seperator = '$ =============='
alist = st1.split(seperator)
#this removes all the tabs that excel
#puts after the seperator and before the next line
for num in range(0, len(alist)):
alist[num] = alist[num].lstrip()
st2 = ''
for num i... | def mtabstr2doestr(st1):
"""mtabstr2doestr"""
seperator = '$ =============='
alist = st1.split(seperator)
#this removes all the tabs that excel
#puts after the seperator and before the next line
for num in range(0, len(alist)):
alist[num] = alist[num].lstrip()
st2 = ''
for num i... | [
"mtabstr2doestr"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L197-L219 | [
"def",
"mtabstr2doestr",
"(",
"st1",
")",
":",
"seperator",
"=",
"'$ =============='",
"alist",
"=",
"st1",
".",
"split",
"(",
"seperator",
")",
"#this removes all the tabs that excel",
"#puts after the seperator and before the next line",
"for",
"num",
"in",
"range",
"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | getoneblock | get the block bounded by start and end
doesn't work for multiple blocks | eppy/EPlusInterfaceFunctions/mylib2.py | def getoneblock(astr, start, end):
"""get the block bounded by start and end
doesn't work for multiple blocks"""
alist = astr.split(start)
astr = alist[-1]
alist = astr.split(end)
astr = alist[0]
return astr | def getoneblock(astr, start, end):
"""get the block bounded by start and end
doesn't work for multiple blocks"""
alist = astr.split(start)
astr = alist[-1]
alist = astr.split(end)
astr = alist[0]
return astr | [
"get",
"the",
"block",
"bounded",
"by",
"start",
"and",
"end",
"doesn",
"t",
"work",
"for",
"multiple",
"blocks"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L221-L228 | [
"def",
"getoneblock",
"(",
"astr",
",",
"start",
",",
"end",
")",
":",
"alist",
"=",
"astr",
".",
"split",
"(",
"start",
")",
"astr",
"=",
"alist",
"[",
"-",
"1",
"]",
"alist",
"=",
"astr",
".",
"split",
"(",
"end",
")",
"astr",
"=",
"alist",
"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | doestr2tabstr | doestr2tabstr | eppy/EPlusInterfaceFunctions/mylib2.py | def doestr2tabstr(astr, kword):
"""doestr2tabstr"""
alist = astr.split('..')
del astr
#strip junk put .. back
for num in range(0, len(alist)):
alist[num] = alist[num].strip()
alist[num] = alist[num] + os.linesep + '..' + os.linesep
alist.pop()
lblock = []
for num in rang... | def doestr2tabstr(astr, kword):
"""doestr2tabstr"""
alist = astr.split('..')
del astr
#strip junk put .. back
for num in range(0, len(alist)):
alist[num] = alist[num].strip()
alist[num] = alist[num] + os.linesep + '..' + os.linesep
alist.pop()
lblock = []
for num in rang... | [
"doestr2tabstr"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L230-L294 | [
"def",
"doestr2tabstr",
"(",
"astr",
",",
"kword",
")",
":",
"alist",
"=",
"astr",
".",
"split",
"(",
"'..'",
")",
"del",
"astr",
"#strip junk put .. back",
"for",
"num",
"in",
"range",
"(",
"0",
",",
"len",
"(",
"alist",
")",
")",
":",
"alist",
"[",... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | myreplace | in string astr replace all occurences of thefind with thereplace | eppy/EPlusInterfaceFunctions/mylib2.py | def myreplace(astr, thefind, thereplace):
"""in string astr replace all occurences of thefind with thereplace"""
alist = astr.split(thefind)
new_s = alist.split(thereplace)
return new_s | def myreplace(astr, thefind, thereplace):
"""in string astr replace all occurences of thefind with thereplace"""
alist = astr.split(thefind)
new_s = alist.split(thereplace)
return new_s | [
"in",
"string",
"astr",
"replace",
"all",
"occurences",
"of",
"thefind",
"with",
"thereplace"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L296-L300 | [
"def",
"myreplace",
"(",
"astr",
",",
"thefind",
",",
"thereplace",
")",
":",
"alist",
"=",
"astr",
".",
"split",
"(",
"thefind",
")",
"new_s",
"=",
"alist",
".",
"split",
"(",
"thereplace",
")",
"return",
"new_s"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | fsliceafter | Return the slice after at sub in string astr | eppy/EPlusInterfaceFunctions/mylib2.py | def fsliceafter(astr, sub):
"""Return the slice after at sub in string astr"""
findex = astr.find(sub)
return astr[findex + len(sub):] | def fsliceafter(astr, sub):
"""Return the slice after at sub in string astr"""
findex = astr.find(sub)
return astr[findex + len(sub):] | [
"Return",
"the",
"slice",
"after",
"at",
"sub",
"in",
"string",
"astr"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L307-L310 | [
"def",
"fsliceafter",
"(",
"astr",
",",
"sub",
")",
":",
"findex",
"=",
"astr",
".",
"find",
"(",
"sub",
")",
"return",
"astr",
"[",
"findex",
"+",
"len",
"(",
"sub",
")",
":",
"]"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | pickledump | same as pickle.dump(theobject, fhandle).takes filename as parameter | eppy/EPlusInterfaceFunctions/mylib2.py | def pickledump(theobject, fname):
"""same as pickle.dump(theobject, fhandle).takes filename as parameter"""
fhandle = open(fname, 'wb')
pickle.dump(theobject, fhandle) | def pickledump(theobject, fname):
"""same as pickle.dump(theobject, fhandle).takes filename as parameter"""
fhandle = open(fname, 'wb')
pickle.dump(theobject, fhandle) | [
"same",
"as",
"pickle",
".",
"dump",
"(",
"theobject",
"fhandle",
")",
".",
"takes",
"filename",
"as",
"parameter"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L317-L320 | [
"def",
"pickledump",
"(",
"theobject",
",",
"fname",
")",
":",
"fhandle",
"=",
"open",
"(",
"fname",
",",
"'wb'",
")",
"pickle",
".",
"dump",
"(",
"theobject",
",",
"fhandle",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | write_str2file | writes a string to file | eppy/EPlusInterfaceFunctions/mylib1.py | def write_str2file(pathname, astr):
"""writes a string to file"""
fname = pathname
fhandle = open(fname, 'wb')
fhandle.write(astr)
fhandle.close() | def write_str2file(pathname, astr):
"""writes a string to file"""
fname = pathname
fhandle = open(fname, 'wb')
fhandle.write(astr)
fhandle.close() | [
"writes",
"a",
"string",
"to",
"file"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib1.py#L14-L19 | [
"def",
"write_str2file",
"(",
"pathname",
",",
"astr",
")",
":",
"fname",
"=",
"pathname",
"fhandle",
"=",
"open",
"(",
"fname",
",",
"'wb'",
")",
"fhandle",
".",
"write",
"(",
"astr",
")",
"fhandle",
".",
"close",
"(",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | vol_tehrahedron | volume of a irregular tetrahedron | eppy/geometry/int2lines.py | def vol_tehrahedron(poly):
"""volume of a irregular tetrahedron"""
a_pnt = np.array(poly[0])
b_pnt = np.array(poly[1])
c_pnt = np.array(poly[2])
d_pnt = np.array(poly[3])
return abs(np.dot(
(a_pnt-d_pnt), np.cross((b_pnt-d_pnt), (c_pnt-d_pnt))) / 6) | def vol_tehrahedron(poly):
"""volume of a irregular tetrahedron"""
a_pnt = np.array(poly[0])
b_pnt = np.array(poly[1])
c_pnt = np.array(poly[2])
d_pnt = np.array(poly[3])
return abs(np.dot(
(a_pnt-d_pnt), np.cross((b_pnt-d_pnt), (c_pnt-d_pnt))) / 6) | [
"volume",
"of",
"a",
"irregular",
"tetrahedron"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/geometry/int2lines.py#L22-L29 | [
"def",
"vol_tehrahedron",
"(",
"poly",
")",
":",
"a_pnt",
"=",
"np",
".",
"array",
"(",
"poly",
"[",
"0",
"]",
")",
"b_pnt",
"=",
"np",
".",
"array",
"(",
"poly",
"[",
"1",
"]",
")",
"c_pnt",
"=",
"np",
".",
"array",
"(",
"poly",
"[",
"2",
"]... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | vol_zone | volume of a zone defined by two polygon bases | eppy/geometry/int2lines.py | def vol_zone(poly1, poly2):
""""volume of a zone defined by two polygon bases """
c_point = central_p(poly1, poly2)
c_point = (c_point[0], c_point[1], c_point[2])
vol_therah = 0
num = len(poly1)
for i in range(num-2):
# the upper part
tehrahedron = [c_point, poly1[0], poly1[i+1],... | def vol_zone(poly1, poly2):
""""volume of a zone defined by two polygon bases """
c_point = central_p(poly1, poly2)
c_point = (c_point[0], c_point[1], c_point[2])
vol_therah = 0
num = len(poly1)
for i in range(num-2):
# the upper part
tehrahedron = [c_point, poly1[0], poly1[i+1],... | [
"volume",
"of",
"a",
"zone",
"defined",
"by",
"two",
"polygon",
"bases"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/geometry/int2lines.py#L43-L66 | [
"def",
"vol_zone",
"(",
"poly1",
",",
"poly2",
")",
":",
"c_point",
"=",
"central_p",
"(",
"poly1",
",",
"poly2",
")",
"c_point",
"=",
"(",
"c_point",
"[",
"0",
"]",
",",
"c_point",
"[",
"1",
"]",
",",
"c_point",
"[",
"2",
"]",
")",
"vol_therah",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | newidf | open a new idf file
easy way to open a new idf file for particular version. Works only id Energyplus of that version is installed.
Parameters
----------
version: string
version of the new file you want to create. Will work only if this version of Energyplus has been installed.
R... | eppy/__init__.py | def newidf(version=None):
"""open a new idf file
easy way to open a new idf file for particular version. Works only id Energyplus of that version is installed.
Parameters
----------
version: string
version of the new file you want to create. Will work only if this version of Energ... | def newidf(version=None):
"""open a new idf file
easy way to open a new idf file for particular version. Works only id Energyplus of that version is installed.
Parameters
----------
version: string
version of the new file you want to create. Will work only if this version of Energ... | [
"open",
"a",
"new",
"idf",
"file",
"easy",
"way",
"to",
"open",
"a",
"new",
"idf",
"file",
"for",
"particular",
"version",
".",
"Works",
"only",
"id",
"Energyplus",
"of",
"that",
"version",
"is",
"installed",
".",
"Parameters",
"----------",
"version",
":"... | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/__init__.py#L25-L45 | [
"def",
"newidf",
"(",
"version",
"=",
"None",
")",
":",
"# noqa: E501",
"if",
"not",
"version",
":",
"version",
"=",
"\"8.9\"",
"import",
"eppy",
".",
"easyopen",
"as",
"easyopen",
"idfstring",
"=",
"\" Version,{};\"",
".",
"format",
"(",
"str",
"(",
"ver... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | openidf | automatically set idd and open idf file. Uses version from idf to set correct idd
It will work under the following circumstances:
- the IDF file should have the VERSION object.
- Needs the version of EnergyPlus installed that matches the IDF version.
- Energyplus should be installed in the default... | eppy/__init__.py | def openidf(fname, idd=None, epw=None):
"""automatically set idd and open idf file. Uses version from idf to set correct idd
It will work under the following circumstances:
- the IDF file should have the VERSION object.
- Needs the version of EnergyPlus installed that matches the IDF version.
... | def openidf(fname, idd=None, epw=None):
"""automatically set idd and open idf file. Uses version from idf to set correct idd
It will work under the following circumstances:
- the IDF file should have the VERSION object.
- Needs the version of EnergyPlus installed that matches the IDF version.
... | [
"automatically",
"set",
"idd",
"and",
"open",
"idf",
"file",
".",
"Uses",
"version",
"from",
"idf",
"to",
"set",
"correct",
"idd",
"It",
"will",
"work",
"under",
"the",
"following",
"circumstances",
":",
"-",
"the",
"IDF",
"file",
"should",
"have",
"the",
... | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/__init__.py#L47-L70 | [
"def",
"openidf",
"(",
"fname",
",",
"idd",
"=",
"None",
",",
"epw",
"=",
"None",
")",
":",
"import",
"eppy",
".",
"easyopen",
"as",
"easyopen",
"return",
"easyopen",
".",
"easyopen",
"(",
"fname",
",",
"idd",
"=",
"idd",
",",
"epw",
"=",
"epw",
")... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | wallinterzone | return an wall:interzone object if the bsd (buildingsurface:detailed)
is an interaone wall | eppy/simplesurface.py | def wallinterzone(idf, bsdobject, deletebsd=True, setto000=False):
"""return an wall:interzone object if the bsd (buildingsurface:detailed)
is an interaone wall"""
# ('WALL:INTERZONE', Wall, Surface OR Zone OR OtherSideCoefficients)
# test if it is an exterior wall
if bsdobject.Surface_Type.upper()... | def wallinterzone(idf, bsdobject, deletebsd=True, setto000=False):
"""return an wall:interzone object if the bsd (buildingsurface:detailed)
is an interaone wall"""
# ('WALL:INTERZONE', Wall, Surface OR Zone OR OtherSideCoefficients)
# test if it is an exterior wall
if bsdobject.Surface_Type.upper()... | [
"return",
"an",
"wall",
":",
"interzone",
"object",
"if",
"the",
"bsd",
"(",
"buildingsurface",
":",
"detailed",
")",
"is",
"an",
"interaone",
"wall"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/simplesurface.py#L168-L192 | [
"def",
"wallinterzone",
"(",
"idf",
",",
"bsdobject",
",",
"deletebsd",
"=",
"True",
",",
"setto000",
"=",
"False",
")",
":",
"# ('WALL:INTERZONE', Wall, Surface OR Zone OR OtherSideCoefficients)",
"# test if it is an exterior wall",
"if",
"bsdobject",
".",
"Surface_Type",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | door | return an door object if the fsd (fenestrationsurface:detailed) is
a door | eppy/simplesurface.py | def door(idf, fsdobject, deletebsd=True, setto000=False):
"""return an door object if the fsd (fenestrationsurface:detailed) is
a door"""
# ('DOOR', Door, None)
# test if it is aroof
if fsdobject.Surface_Type.upper() == 'DOOR': # Surface_Type == w
simpleobject = idf.newidfobject('DOOR')
... | def door(idf, fsdobject, deletebsd=True, setto000=False):
"""return an door object if the fsd (fenestrationsurface:detailed) is
a door"""
# ('DOOR', Door, None)
# test if it is aroof
if fsdobject.Surface_Type.upper() == 'DOOR': # Surface_Type == w
simpleobject = idf.newidfobject('DOOR')
... | [
"return",
"an",
"door",
"object",
"if",
"the",
"fsd",
"(",
"fenestrationsurface",
":",
"detailed",
")",
"is",
"a",
"door"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/simplesurface.py#L365-L384 | [
"def",
"door",
"(",
"idf",
",",
"fsdobject",
",",
"deletebsd",
"=",
"True",
",",
"setto000",
"=",
"False",
")",
":",
"# ('DOOR', Door, None)",
"# test if it is aroof",
"if",
"fsdobject",
".",
"Surface_Type",
".",
"upper",
"(",
")",
"==",
"'DOOR'",
":",
"# Su... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | simplesurface | convert a bsd (buildingsurface:detailed) into a simple surface | eppy/simplesurface.py | def simplesurface(idf, bsd, deletebsd=True, setto000=False):
"""convert a bsd (buildingsurface:detailed) into a simple surface"""
funcs = (wallexterior,
walladiabatic,
wallunderground,
wallinterzone,
roof,
ceilingadiabatic,
ceilinginterzone,
floorgroundcon... | def simplesurface(idf, bsd, deletebsd=True, setto000=False):
"""convert a bsd (buildingsurface:detailed) into a simple surface"""
funcs = (wallexterior,
walladiabatic,
wallunderground,
wallinterzone,
roof,
ceilingadiabatic,
ceilinginterzone,
floorgroundcon... | [
"convert",
"a",
"bsd",
"(",
"buildingsurface",
":",
"detailed",
")",
"into",
"a",
"simple",
"surface"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/simplesurface.py#L409-L425 | [
"def",
"simplesurface",
"(",
"idf",
",",
"bsd",
",",
"deletebsd",
"=",
"True",
",",
"setto000",
"=",
"False",
")",
":",
"funcs",
"=",
"(",
"wallexterior",
",",
"walladiabatic",
",",
"wallunderground",
",",
"wallinterzone",
",",
"roof",
",",
"ceilingadiabatic... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | simplefenestration | convert a bsd (fenestrationsurface:detailed) into a simple
fenestrations | eppy/simplesurface.py | def simplefenestration(idf, fsd, deletebsd=True, setto000=False):
"""convert a bsd (fenestrationsurface:detailed) into a simple
fenestrations"""
funcs = (window,
door,
glazeddoor,)
for func in funcs:
fenestration = func(idf, fsd, deletebsd=deletebsd, setto000=setto000)
i... | def simplefenestration(idf, fsd, deletebsd=True, setto000=False):
"""convert a bsd (fenestrationsurface:detailed) into a simple
fenestrations"""
funcs = (window,
door,
glazeddoor,)
for func in funcs:
fenestration = func(idf, fsd, deletebsd=deletebsd, setto000=setto000)
i... | [
"convert",
"a",
"bsd",
"(",
"fenestrationsurface",
":",
"detailed",
")",
"into",
"a",
"simple",
"fenestrations"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/simplesurface.py#L427-L437 | [
"def",
"simplefenestration",
"(",
"idf",
",",
"fsd",
",",
"deletebsd",
"=",
"True",
",",
"setto000",
"=",
"False",
")",
":",
"funcs",
"=",
"(",
"window",
",",
"door",
",",
"glazeddoor",
",",
")",
"for",
"func",
"in",
"funcs",
":",
"fenestration",
"=",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | tdbr2EOL | convert the <br/> in <td> block into line ending (EOL = \n) | eppy/results/readhtml.py | def tdbr2EOL(td):
"""convert the <br/> in <td> block into line ending (EOL = \n)"""
for br in td.find_all("br"):
br.replace_with("\n")
txt = six.text_type(td) # make it back into test
# would be unicode(id) in python2
soup = BeautifulSoup(txt, 'lxml') # read it as a ... | def tdbr2EOL(td):
"""convert the <br/> in <td> block into line ending (EOL = \n)"""
for br in td.find_all("br"):
br.replace_with("\n")
txt = six.text_type(td) # make it back into test
# would be unicode(id) in python2
soup = BeautifulSoup(txt, 'lxml') # read it as a ... | [
"convert",
"the",
"<br",
"/",
">",
"in",
"<td",
">",
"block",
"into",
"line",
"ending",
"(",
"EOL",
"=",
"\\",
"n",
")"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/results/readhtml.py#L24-L33 | [
"def",
"tdbr2EOL",
"(",
"td",
")",
":",
"for",
"br",
"in",
"td",
".",
"find_all",
"(",
"\"br\"",
")",
":",
"br",
".",
"replace_with",
"(",
"\"\\n\"",
")",
"txt",
"=",
"six",
".",
"text_type",
"(",
"td",
")",
"# make it back into test ",
"# would be unico... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | is_simpletable | test if the table has only strings in the cells | eppy/results/readhtml.py | def is_simpletable(table):
"""test if the table has only strings in the cells"""
tds = table('td')
for td in tds:
if td.contents != []:
td = tdbr2EOL(td)
if len(td.contents) == 1:
thecontents = td.contents[0]
if not isinstance(thecontents, Navi... | def is_simpletable(table):
"""test if the table has only strings in the cells"""
tds = table('td')
for td in tds:
if td.contents != []:
td = tdbr2EOL(td)
if len(td.contents) == 1:
thecontents = td.contents[0]
if not isinstance(thecontents, Navi... | [
"test",
"if",
"the",
"table",
"has",
"only",
"strings",
"in",
"the",
"cells"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/results/readhtml.py#L35-L47 | [
"def",
"is_simpletable",
"(",
"table",
")",
":",
"tds",
"=",
"table",
"(",
"'td'",
")",
"for",
"td",
"in",
"tds",
":",
"if",
"td",
".",
"contents",
"!=",
"[",
"]",
":",
"td",
"=",
"tdbr2EOL",
"(",
"td",
")",
"if",
"len",
"(",
"td",
".",
"conten... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | table2matrix | convert a table to a list of lists - a 2D matrix | eppy/results/readhtml.py | def table2matrix(table):
"""convert a table to a list of lists - a 2D matrix"""
if not is_simpletable(table):
raise NotSimpleTable("Not able read a cell in the table as a string")
rows = []
for tr in table('tr'):
row = []
for td in tr('td'):
td = tdbr2EOL(td) # conve... | def table2matrix(table):
"""convert a table to a list of lists - a 2D matrix"""
if not is_simpletable(table):
raise NotSimpleTable("Not able read a cell in the table as a string")
rows = []
for tr in table('tr'):
row = []
for td in tr('td'):
td = tdbr2EOL(td) # conve... | [
"convert",
"a",
"table",
"to",
"a",
"list",
"of",
"lists",
"-",
"a",
"2D",
"matrix"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/results/readhtml.py#L49-L64 | [
"def",
"table2matrix",
"(",
"table",
")",
":",
"if",
"not",
"is_simpletable",
"(",
"table",
")",
":",
"raise",
"NotSimpleTable",
"(",
"\"Not able read a cell in the table as a string\"",
")",
"rows",
"=",
"[",
"]",
"for",
"tr",
"in",
"table",
"(",
"'tr'",
")",... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | table2val_matrix | convert a table to a list of lists - a 2D matrix
Converts numbers to float | eppy/results/readhtml.py | def table2val_matrix(table):
"""convert a table to a list of lists - a 2D matrix
Converts numbers to float"""
if not is_simpletable(table):
raise NotSimpleTable("Not able read a cell in the table as a string")
rows = []
for tr in table('tr'):
row = []
for td in tr('td'):
... | def table2val_matrix(table):
"""convert a table to a list of lists - a 2D matrix
Converts numbers to float"""
if not is_simpletable(table):
raise NotSimpleTable("Not able read a cell in the table as a string")
rows = []
for tr in table('tr'):
row = []
for td in tr('td'):
... | [
"convert",
"a",
"table",
"to",
"a",
"list",
"of",
"lists",
"-",
"a",
"2D",
"matrix",
"Converts",
"numbers",
"to",
"float"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/results/readhtml.py#L66-L87 | [
"def",
"table2val_matrix",
"(",
"table",
")",
":",
"if",
"not",
"is_simpletable",
"(",
"table",
")",
":",
"raise",
"NotSimpleTable",
"(",
"\"Not able read a cell in the table as a string\"",
")",
"rows",
"=",
"[",
"]",
"for",
"tr",
"in",
"table",
"(",
"'tr'",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | titletable | return a list of [(title, table), .....]
title = previous item with a <b> tag
table = rows -> [[cell1, cell2, ..], [cell1, cell2, ..], ..] | eppy/results/readhtml.py | def titletable(html_doc, tofloat=True):
"""return a list of [(title, table), .....]
title = previous item with a <b> tag
table = rows -> [[cell1, cell2, ..], [cell1, cell2, ..], ..]"""
soup = BeautifulSoup(html_doc, "html.parser")
btables = soup.find_all(['b', 'table']) # find all the <b> and <tabl... | def titletable(html_doc, tofloat=True):
"""return a list of [(title, table), .....]
title = previous item with a <b> tag
table = rows -> [[cell1, cell2, ..], [cell1, cell2, ..], ..]"""
soup = BeautifulSoup(html_doc, "html.parser")
btables = soup.find_all(['b', 'table']) # find all the <b> and <tabl... | [
"return",
"a",
"list",
"of",
"[",
"(",
"title",
"table",
")",
".....",
"]"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/results/readhtml.py#L90-L109 | [
"def",
"titletable",
"(",
"html_doc",
",",
"tofloat",
"=",
"True",
")",
":",
"soup",
"=",
"BeautifulSoup",
"(",
"html_doc",
",",
"\"html.parser\"",
")",
"btables",
"=",
"soup",
".",
"find_all",
"(",
"[",
"'b'",
",",
"'table'",
"]",
")",
"# find all the <b>... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | _has_name | checks if soup_obj is really a soup object or just a string
If it has a name it is a soup object | eppy/results/readhtml.py | def _has_name(soup_obj):
"""checks if soup_obj is really a soup object or just a string
If it has a name it is a soup object"""
try:
name = soup_obj.name
if name == None:
return False
return True
except AttributeError:
return False | def _has_name(soup_obj):
"""checks if soup_obj is really a soup object or just a string
If it has a name it is a soup object"""
try:
name = soup_obj.name
if name == None:
return False
return True
except AttributeError:
return False | [
"checks",
"if",
"soup_obj",
"is",
"really",
"a",
"soup",
"object",
"or",
"just",
"a",
"string",
"If",
"it",
"has",
"a",
"name",
"it",
"is",
"a",
"soup",
"object"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/results/readhtml.py#L111-L120 | [
"def",
"_has_name",
"(",
"soup_obj",
")",
":",
"try",
":",
"name",
"=",
"soup_obj",
".",
"name",
"if",
"name",
"==",
"None",
":",
"return",
"False",
"return",
"True",
"except",
"AttributeError",
":",
"return",
"False"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | lines_table | return a list of [(lines, table), .....]
lines = all the significant lines before the table.
These are lines between this table and
the previous table or 'hr' tag
table = rows -> [[cell1, cell2, ..], [cell1, cell2, ..], ..]
The lines act as a description for what is in the table | eppy/results/readhtml.py | def lines_table(html_doc, tofloat=True):
"""return a list of [(lines, table), .....]
lines = all the significant lines before the table.
These are lines between this table and
the previous table or 'hr' tag
table = rows -> [[cell1, cell2, ..], [cell1, cell2, ..], ..]
The lines act as a... | def lines_table(html_doc, tofloat=True):
"""return a list of [(lines, table), .....]
lines = all the significant lines before the table.
These are lines between this table and
the previous table or 'hr' tag
table = rows -> [[cell1, cell2, ..], [cell1, cell2, ..], ..]
The lines act as a... | [
"return",
"a",
"list",
"of",
"[",
"(",
"lines",
"table",
")",
".....",
"]"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/results/readhtml.py#L122-L162 | [
"def",
"lines_table",
"(",
"html_doc",
",",
"tofloat",
"=",
"True",
")",
":",
"soup",
"=",
"BeautifulSoup",
"(",
"html_doc",
",",
"\"html.parser\"",
")",
"linestables",
"=",
"[",
"]",
"elements",
"=",
"soup",
".",
"p",
".",
"next_elements",
"# start after th... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | _make_ntgrid | make a named tuple grid
[["", "a b", "b c", "c d"],
["x y", 1, 2, 3 ],
["y z", 4, 5, 6 ],
["z z", 7, 8, 9 ],]
will return
ntcol(x_y=ntrow(a_b=1, b_c=2, c_d=3),
y_z=ntrow(a_b=4, b_c=5, c_d=6),
z_z=ntrow(a_b=7, b_c=8, c_d=9)) | eppy/results/readhtml.py | def _make_ntgrid(grid):
"""make a named tuple grid
[["", "a b", "b c", "c d"],
["x y", 1, 2, 3 ],
["y z", 4, 5, 6 ],
["z z", 7, 8, 9 ],]
will return
ntcol(x_y=ntrow(a_b=1, b_c=2, c_d=3),
y_z=ntrow(a_b=4, b_c=5, c_d=6),
z_z=ntrow(a_b=7, b_c=8, ... | def _make_ntgrid(grid):
"""make a named tuple grid
[["", "a b", "b c", "c d"],
["x y", 1, 2, 3 ],
["y z", 4, 5, 6 ],
["z z", 7, 8, 9 ],]
will return
ntcol(x_y=ntrow(a_b=1, b_c=2, c_d=3),
y_z=ntrow(a_b=4, b_c=5, c_d=6),
z_z=ntrow(a_b=7, b_c=8, ... | [
"make",
"a",
"named",
"tuple",
"grid"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/results/readhtml.py#L179-L199 | [
"def",
"_make_ntgrid",
"(",
"grid",
")",
":",
"hnames",
"=",
"[",
"_nospace",
"(",
"n",
")",
"for",
"n",
"in",
"grid",
"[",
"0",
"]",
"[",
"1",
":",
"]",
"]",
"vnames",
"=",
"[",
"_nospace",
"(",
"row",
"[",
"0",
"]",
")",
"for",
"row",
"in",... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | onlylegalchar | return only legal chars | eppy/bunchhelpers.py | def onlylegalchar(name):
"""return only legal chars"""
legalchar = ascii_letters + digits + ' '
return ''.join([s for s in name[:] if s in legalchar]) | def onlylegalchar(name):
"""return only legal chars"""
legalchar = ascii_letters + digits + ' '
return ''.join([s for s in name[:] if s in legalchar]) | [
"return",
"only",
"legal",
"chars"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunchhelpers.py#L16-L19 | [
"def",
"onlylegalchar",
"(",
"name",
")",
":",
"legalchar",
"=",
"ascii_letters",
"+",
"digits",
"+",
"' '",
"return",
"''",
".",
"join",
"(",
"[",
"s",
"for",
"s",
"in",
"name",
"[",
":",
"]",
"if",
"s",
"in",
"legalchar",
"]",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | matchfieldnames | Check match between two strings, ignoring case and spaces/underscores.
Parameters
----------
a : str
b : str
Returns
-------
bool | eppy/bunchhelpers.py | def matchfieldnames(field_a, field_b):
"""Check match between two strings, ignoring case and spaces/underscores.
Parameters
----------
a : str
b : str
Returns
-------
bool
"""
normalised_a = field_a.replace(' ', '_').lower()
normalised_b = field_b.replace(' ', ... | def matchfieldnames(field_a, field_b):
"""Check match between two strings, ignoring case and spaces/underscores.
Parameters
----------
a : str
b : str
Returns
-------
bool
"""
normalised_a = field_a.replace(' ', '_').lower()
normalised_b = field_b.replace(' ', ... | [
"Check",
"match",
"between",
"two",
"strings",
"ignoring",
"case",
"and",
"spaces",
"/",
"underscores",
".",
"Parameters",
"----------",
"a",
":",
"str",
"b",
":",
"str",
"Returns",
"-------",
"bool"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunchhelpers.py#L27-L43 | [
"def",
"matchfieldnames",
"(",
"field_a",
",",
"field_b",
")",
":",
"normalised_a",
"=",
"field_a",
".",
"replace",
"(",
"' '",
",",
"'_'",
")",
".",
"lower",
"(",
")",
"normalised_b",
"=",
"field_b",
".",
"replace",
"(",
"' '",
",",
"'_'",
")",
".",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | intinlist | test if int in list | eppy/bunchhelpers.py | def intinlist(lst):
"""test if int in list"""
for item in lst:
try:
item = int(item)
return True
except ValueError:
pass
return False | def intinlist(lst):
"""test if int in list"""
for item in lst:
try:
item = int(item)
return True
except ValueError:
pass
return False | [
"test",
"if",
"int",
"in",
"list"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunchhelpers.py#L45-L53 | [
"def",
"intinlist",
"(",
"lst",
")",
":",
"for",
"item",
"in",
"lst",
":",
"try",
":",
"item",
"=",
"int",
"(",
"item",
")",
"return",
"True",
"except",
"ValueError",
":",
"pass",
"return",
"False"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | replaceint | replace int in lst | eppy/bunchhelpers.py | def replaceint(fname, replacewith='%s'):
"""replace int in lst"""
words = fname.split()
for i, word in enumerate(words):
try:
word = int(word)
words[i] = replacewith
except ValueError:
pass
return ' '.join(words) | def replaceint(fname, replacewith='%s'):
"""replace int in lst"""
words = fname.split()
for i, word in enumerate(words):
try:
word = int(word)
words[i] = replacewith
except ValueError:
pass
return ' '.join(words) | [
"replace",
"int",
"in",
"lst"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunchhelpers.py#L55-L64 | [
"def",
"replaceint",
"(",
"fname",
",",
"replacewith",
"=",
"'%s'",
")",
":",
"words",
"=",
"fname",
".",
"split",
"(",
")",
"for",
"i",
",",
"word",
"in",
"enumerate",
"(",
"words",
")",
":",
"try",
":",
"word",
"=",
"int",
"(",
"word",
")",
"wo... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | cleaniddfield | make all the keys lower case | eppy/bunchhelpers.py | def cleaniddfield(acomm):
"""make all the keys lower case"""
for key in list(acomm.keys()):
val = acomm[key]
acomm[key.lower()] = val
for key in list(acomm.keys()):
val = acomm[key]
if key != key.lower():
acomm.pop(key)
return acomm | def cleaniddfield(acomm):
"""make all the keys lower case"""
for key in list(acomm.keys()):
val = acomm[key]
acomm[key.lower()] = val
for key in list(acomm.keys()):
val = acomm[key]
if key != key.lower():
acomm.pop(key)
return acomm | [
"make",
"all",
"the",
"keys",
"lower",
"case"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunchhelpers.py#L66-L75 | [
"def",
"cleaniddfield",
"(",
"acomm",
")",
":",
"for",
"key",
"in",
"list",
"(",
"acomm",
".",
"keys",
"(",
")",
")",
":",
"val",
"=",
"acomm",
"[",
"key",
"]",
"acomm",
"[",
"key",
".",
"lower",
"(",
")",
"]",
"=",
"val",
"for",
"key",
"in",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | makecsvdiffs | return the csv to be displayed | eppy/useful_scripts/idfdiff.py | def makecsvdiffs(thediffs, dtls, n1, n2):
"""return the csv to be displayed"""
def ishere(val):
if val == None:
return "not here"
else:
return "is here"
rows = []
rows.append(['file1 = %s' % (n1, )])
rows.append(['file2 = %s' % (n2, )])
rows.append('')
... | def makecsvdiffs(thediffs, dtls, n1, n2):
"""return the csv to be displayed"""
def ishere(val):
if val == None:
return "not here"
else:
return "is here"
rows = []
rows.append(['file1 = %s' % (n1, )])
rows.append(['file2 = %s' % (n2, )])
rows.append('')
... | [
"return",
"the",
"csv",
"to",
"be",
"displayed"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/useful_scripts/idfdiff.py#L71-L95 | [
"def",
"makecsvdiffs",
"(",
"thediffs",
",",
"dtls",
",",
"n1",
",",
"n2",
")",
":",
"def",
"ishere",
"(",
"val",
")",
":",
"if",
"val",
"==",
"None",
":",
"return",
"\"not here\"",
"else",
":",
"return",
"\"is here\"",
"rows",
"=",
"[",
"]",
"rows",... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | idfdiffs | return the diffs between the two idfs | eppy/useful_scripts/idfdiff.py | def idfdiffs(idf1, idf2):
"""return the diffs between the two idfs"""
# for any object type, it is sorted by name
thediffs = {}
keys = idf1.model.dtls # undocumented variable
for akey in keys:
idfobjs1 = idf1.idfobjects[akey]
idfobjs2 = idf2.idfobjects[akey]
names = set([get... | def idfdiffs(idf1, idf2):
"""return the diffs between the two idfs"""
# for any object type, it is sorted by name
thediffs = {}
keys = idf1.model.dtls # undocumented variable
for akey in keys:
idfobjs1 = idf1.idfobjects[akey]
idfobjs2 = idf2.idfobjects[akey]
names = set([get... | [
"return",
"the",
"diffs",
"between",
"the",
"two",
"idfs"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/useful_scripts/idfdiff.py#L98-L135 | [
"def",
"idfdiffs",
"(",
"idf1",
",",
"idf2",
")",
":",
"# for any object type, it is sorted by name",
"thediffs",
"=",
"{",
"}",
"keys",
"=",
"idf1",
".",
"model",
".",
"dtls",
"# undocumented variable",
"for",
"akey",
"in",
"keys",
":",
"idfobjs1",
"=",
"idf1... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | printcsv | print the csv | eppy/useful_scripts/idfdiff.py | def printcsv(csvdiffs):
"""print the csv"""
for row in csvdiffs:
print(','.join([str(cell) for cell in row])) | def printcsv(csvdiffs):
"""print the csv"""
for row in csvdiffs:
print(','.join([str(cell) for cell in row])) | [
"print",
"the",
"csv"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/useful_scripts/idfdiff.py#L137-L140 | [
"def",
"printcsv",
"(",
"csvdiffs",
")",
":",
"for",
"row",
"in",
"csvdiffs",
":",
"print",
"(",
"','",
".",
"join",
"(",
"[",
"str",
"(",
"cell",
")",
"for",
"cell",
"in",
"row",
"]",
")",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | heading2table | add heading row to table | eppy/useful_scripts/idfdiff.py | def heading2table(soup, table, row):
"""add heading row to table"""
tr = Tag(soup, name="tr")
table.append(tr)
for attr in row:
th = Tag(soup, name="th")
tr.append(th)
th.append(attr) | def heading2table(soup, table, row):
"""add heading row to table"""
tr = Tag(soup, name="tr")
table.append(tr)
for attr in row:
th = Tag(soup, name="th")
tr.append(th)
th.append(attr) | [
"add",
"heading",
"row",
"to",
"table"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/useful_scripts/idfdiff.py#L142-L149 | [
"def",
"heading2table",
"(",
"soup",
",",
"table",
",",
"row",
")",
":",
"tr",
"=",
"Tag",
"(",
"soup",
",",
"name",
"=",
"\"tr\"",
")",
"table",
".",
"append",
"(",
"tr",
")",
"for",
"attr",
"in",
"row",
":",
"th",
"=",
"Tag",
"(",
"soup",
","... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | row2table | ad a row to the table | eppy/useful_scripts/idfdiff.py | def row2table(soup, table, row):
"""ad a row to the table"""
tr = Tag(soup, name="tr")
table.append(tr)
for attr in row:
td = Tag(soup, name="td")
tr.append(td)
td.append(attr) | def row2table(soup, table, row):
"""ad a row to the table"""
tr = Tag(soup, name="tr")
table.append(tr)
for attr in row:
td = Tag(soup, name="td")
tr.append(td)
td.append(attr) | [
"ad",
"a",
"row",
"to",
"the",
"table"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/useful_scripts/idfdiff.py#L151-L158 | [
"def",
"row2table",
"(",
"soup",
",",
"table",
",",
"row",
")",
":",
"tr",
"=",
"Tag",
"(",
"soup",
",",
"name",
"=",
"\"tr\"",
")",
"table",
".",
"append",
"(",
"tr",
")",
"for",
"attr",
"in",
"row",
":",
"td",
"=",
"Tag",
"(",
"soup",
",",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | printhtml | print the html | eppy/useful_scripts/idfdiff.py | def printhtml(csvdiffs):
"""print the html"""
soup = BeautifulSoup()
html = Tag(soup, name="html")
para1 = Tag(soup, name="p")
para1.append(csvdiffs[0][0])
para2 = Tag(soup, name="p")
para2.append(csvdiffs[1][0])
table = Tag(soup, name="table")
table.attrs.update(dict(border="1"))
... | def printhtml(csvdiffs):
"""print the html"""
soup = BeautifulSoup()
html = Tag(soup, name="html")
para1 = Tag(soup, name="p")
para1.append(csvdiffs[0][0])
para2 = Tag(soup, name="p")
para2.append(csvdiffs[1][0])
table = Tag(soup, name="table")
table.attrs.update(dict(border="1"))
... | [
"print",
"the",
"html"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/useful_scripts/idfdiff.py#L161-L181 | [
"def",
"printhtml",
"(",
"csvdiffs",
")",
":",
"soup",
"=",
"BeautifulSoup",
"(",
")",
"html",
"=",
"Tag",
"(",
"soup",
",",
"name",
"=",
"\"html\"",
")",
"para1",
"=",
"Tag",
"(",
"soup",
",",
"name",
"=",
"\"p\"",
")",
"para1",
".",
"append",
"("... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | extendlist | extend the list so that you have i-th value | eppy/bunch_subclass.py | def extendlist(lst, i, value=''):
"""extend the list so that you have i-th value"""
if i < len(lst):
pass
else:
lst.extend([value, ] * (i - len(lst) + 1)) | def extendlist(lst, i, value=''):
"""extend the list so that you have i-th value"""
if i < len(lst):
pass
else:
lst.extend([value, ] * (i - len(lst) + 1)) | [
"extend",
"the",
"list",
"so",
"that",
"you",
"have",
"i",
"-",
"th",
"value"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunch_subclass.py#L56-L61 | [
"def",
"extendlist",
"(",
"lst",
",",
"i",
",",
"value",
"=",
"''",
")",
":",
"if",
"i",
"<",
"len",
"(",
"lst",
")",
":",
"pass",
"else",
":",
"lst",
".",
"extend",
"(",
"[",
"value",
",",
"]",
"*",
"(",
"i",
"-",
"len",
"(",
"lst",
")",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | addfunctions | add functions to epbunch | eppy/bunch_subclass.py | def addfunctions(abunch):
"""add functions to epbunch"""
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'
# t... | def addfunctions(abunch):
"""add functions to epbunch"""
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'
# t... | [
"add",
"functions",
"to",
"epbunch"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunch_subclass.py#L69-L171 | [
"def",
"addfunctions",
"(",
"abunch",
")",
":",
"key",
"=",
"abunch",
".",
"obj",
"[",
"0",
"]",
".",
"upper",
"(",
")",
"#-----------------",
"# TODO : alternate strategy to avoid listing the objkeys in snames",
"# check if epbunch has field \"Zone_Name\" or \"Building_Surfa... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | getrange | get the ranges for this field | eppy/bunch_subclass.py | def getrange(bch, fieldname):
"""get the ranges for this field"""
keys = ['maximum', 'minimum', 'maximum<', 'minimum>', 'type']
index = bch.objls.index(fieldname)
fielddct_orig = bch.objidd[index]
fielddct = copy.deepcopy(fielddct_orig)
therange = {}
for key in keys:
therange[key] = ... | def getrange(bch, fieldname):
"""get the ranges for this field"""
keys = ['maximum', 'minimum', 'maximum<', 'minimum>', 'type']
index = bch.objls.index(fieldname)
fielddct_orig = bch.objidd[index]
fielddct = copy.deepcopy(fielddct_orig)
therange = {}
for key in keys:
therange[key] = ... | [
"get",
"the",
"ranges",
"for",
"this",
"field"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunch_subclass.py#L380-L399 | [
"def",
"getrange",
"(",
"bch",
",",
"fieldname",
")",
":",
"keys",
"=",
"[",
"'maximum'",
",",
"'minimum'",
",",
"'maximum<'",
",",
"'minimum>'",
",",
"'type'",
"]",
"index",
"=",
"bch",
".",
"objls",
".",
"index",
"(",
"fieldname",
")",
"fielddct_orig",... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | checkrange | throw exception if the out of range | eppy/bunch_subclass.py | def checkrange(bch, fieldname):
"""throw exception if the out of range"""
fieldvalue = bch[fieldname]
therange = bch.getrange(fieldname)
if therange['maximum'] != None:
if fieldvalue > therange['maximum']:
astr = "Value %s is not less or equal to the 'maximum' of %s"
astr... | def checkrange(bch, fieldname):
"""throw exception if the out of range"""
fieldvalue = bch[fieldname]
therange = bch.getrange(fieldname)
if therange['maximum'] != None:
if fieldvalue > therange['maximum']:
astr = "Value %s is not less or equal to the 'maximum' of %s"
astr... | [
"throw",
"exception",
"if",
"the",
"out",
"of",
"range"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunch_subclass.py#L402-L428 | [
"def",
"checkrange",
"(",
"bch",
",",
"fieldname",
")",
":",
"fieldvalue",
"=",
"bch",
"[",
"fieldname",
"]",
"therange",
"=",
"bch",
".",
"getrange",
"(",
"fieldname",
")",
"if",
"therange",
"[",
"'maximum'",
"]",
"!=",
"None",
":",
"if",
"fieldvalue",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | getfieldidd | get the idd dict for this field
Will return {} if the fieldname does not exist | eppy/bunch_subclass.py | def getfieldidd(bch, fieldname):
"""get the idd dict for this field
Will return {} if the fieldname does not exist"""
# print(bch)
try:
fieldindex = bch.objls.index(fieldname)
except ValueError as e:
return {} # the fieldname does not exist
# so there is no idd
... | def getfieldidd(bch, fieldname):
"""get the idd dict for this field
Will return {} if the fieldname does not exist"""
# print(bch)
try:
fieldindex = bch.objls.index(fieldname)
except ValueError as e:
return {} # the fieldname does not exist
# so there is no idd
... | [
"get",
"the",
"idd",
"dict",
"for",
"this",
"field",
"Will",
"return",
"{}",
"if",
"the",
"fieldname",
"does",
"not",
"exist"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunch_subclass.py#L430-L440 | [
"def",
"getfieldidd",
"(",
"bch",
",",
"fieldname",
")",
":",
"# print(bch)",
"try",
":",
"fieldindex",
"=",
"bch",
".",
"objls",
".",
"index",
"(",
"fieldname",
")",
"except",
"ValueError",
"as",
"e",
":",
"return",
"{",
"}",
"# the fieldname does not exist... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | getfieldidd_item | 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 | eppy/bunch_subclass.py | 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
or if the fieldname does not exist"""
fieldidd = getfieldidd(bch, fieldname)
try:
return fieldidd[iddkey]
except KeyError as e:
... | 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
or if the fieldname does not exist"""
fieldidd = getfieldidd(bch, fieldname)
try:
return fieldidd[iddkey]
except KeyError as e:
... | [
"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"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunch_subclass.py#L442-L450 | [
"def",
"getfieldidd_item",
"(",
"bch",
",",
"fieldname",
",",
"iddkey",
")",
":",
"fieldidd",
"=",
"getfieldidd",
"(",
"bch",
",",
"fieldname",
")",
"try",
":",
"return",
"fieldidd",
"[",
"iddkey",
"]",
"except",
"KeyError",
"as",
"e",
":",
"return",
"["... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | isequal | return True if the field is equal to value | eppy/bunch_subclass.py | def isequal(bch, fieldname, value, places=7):
"""return True if the field is equal to value"""
def equalalphanumeric(bch, fieldname, value):
if bch.get_retaincase(fieldname):
return bch[fieldname] == value
else:
return bch[fieldname].upper() == value.upper()
fieldidd... | def isequal(bch, fieldname, value, places=7):
"""return True if the field is equal to value"""
def equalalphanumeric(bch, fieldname, value):
if bch.get_retaincase(fieldname):
return bch[fieldname] == value
else:
return bch[fieldname].upper() == value.upper()
fieldidd... | [
"return",
"True",
"if",
"the",
"field",
"is",
"equal",
"to",
"value"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunch_subclass.py#L459-L475 | [
"def",
"isequal",
"(",
"bch",
",",
"fieldname",
",",
"value",
",",
"places",
"=",
"7",
")",
":",
"def",
"equalalphanumeric",
"(",
"bch",
",",
"fieldname",
",",
"value",
")",
":",
"if",
"bch",
".",
"get_retaincase",
"(",
"fieldname",
")",
":",
"return",... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | getreferingobjs | Get a list of objects that refer to this object | eppy/bunch_subclass.py | def getreferingobjs(referedobj, iddgroups=None, fields=None):
"""Get a list of objects that refer to this object"""
# pseudocode for code below
# referringobjs = []
# referedobj has: -> Name
# -> reference
# for each obj in idf:
# [optional filter -> objects in iddgroup]
... | def getreferingobjs(referedobj, iddgroups=None, fields=None):
"""Get a list of objects that refer to this object"""
# pseudocode for code below
# referringobjs = []
# referedobj has: -> Name
# -> reference
# for each obj in idf:
# [optional filter -> objects in iddgroup]
... | [
"Get",
"a",
"list",
"of",
"objects",
"that",
"refer",
"to",
"this",
"object"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunch_subclass.py#L478-L519 | [
"def",
"getreferingobjs",
"(",
"referedobj",
",",
"iddgroups",
"=",
"None",
",",
"fields",
"=",
"None",
")",
":",
"# pseudocode for code below",
"# referringobjs = []",
"# referedobj has: -> Name",
"# -> reference",
"# for each obj in idf:",
"# [optional filter ... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | get_referenced_object | 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
representing a Material to be fetched using the name of the layer.
Returns the first item found since if th... | eppy/bunch_subclass.py | 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
representing a Material to be fetched using ... | 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
representing a Material to be fetched using ... | [
"Get",
"an",
"object",
"referred",
"to",
"by",
"a",
"field",
"in",
"another",
"object",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunch_subclass.py#L522-L554 | [
"def",
"get_referenced_object",
"(",
"referring_object",
",",
"fieldname",
")",
":",
"idf",
"=",
"referring_object",
".",
"theidf",
"object_list",
"=",
"referring_object",
".",
"getfieldidd_item",
"(",
"fieldname",
",",
"u'object-list'",
")",
"for",
"obj_type",
"in"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | EpBunch.isequal | return True if the field == value
Will retain case if get_retaincase == True
for real value will compare to decimal 'places' | eppy/bunch_subclass.py | 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 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) | [
"return",
"True",
"if",
"the",
"field",
"==",
"value",
"Will",
"retain",
"case",
"if",
"get_retaincase",
"==",
"True",
"for",
"real",
"value",
"will",
"compare",
"to",
"decimal",
"places"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunch_subclass.py#L228-L233 | [
"def",
"isequal",
"(",
"self",
",",
"fieldname",
",",
"value",
",",
"places",
"=",
"7",
")",
":",
"return",
"isequal",
"(",
"self",
",",
"fieldname",
",",
"value",
",",
"places",
"=",
"places",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | EpBunch.getreferingobjs | Get a list of objects that refer to this object | eppy/bunch_subclass.py | def getreferingobjs(self, iddgroups=None, fields=None):
"""Get a list of objects that refer to this object"""
return getreferingobjs(self, iddgroups=iddgroups, fields=fields) | def getreferingobjs(self, iddgroups=None, fields=None):
"""Get a list of objects that refer to this object"""
return getreferingobjs(self, iddgroups=iddgroups, fields=fields) | [
"Get",
"a",
"list",
"of",
"objects",
"that",
"refer",
"to",
"this",
"object"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunch_subclass.py#L235-L237 | [
"def",
"getreferingobjs",
"(",
"self",
",",
"iddgroups",
"=",
"None",
",",
"fields",
"=",
"None",
")",
":",
"return",
"getreferingobjs",
"(",
"self",
",",
"iddgroups",
"=",
"iddgroups",
",",
"fields",
"=",
"fields",
")"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | vol_tehrahedron | volume of a irregular tetrahedron | eppy/geometry/volume_zone.py | def vol_tehrahedron(poly):
"""volume of a irregular tetrahedron"""
p_a = np.array(poly[0])
p_b = np.array(poly[1])
p_c = np.array(poly[2])
p_d = np.array(poly[3])
return abs(np.dot(
np.subtract(p_a, p_d),
np.cross(
np.subtract(p_b, p_d),
np.subtract(p_c, p... | def vol_tehrahedron(poly):
"""volume of a irregular tetrahedron"""
p_a = np.array(poly[0])
p_b = np.array(poly[1])
p_c = np.array(poly[2])
p_d = np.array(poly[3])
return abs(np.dot(
np.subtract(p_a, p_d),
np.cross(
np.subtract(p_b, p_d),
np.subtract(p_c, p... | [
"volume",
"of",
"a",
"irregular",
"tetrahedron"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/geometry/volume_zone.py#L24-L34 | [
"def",
"vol_tehrahedron",
"(",
"poly",
")",
":",
"p_a",
"=",
"np",
".",
"array",
"(",
"poly",
"[",
"0",
"]",
")",
"p_b",
"=",
"np",
".",
"array",
"(",
"poly",
"[",
"1",
"]",
")",
"p_c",
"=",
"np",
".",
"array",
"(",
"poly",
"[",
"2",
"]",
"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | vol | volume of a zone defined by two polygon bases | eppy/geometry/volume_zone.py | def vol(poly1, poly2):
""""volume of a zone defined by two polygon bases """
c_point = central_p(poly1, poly2)
c_point = (c_point[0], c_point[1], c_point[2])
vol_therah = 0
num = len(poly1)
poly1.append(poly1[0])
poly2.append(poly2[0])
for i in range(num - 2):
# the upper part
... | def vol(poly1, poly2):
""""volume of a zone defined by two polygon bases """
c_point = central_p(poly1, poly2)
c_point = (c_point[0], c_point[1], c_point[2])
vol_therah = 0
num = len(poly1)
poly1.append(poly1[0])
poly2.append(poly2[0])
for i in range(num - 2):
# the upper part
... | [
"volume",
"of",
"a",
"zone",
"defined",
"by",
"two",
"polygon",
"bases"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/geometry/volume_zone.py#L42-L63 | [
"def",
"vol",
"(",
"poly1",
",",
"poly2",
")",
":",
"c_point",
"=",
"central_p",
"(",
"poly1",
",",
"poly2",
")",
"c_point",
"=",
"(",
"c_point",
"[",
"0",
"]",
",",
"c_point",
"[",
"1",
"]",
",",
"c_point",
"[",
"2",
"]",
")",
"vol_therah",
"=",... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | makename2refdct | make the name2refs dict in the idd_index | eppy/EPlusInterfaceFunctions/iddindex.py | def makename2refdct(commdct):
"""make the name2refs dict in the idd_index"""
refdct = {}
for comm in commdct: # commdct is a list of dict
try:
idfobj = comm[0]['idfobj'].upper()
field1 = comm[1]
if 'Name' in field1['field']:
references = field1['re... | def makename2refdct(commdct):
"""make the name2refs dict in the idd_index"""
refdct = {}
for comm in commdct: # commdct is a list of dict
try:
idfobj = comm[0]['idfobj'].upper()
field1 = comm[1]
if 'Name' in field1['field']:
references = field1['re... | [
"make",
"the",
"name2refs",
"dict",
"in",
"the",
"idd_index"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/iddindex.py#L51-L63 | [
"def",
"makename2refdct",
"(",
"commdct",
")",
":",
"refdct",
"=",
"{",
"}",
"for",
"comm",
"in",
"commdct",
":",
"# commdct is a list of dict",
"try",
":",
"idfobj",
"=",
"comm",
"[",
"0",
"]",
"[",
"'idfobj'",
"]",
".",
"upper",
"(",
")",
"field1",
"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | makeref2namesdct | make the ref2namesdct in the idd_index | eppy/EPlusInterfaceFunctions/iddindex.py | def makeref2namesdct(name2refdct):
"""make the ref2namesdct in the idd_index"""
ref2namesdct = {}
for key, values in name2refdct.items():
for value in values:
ref2namesdct.setdefault(value, set()).add(key)
return ref2namesdct | def makeref2namesdct(name2refdct):
"""make the ref2namesdct in the idd_index"""
ref2namesdct = {}
for key, values in name2refdct.items():
for value in values:
ref2namesdct.setdefault(value, set()).add(key)
return ref2namesdct | [
"make",
"the",
"ref2namesdct",
"in",
"the",
"idd_index"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/iddindex.py#L65-L71 | [
"def",
"makeref2namesdct",
"(",
"name2refdct",
")",
":",
"ref2namesdct",
"=",
"{",
"}",
"for",
"key",
",",
"values",
"in",
"name2refdct",
".",
"items",
"(",
")",
":",
"for",
"value",
"in",
"values",
":",
"ref2namesdct",
".",
"setdefault",
"(",
"value",
"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | ref2names2commdct | embed ref2names into commdct | eppy/EPlusInterfaceFunctions/iddindex.py | def ref2names2commdct(ref2names, commdct):
"""embed ref2names into commdct"""
for comm in commdct:
for cdct in comm:
try:
refs = cdct['object-list'][0]
validobjects = ref2names[refs]
cdct.update({'validobjects':validobjects})
except... | def ref2names2commdct(ref2names, commdct):
"""embed ref2names into commdct"""
for comm in commdct:
for cdct in comm:
try:
refs = cdct['object-list'][0]
validobjects = ref2names[refs]
cdct.update({'validobjects':validobjects})
except... | [
"embed",
"ref2names",
"into",
"commdct"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/iddindex.py#L73-L83 | [
"def",
"ref2names2commdct",
"(",
"ref2names",
",",
"commdct",
")",
":",
"for",
"comm",
"in",
"commdct",
":",
"for",
"cdct",
"in",
"comm",
":",
"try",
":",
"refs",
"=",
"cdct",
"[",
"'object-list'",
"]",
"[",
"0",
"]",
"validobjects",
"=",
"ref2names",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | area | Calculation of zone area | eppy/geometry/area_zone.py | def area(poly):
"""Calculation of zone area"""
poly_xy = []
num = len(poly)
for i in range(num):
poly[i] = poly[i][0:2] + (0,)
poly_xy.append(poly[i])
return surface.area(poly) | def area(poly):
"""Calculation of zone area"""
poly_xy = []
num = len(poly)
for i in range(num):
poly[i] = poly[i][0:2] + (0,)
poly_xy.append(poly[i])
return surface.area(poly) | [
"Calculation",
"of",
"zone",
"area"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/geometry/area_zone.py#L19-L26 | [
"def",
"area",
"(",
"poly",
")",
":",
"poly_xy",
"=",
"[",
"]",
"num",
"=",
"len",
"(",
"poly",
")",
"for",
"i",
"in",
"range",
"(",
"num",
")",
":",
"poly",
"[",
"i",
"]",
"=",
"poly",
"[",
"i",
"]",
"[",
"0",
":",
"2",
"]",
"+",
"(",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | prevnode | get the pervious component in the loop | eppy/walk_hvac.py | def prevnode(edges, component):
"""get the pervious component in the loop"""
e = edges
c = component
n2c = [(a, b) for a, b in e if type(a) == tuple]
c2n = [(a, b) for a, b in e if type(b) == tuple]
node2cs = [(a, b) for a, b in e if b == c]
c2nodes = []
for node2c in node2cs:
c2... | def prevnode(edges, component):
"""get the pervious component in the loop"""
e = edges
c = component
n2c = [(a, b) for a, b in e if type(a) == tuple]
c2n = [(a, b) for a, b in e if type(b) == tuple]
node2cs = [(a, b) for a, b in e if b == c]
c2nodes = []
for node2c in node2cs:
c2... | [
"get",
"the",
"pervious",
"component",
"in",
"the",
"loop"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/walk_hvac.py#L39-L61 | [
"def",
"prevnode",
"(",
"edges",
",",
"component",
")",
":",
"e",
"=",
"edges",
"c",
"=",
"component",
"n2c",
"=",
"[",
"(",
"a",
",",
"b",
")",
"for",
"a",
",",
"b",
"in",
"e",
"if",
"type",
"(",
"a",
")",
"==",
"tuple",
"]",
"c2n",
"=",
"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | height | height | eppy/geometry/height_surface.py | def height(poly):
"""height"""
num = len(poly)
hgt = 0.0
for i in range(num):
hgt += (poly[i][2])
return hgt/num | def height(poly):
"""height"""
num = len(poly)
hgt = 0.0
for i in range(num):
hgt += (poly[i][2])
return hgt/num | [
"height"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/geometry/height_surface.py#L40-L46 | [
"def",
"height",
"(",
"poly",
")",
":",
"num",
"=",
"len",
"(",
"poly",
")",
"hgt",
"=",
"0.0",
"for",
"i",
"in",
"range",
"(",
"num",
")",
":",
"hgt",
"+=",
"(",
"poly",
"[",
"i",
"]",
"[",
"2",
"]",
")",
"return",
"hgt",
"/",
"num"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | unit_normal | unit normal | eppy/geometry/height_surface.py | def unit_normal(apnt, bpnt, cpnt):
"""unit normal"""
xvar = np.tinylinalg.det([
[1, apnt[1], apnt[2]], [1, bpnt[1], bpnt[2]], [1, cpnt[1], cpnt[2]]])
yvar = np.tinylinalg.det([
[apnt[0], 1, apnt[2]], [bpnt[0], 1, bpnt[2]], [cpnt[0], 1, cpnt[2]]])
zvar = np.tinylinalg.det([
[apnt[... | def unit_normal(apnt, bpnt, cpnt):
"""unit normal"""
xvar = np.tinylinalg.det([
[1, apnt[1], apnt[2]], [1, bpnt[1], bpnt[2]], [1, cpnt[1], cpnt[2]]])
yvar = np.tinylinalg.det([
[apnt[0], 1, apnt[2]], [bpnt[0], 1, bpnt[2]], [cpnt[0], 1, cpnt[2]]])
zvar = np.tinylinalg.det([
[apnt[... | [
"unit",
"normal"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/geometry/height_surface.py#L49-L61 | [
"def",
"unit_normal",
"(",
"apnt",
",",
"bpnt",
",",
"cpnt",
")",
":",
"xvar",
"=",
"np",
".",
"tinylinalg",
".",
"det",
"(",
"[",
"[",
"1",
",",
"apnt",
"[",
"1",
"]",
",",
"apnt",
"[",
"2",
"]",
"]",
",",
"[",
"1",
",",
"bpnt",
"[",
"1",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | Idf_MSequence.insert | Insert an idfobject (bunch) to list1 and its object to list2. | eppy/idf_msequence.py | def insert(self, i, v):
"""Insert an idfobject (bunch) to list1 and its object to list2."""
self.list1.insert(i, v)
self.list2.insert(i, v.obj)
if isinstance(v, EpBunch):
v.theidf = self.theidf | def insert(self, i, v):
"""Insert an idfobject (bunch) to list1 and its object to list2."""
self.list1.insert(i, v)
self.list2.insert(i, v.obj)
if isinstance(v, EpBunch):
v.theidf = self.theidf | [
"Insert",
"an",
"idfobject",
"(",
"bunch",
")",
"to",
"list1",
"and",
"its",
"object",
"to",
"list2",
"."
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/idf_msequence.py#L71-L76 | [
"def",
"insert",
"(",
"self",
",",
"i",
",",
"v",
")",
":",
"self",
".",
"list1",
".",
"insert",
"(",
"i",
",",
"v",
")",
"self",
".",
"list2",
".",
"insert",
"(",
"i",
",",
"v",
".",
"obj",
")",
"if",
"isinstance",
"(",
"v",
",",
"EpBunch",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | grouper | Collect data into fixed-length chunks or blocks | eppy/function_helpers.py | def grouper(num, iterable, fillvalue=None):
"Collect data into fixed-length chunks or blocks"
# grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx
args = [iter(iterable)] * num
return zip_longest(fillvalue=fillvalue, *args) | def grouper(num, iterable, fillvalue=None):
"Collect data into fixed-length chunks or blocks"
# grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx
args = [iter(iterable)] * num
return zip_longest(fillvalue=fillvalue, *args) | [
"Collect",
"data",
"into",
"fixed",
"-",
"length",
"chunks",
"or",
"blocks"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/function_helpers.py#L21-L25 | [
"def",
"grouper",
"(",
"num",
",",
"iterable",
",",
"fillvalue",
"=",
"None",
")",
":",
"# grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx",
"args",
"=",
"[",
"iter",
"(",
"iterable",
")",
"]",
"*",
"num",
"return",
"zip_longest",
"(",
"fillvalue",
"=",
"fillvalue"... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | getcoords | return the coordinates of the surface | eppy/function_helpers.py | def getcoords(ddtt):
"""return the coordinates of the surface"""
n_vertices_index = ddtt.objls.index('Number_of_Vertices')
first_x = n_vertices_index + 1 # X of first coordinate
pts = ddtt.obj[first_x:]
return list(grouper(3, pts)) | def getcoords(ddtt):
"""return the coordinates of the surface"""
n_vertices_index = ddtt.objls.index('Number_of_Vertices')
first_x = n_vertices_index + 1 # X of first coordinate
pts = ddtt.obj[first_x:]
return list(grouper(3, pts)) | [
"return",
"the",
"coordinates",
"of",
"the",
"surface"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/function_helpers.py#L27-L32 | [
"def",
"getcoords",
"(",
"ddtt",
")",
":",
"n_vertices_index",
"=",
"ddtt",
".",
"objls",
".",
"index",
"(",
"'Number_of_Vertices'",
")",
"first_x",
"=",
"n_vertices_index",
"+",
"1",
"# X of first coordinate",
"pts",
"=",
"ddtt",
".",
"obj",
"[",
"first_x",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | buildingname | return building name | eppy/function_helpers.py | def buildingname(ddtt):
"""return building name"""
idf = ddtt.theidf
building = idf.idfobjects['building'.upper()][0]
return building.Name | def buildingname(ddtt):
"""return building name"""
idf = ddtt.theidf
building = idf.idfobjects['building'.upper()][0]
return building.Name | [
"return",
"building",
"name"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/function_helpers.py#L59-L63 | [
"def",
"buildingname",
"(",
"ddtt",
")",
":",
"idf",
"=",
"ddtt",
".",
"theidf",
"building",
"=",
"idf",
".",
"idfobjects",
"[",
"'building'",
".",
"upper",
"(",
")",
"]",
"[",
"0",
"]",
"return",
"building",
".",
"Name"
] | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | cleanupversion | massage the version number so it matches the format of install folder | eppy/easyopen.py | def cleanupversion(ver):
"""massage the version number so it matches the format of install folder"""
lst = ver.split(".")
if len(lst) == 1:
lst.extend(['0', '0'])
elif len(lst) == 2:
lst.extend(['0'])
elif len(lst) > 2:
lst = lst[:3]
lst[2] = '0' # ensure the 3rd number i... | def cleanupversion(ver):
"""massage the version number so it matches the format of install folder"""
lst = ver.split(".")
if len(lst) == 1:
lst.extend(['0', '0'])
elif len(lst) == 2:
lst.extend(['0'])
elif len(lst) > 2:
lst = lst[:3]
lst[2] = '0' # ensure the 3rd number i... | [
"massage",
"the",
"version",
"number",
"so",
"it",
"matches",
"the",
"format",
"of",
"install",
"folder"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/easyopen.py#L32-L43 | [
"def",
"cleanupversion",
"(",
"ver",
")",
":",
"lst",
"=",
"ver",
".",
"split",
"(",
"\".\"",
")",
"if",
"len",
"(",
"lst",
")",
"==",
"1",
":",
"lst",
".",
"extend",
"(",
"[",
"'0'",
",",
"'0'",
"]",
")",
"elif",
"len",
"(",
"lst",
")",
"=="... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
train | getiddfile | find the IDD file of the E+ installation | eppy/easyopen.py | def getiddfile(versionid):
"""find the IDD file of the E+ installation"""
vlist = versionid.split('.')
if len(vlist) == 1:
vlist = vlist + ['0', '0']
elif len(vlist) == 2:
vlist = vlist + ['0']
ver_str = '-'.join(vlist)
eplus_exe, _ = eppy.runner.run_functions.install_paths(ver... | def getiddfile(versionid):
"""find the IDD file of the E+ installation"""
vlist = versionid.split('.')
if len(vlist) == 1:
vlist = vlist + ['0', '0']
elif len(vlist) == 2:
vlist = vlist + ['0']
ver_str = '-'.join(vlist)
eplus_exe, _ = eppy.runner.run_functions.install_paths(ver... | [
"find",
"the",
"IDD",
"file",
"of",
"the",
"E",
"+",
"installation"
] | santoshphilip/eppy | python | https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/easyopen.py#L45-L56 | [
"def",
"getiddfile",
"(",
"versionid",
")",
":",
"vlist",
"=",
"versionid",
".",
"split",
"(",
"'.'",
")",
"if",
"len",
"(",
"vlist",
")",
"==",
"1",
":",
"vlist",
"=",
"vlist",
"+",
"[",
"'0'",
",",
"'0'",
"]",
"elif",
"len",
"(",
"vlist",
")",
... | 55410ff7c11722f35bc4331ff5e00a0b86f787e1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.