Skip to content

Parametric_Results

Weili edited this page Jun 25, 2018 · 3 revisions

Parametric Simulation Results

Results Class

The parametric run has its own result class, which can be found under the helpers module. This class is typically returned from submit_parametric_study or submit_parametric_study_local when the track=True. But you can also get this object from a BuildSimHubAPIClient() instance with a valid project_api_key and a valid model_api_key:

import BuildSimHubAPI as bsh_api
project_api_key = ''
model_api_key = ''
bsh = bsh_api.BuildSimHubAPIClient()
results = bsh.parametric_results(project_api_key, model_api_key)

Parametric Results

- net_site_eui()

Net site energy use intensity - the unit follows the simulation unit setting.

print(results.net_site_eui())
print(results.last_parameter_unit)
#Output:
"""
{'value': [17.83, 20.63, 16.78], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu/ft2
"""

- total_site_eui()

print(results.total_site_eui())
print(results.last_parameter_unit)
#Output: 
"""
{'value': [17.83, 20.63, 16.78], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu/ft2
"""

- not_met_hour_cooling()

print(results.not_met_hour_cooling())
print(results.last_parameter_unit)
#Output:
"""
{'value': [175.0, 222.5, 166.75], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

hr
"""

- not_met_hour_heating()

print(results.not_met_hour_heating())
print(results.last_parameter_unit)
#Output:
"""
{'value': [2.25, 0.5, 3.25], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

hr
"""

- total_end_use_electricity()

