topologicpy.EnergyModel module

class topologicpy.EnergyModel.EnergyModel

Bases: object

@staticmethod def ByOSMFile(file):

“”” Creates an EnergyModel from the input OSM file path.

Parameters
pathstring

The path to the input .OSM file.

Returns
openstudio.openstudiomodelcore.Model

The OSM model.

“””
if not file:

print(“EnergyModel.ByOSMFile - Error: The input path is not valid. Returning None.”) return None

osModel = file.read()
if osModel.isNull():

print(“EnergyModel.ByOSMFile - Error: The openstudio model is null. Returning None.”) return None

else:

osModel = osModel.get()

return osModel

Methods

ByOSMPath(path)

Creates an EnergyModel from the input OSM file path.

ByTopology(building[, shadingSurfaces, ...])

Creates an EnergyModel from the input topology and parameters.

ColumnNames(model, reportName, tableName)

Returns the list of column names given an OSM model, report name, and table name.

DefaultConstructionSets(model)

Returns the default construction sets in the input OSM model.

DefaultScheduleSets(model)

Returns the default schedule sets found in the input OSM model.

ExportToGBXML(model, path[, overwrite])

Exports the input OSM model to a GBXML file.

ExportToOSM(model, path[, overwrite])

Exports the input OSM model to an OSM file.

GBXMLString(model)

Returns the GBXML string of the input OSM model.

Query(model[, reportName, reportForString, ...])

Queries the model for values.

ReportNames(model)

Returns the report names found in the input OSM model.

RowNames(model, reportName, tableName)

Returns the list of row names given an OSM model, report name, and table name.

Run(model[, weatherFilePath, osBinaryPath, ...])

Runs an energy simulation.

SpaceColors(model)

Return the space colors found in the input OSM model.

SpaceDictionaries(model)

Return the space dictionaries found in the input OSM model.

SpaceTypeNames(model)

Return the space type names found in the input OSM model.

SpaceTypes(model)

Return the space types found in the input OSM model.

SqlFile(model)

Returns the SQL file found in the input OSM model.

TableNames(model, reportName)

Returns the table names found in the input OSM model and report name.

Topologies(model[, tolerance])

Parameters

Units(model, reportName, tableName, columnName)

Parameters

Version([check, silent])

Returns the OpenStudio SDK version number.

static ByOSMPath(path: str)

Creates an EnergyModel from the input OSM file path.

Parameters
pathstring

The path to the input .OSM file.

Returns
openstudio.openstudiomodelcore.Model

The OSM model.

static ByTopology(building, shadingSurfaces=None, osModelPath: str = None, weatherFilePath: str = None, designDayFilePath: str = None, floorLevels: list = None, buildingName: str = 'TopologicBuilding', buildingType: str = 'Commercial', northAxis: float = 0.0, glazingRatio: float = 0.0, coolingTemp: float = 25.0, heatingTemp: float = 20.0, defaultSpaceType: str = '189.1-2009 - Office - WholeBuilding - Lg Office - CZ4-8', spaceNameKey: str = 'TOPOLOGIC_name', spaceTypeKey: str = 'TOPOLOGIC_type', mantissa: int = 6, tolerance: float = 0.0001)

Creates an EnergyModel from the input topology and parameters.

Parameters
buildingtopologic_core.CellComplex or topologic_core.Cell

The input building topology.

shadingSurfacestopologic_core.Topology , optional

The input topology for shading surfaces. Default is None.

osModelPathstr , optional

The path to the template OSM file. Default is “./assets/EnergyModel/OSMTemplate-OfficeBuilding-3.10.0.osm”.

weatherFilePathstr , optional

The input energy plus weather (epw) file. Default is “./assets/EnergyModel/GBR_London.Gatwick.037760_IWEC.epw”.

designDayFilePathstr , optional

The input design day (ddy) file path. Default is “./assets/EnergyModel/GBR_London.Gatwick.037760_IWEC.ddy”.

floorLevelslist , optional

The list of floor level Z heights including the lowest most and the highest most levels. If set to None, this method will attempt to find the floor levels from the horizontal faces of the input topology.

buildingNamestr , optional

The desired name of the building. Default is “TopologicBuilding”.

buildingTypestr , optional

The building type. Default is “Commercial”.

defaultSpaceTypestr , optional

The default space type to apply to spaces that do not have a type assigned in their dictionary.

northAxisfloat , optional

The counter-clockwise angle in degrees from the positive Y-axis representing the direction of the north axis. Default is 0.0.

glazingRatiofloat , optional

The glazing ratio (ratio of windows to wall) to use for exterior vertical walls that do not have apertures. If you do not wish to use a glazing ratio, set it to 0. Default is 0.

coolingTempfloat , optional

The desired temperature in degrees at which the cooling system should activate. Default is 25.0.

heatingTempfloat , optional