print(results.total_end_use_electricity())
print(results.last_parameter_unit)
#Output:
"""
{'value': [117196.24, 140173.59, 103546.84], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- total_end_use_naturalgas()

print(results.total_end_use_naturalgas())
print(results.last_parameter_unit)
#Output:
"""
{'value': [60755.86, 65710.69, 63903.03], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- cooling_electricity()

print(results.cooling_electricity())
print(results.last_parameter_unit)
#Output: 
"""
{'value': [15824.18, 20099.65, 14743.58], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- cooling_naturalgas()

print(results.cooling_naturalgas())
print(results.last_parameter_unit)
#Output:
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- domestic_hotwater_electricity()

print(results.domestic_hotwater_electricity())
print(results.last_parameter_unit)
#Output:
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- domestic_hotwater_naturalgas()

print(results.domestic_hotwater_naturalgas())
print(results.last_parameter_unit)
#Output: 
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- exterior_equipment_electricity()

print(results.exterior_equipment_electricity())
print(results.last_parameter_unit)
#Output: 
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- exterior_equipment_naturalgas()

print(results.exterior_equipment_naturalgas())
print(results.last_parameter_unit)
#Output:
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- exterior_lighting_electricity()

print(results.exterior_lighting_electricity())
print(results.last_parameter_unit)
#Output: 
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- exterior_lighting_naturalgas()

print(results.exterior_lighting_naturalgas())
print(results.last_parameter_unit)
#Output: 
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- fan_electricity()

print(results.fan_electricity()) print(results.last_parameter_unit)
#Output: 
"""
{'value': [9526.93, 12165.0, 8999.14], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- fan_naturalgas()

print(results.fan_naturalgas())
print(results.last_parameter_unit)
#Output: 
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- heating_electricity()

print(results.heating_electricity()) print(results.last_parameter_unit)
#Output:
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- heating_naturalgas()

print(results.heating_naturalgas()) print(results.last_parameter_unit)
#Output: 
"""
{'value': [60755.86, 65710.69, 63903.03], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- heat_rejection_electricity()

print(results.heat_rejection_electricity()) print(results.last_parameter_unit)
#Output: 
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- heat_rejection_naturalgas()

print(results.heat_rejection_naturalgas()) print(results.last_parameter_unit)
#Output:
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- interior_equipment_electricity()

print(results.interior_equipment_electricity()) print(results.last_parameter_unit)
#Output: 
"""
{'value': [45238.33, 45238.33, 45238.33], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- interior_equipment_naturalgas()

print(results.interior_equipment_naturalgas())
print(results.last_parameter_unit)
#Output:
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- interior_lighting_electricity()

print(results.interior_lighting_electricity()) print(results.last_parameter_unit)
#Output:
"""
{'value': [44008.13, 59391.92, 32101.17], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
""" 

- interior_lighting_naturalgas()

print(results.interior_lighting_naturalgas()) print(results.last_parameter_unit)
#Output:
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- pumps_electricity()

print(results.pumps_electricity()) print(results.last_parameter_unit)
#Output:
"""
{'value': [2598.68, 3278.68, 2464.63], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

- pumps_naturalgas()

print(results.pumps_naturalgas()) print(results.last_parameter_unit)
#Output: 
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

Bldg Level Derived Results


This group of functions derives the building level result data from the simulation results and energy models

- bldg_lpd()

Building lighting power density is extracted from Zone Summary table in the HTML.

print(results.bldg_lpd())
print(results.last_parameter_unit)
#Output: 
"""
{'value': [2.9286999999999996, 3.9523999999999995, 2.1363], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
Btu/h-ft2
"""

- bldg_epd()

Building equipment power density is extracted from Zone Summary table in the HTML.

print(results.bldg_epd())
print(results.last_parameter_unit)
#Output:
"""
{'value': [0.0, 0.0, 0.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
Btu/h-ft2
"""

- bldg_ppl()

Building people is extracted from Zone Summary table in the HTML.

print(results.bldg_lpd()) print(results.last_parameter_unit)
#Output:
"""
{'value': [191.95, 191.95, 191.95], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
Btu/h-ft2
"""

- wall_rvalue()

Average wall R value

print(results.wall_rvalue())
print(results.last_parameter_unit)
#Output: 
"""
{'value': [13.88888888888889, 13.88888888888889, 13.88888888888889], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
h-ft2-F / Btu
"""

- roof_rvalue()

Average roof R value

print(results.roof_rvalue()) print(results.last_parameter_unit)
#Output:
"""
{'value': [20.0, 20.0, 20.0], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
h-ft2-F / Btu
"""

- window_uvalue()

Average window u value

print(results.window_uvalue()) print(results.last_parameter_unit)
#Output:
"""
{'value': [0.479, 0.479, 0.479], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
Btu/h-ft2-F
"""

- window_shgc()

Average window SHGC value

print(results.window_uvalue())
#Output:
"""
{'value': [0.382, 0.382, 0.382], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
"""

- roof_absorption()

Average roof absorption value

print(results.roof_absorption())
#Output:
"""
{'value': [0.35, 0.35, 0.35], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
"""

- bldg_infiltration()

Design building infiltration - this method can only extract the value from DesignFlowRate object.

print(results.bldg_infiltration()) print(results.last_parameter_unit)
#Output:
"""
{'value': [0.059972799760861645, 0.059972799760861645, 0.059972799760861645], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
"""

- bldg_water_heater_efficiency()

Average water heater efficiency.

print(results.bldg_water_heater_efficiency())
#Output: If there is not relevant system in the model
# the returned value will be -1
"""
{'value': [-1,-1,-1], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
""" 

- bldg_dx_cooling_efficiency()

Average cooling DX coil efficiency

print(results.bldg_dx_cooling_efficiency())
#Output:
"""
{'value': [-1,-1,-1], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
""" 

- bldg_chiller_efficiency()

Average chiller efficiency

print(results.bldg_chiller_efficiency())
#Output:
"""
{'value': [3.2, 3.2, 3.2], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
""" 

- bldg_electric_boiler_efficiency()

Average electric boilers efficiency

print(results.bldg_electric_boiler_efficiency())
#Output:
"""
{'value': [-1,-1,-1], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
""" 

- bldg_fuel_boiler_efficiency()

Average natural gas boilers efficiency

print(results.bldg_fuel_boiler_efficiency())
#Output:
"""
{'value': [0.88, 0.89, 0.85], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
""" 

- bldg_dx_heating_efficiency()

Average heaing DX coils efficiency

print(results.bldg_dx_heating_efficiency())
#Output:
"""
{'value': [-1,-1,-1], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}
""" 

Building Load

The load function in the parametric results can only extract total heating or cooling load of the building for comparison.

- bldg_load(loadType)

loadType: either 'cooling' or 'heating', default is 'cooling'

print(results.bldg_load())
# Output
"""
{'value': ['123175.56999999998', '153023.48', '116284.42'], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

print(results.bldg_load('heating'))
# Output
"""
{'value': ['-105355.93000000001', '-119210.40999999999', '-103829.02'], 
'model': ['WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85'], 
'model_plot': ['case1', 'case2', 'case3']}

kBtu
"""

Access Individual Parametric Model

It is easy to access every model generated under the parametric run.

  1. Let's get the environment set-up
import BuildSimHub as bsh_api
project_api_key = 'f98aadb3-254f-428d-a321-82a6e4b9424c'  
model_api_key = '60952acf-bde2-44fa-9883-a0a78bf9eb56'

bsh = bsh_api.BuildSimHubAPIClient()
  1. Retrieve the parametric model list
models = bsh.model_list(project_api_key, model_api_key)
print(models)
# Output:
[{'commit_msg': 'WWR: 0.42, LPD: 0.858, HeatingEff: 0.88', 'commit_date': '2018-06-24', 'commit_id': '1-339-751'}, 
{'commit_msg': 'WWR: 0.58, LPD: 1.158, HeatingEff: 0.89', 'commit_date': '2018-06-24', 'commit_id': '1-339-750'}, 
{'commit_msg': 'WWR: 0.4, LPD: 0.626, HeatingEff: 0.85', 'commit_date': '2018-06-24', 'commit_id': '1-339-749'}, 
{'commit_msg': 'WWR: 0.46, LPD: 0.761, HeatingEff: 0.83', 'commit_date': '2018-06-24', 'commit_id': '1-339-748'}]
  1. Post-process the list - dict data structure using pandas
try:  
    import pandas as pd  
except:  
    print("No pandas installed")  
  
df = pd.DataFrame(models)
# we need to drop the seed model
df = df[df.commit_msg != 'INIT']
print(df.to_string())
#Output
"""
   commit_date  commit_id  commit_msg
0   2018-06-24  1-339-751  WWR: 0.42, LPD: 0.858, HeatingEff: 0.88
1   2018-06-24  1-339-750  WWR: 0.58, LPD: 1.158, HeatingEff: 0.89
2   2018-06-24  1-339-749   WWR: 0.4, LPD: 0.626, HeatingEff: 0.85
3   2018-06-24  1-339-748  WWR: 0.46, LPD: 0.761, HeatingEff: 0.83
"""
  1. If we want to split the parameters for model filtering process, we can use this function to do the dataframe restructuring.
def post_process_models(df):
    param_list = list()  
    for index, row in df.iterrows():  
        msg = row['commit_msg']  
        parameters = msg.split(",")  
        data_dict = dict()  
        for k in range(len(parameters)):  
            title, val = parameters[k].split(":")  
            data_dict[title.strip()] = float(val.strip())  
        param_list.append(data_dict)  
    parameter_df = pd.DataFrame(param_list)  
    return pd.concat([self._df, parameter_df], axis=1)

Now we are ready to expand the data frame with parameters

print(post_process_models(df).to_string())
# Output:
"""
  commit_date  commit_id                               commit_msg  HeatingEff    LPD   WWR
0  2018-06-24  1-339-751  WWR: 0.42, LPD: 0.858, HeatingEff: 0.88        0.88  0.858  0.42
1  2018-06-24  1-339-750  WWR: 0.58, LPD: 1.158, HeatingEff: 0.89        0.89  1.158  0.58
2  2018-06-24  1-339-749   WWR: 0.4, LPD: 0.626, HeatingEff: 0.85        0.85  0.626  0.40
"""
  1. Now apply filters for the model selection and retrieve model id:
post_df = post_process_models(df)  
val = post_df.loc[(post_df['HeatingEff'] == 0.88) & (post_df['LPD'] == 0.858)]['commit_id']  
print('Model ID: ' + val.values[0])
# Output:
# 1-339-751
  1. Get the model results object using the retrieved model id
model_id = val.values[0]

results = bsh.model_results(project_api_key, model_id)
print(str(results.net_site_eui()) + ' ' + results.last_parameter_unit)
# Output:
# 17.83 kBtu/ft2

The full script example can be find in Github test folder

Post-process Data

The results data is retrieved in a dict-list data format. However, there are functions that we can use to make this format more user-friendly with the help of pandas. Follow the steps below to format the data.

  1. Retrieve the parametric data from the server
value_data = results.net_site_eui()
value_unit = results.last_parameter_unit
  1. Set-up the post-process module
import BuildSimHubAPI.postprocess as pp
param_data = pp.ParametricPlot(value_data, value_unit)
  1. Check the results!
print(param_data.pandas.df())
# Output
"""    
      HeatingEff    LPD   WWR  Value
case1         0.88  0.858  0.42  17.83
case2         0.89  1.158  0.58  20.63
case3         0.85  0.626  0.40  16.78
"""

The data formated can be further used for plotting and machine learning - check out BuildSim Plot and BuildSim Learn for more information

Clone this wiki locally