The desired temperature in degrees at which the heating system should activate. Default is 20.0.

spaceNameKeystr , optional

The dictionary key to use to find the space name value. Default is “TOPOLOGIC_name”.

spaceTypeKeystr , optional

The dictionary key to use to find the space type value. Default is “TOPOLOGIC_type”.

mantissaint , optional

The number of decimal places to round the result to. Default is 6.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
openstudio.openstudiomodelcore.Model

The created OSM model.

static ColumnNames(model, reportName, tableName)

Returns the list of column names given an OSM model, report name, and table name.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

reportNamestr

The input report name.

tableNamestr

The input table name.

Returns
list

the list of column names.

static DefaultConstructionSets(model)

Returns the default construction sets in the input OSM model.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

Returns
list

The default construction sets.

static DefaultScheduleSets(model)

Returns the default schedule sets found in the input OSM model.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

Returns
list

The list of default schedule sets.

static ExportToGBXML(model, path, overwrite=False)

Exports the input OSM model to a GBXML file.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

pathstr

The path for saving the file.

overwritebool, optional

If set to True any file with the same name is over-written. Default is False.

Returns
bool

True if the file is written successfully. False otherwise.

static ExportToOSM(model, path, overwrite=False)

Exports the input OSM model to an OSM file.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

pathstr

The path for saving the file.

overwritebool, optional

If set to True any file with the same name is over-written. Default is False.

Returns
bool

True if the file is written successfully. False otherwise.

static GBXMLString(model)

Returns the GBXML string of the input OSM model.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

Returns
str

The gbxml string.

static Query(model, reportName: str = 'HVACSizingSummary', reportForString: str = 'Entire Facility', tableName: str = 'Zone Sensible Cooling', columnName: str = 'Calculated Design Load', rowNames: list = [], units: str = 'W')

Queries the model for values.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

reportNamestr , optional

The input report name. Default is “HVACSizingSummary”.

reportForStringstr, optional

The input report for string. Default is “Entire Facility”.

tableNamestr , optional

The input table name. Default is “Zone Sensible Cooling”.

columnNamestr , optional

The input column name. Default is “Calculated Design Load”.

rowNameslist , optional

The input list of row names. Default is [].

unitsstr , optional

The input units. Default is “W”.

Returns
list

The list of values.

static ReportNames(model)

Returns the report names found in the input OSM model.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

Returns
list

The list of report names found in the input OSM model.

static RowNames(model, reportName, tableName)

Returns the list of row names given an OSM model, report name, and table name.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

reportNamestr

The input name of the report.

tableNamestr

The input name of the table.

Returns
list

The list of row names.

static Run(model, weatherFilePath: str = None, osBinaryPath: str = None, outputFolder: str = None, removeFiles: bool = False)

Runs an energy simulation.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

weatherFilePathstr

The path to the epw weather file.

osBinaryPathstr

The path to the openstudio binary.

outputFolderstr

The path to the output folder.

removeFilesbool , optional

If set to True, the working files are removed at the end of the process. Default is False.

Returns
modelopenstudio.openstudiomodelcore.Model

The simulated OSM model.

static SpaceColors(model)

Return the space colors found in the input OSM model.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

Returns
list

The list of space colors. Each item is a three-item list representing the red, green, and blue values of the color.

static SpaceDictionaries(model)

Return the space dictionaries found in the input OSM model.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

Returns
dict

The dictionary of space types, names, and colors found in the input OSM model. The dictionary has the following keys: - “types” - “names” - “colors”

static SpaceTypeNames(model)

Return the space type names found in the input OSM model.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

Returns
list

The list of space type names

static SpaceTypes(model)

Return the space types found in the input OSM model.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

Returns
list

The list of space types

static SqlFile(model)

Returns the SQL file found in the input OSM model.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

Returns
SQL file

The SQL file found in the input OSM model.

static TableNames(model, reportName)

Returns the table names found in the input OSM model and report name.

Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

reportNamestr

The input report name.

Returns
list

The list of table names found in the input OSM model and report name.

static Topologies(model, tolerance=0.0001)
Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
dict

The dictionary of topologies found in the input OSM model. The keys of the dictionary are: - “cells” - “apertures” - “shadingFaces”

static Units(model, reportName, tableName, columnName)
Parameters
modelopenstudio.openstudiomodelcore.Model

The input OSM model.

reportNamestr

The input report name.

tableNamestr

The input table name.

columnNamestr

The input column name.

Returns
str

The units string found in the input OSM model, report name, table name, and column name.

static Version(check: bool = True, silent: bool = False)

Returns the OpenStudio SDK version number.

Parameters
checkbool , optional

if set to True, the version number is checked with the latest version on PyPi. Default is True.

silentbool , optional

If set to True, error and warning messages are suppressed. Default is False.

Returns
str

The OpenStudio SDK version number.