Skip to content

Commit

Permalink
Merge pull request #383 from NREL/res-wfg-args
Browse files Browse the repository at this point in the history
ResStock-HPXML: resilience and bill arguments
  • Loading branch information
nmerket committed Oct 10, 2023
2 parents 0438864 + c5bb12d commit 49c34aa
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
21 changes: 20 additions & 1 deletion buildstockbatch/workflow_generator/residential_hpxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def validate(cls, cfg):
include_timeseries_zone_temperatures: bool(required=False)
include_timeseries_airflows: bool(required=False)
include_timeseries_weather: bool(required=False)
include_timeseries_resilience: bool(required=False)
timeseries_timestamp_convention: enum('start', 'end', required=False)
timeseries_num_decimal_places: int(required=False)
add_timeseries_dst_column: bool(required=False)
Expand Down Expand Up @@ -387,12 +388,18 @@ def create_osw(self, sim_id, building_id, upgrade_idx):
if 'include_annual_hvac_summary' in sim_out_rep_args_avail:
sim_out_rep_args['include_annual_hvac_summary'] = True

if 'include_annual_resilience' in sim_out_rep_args_avail:
sim_out_rep_args['include_annual_resilience'] = True

if 'include_timeseries_system_use_consumptions' in sim_out_rep_args_avail:
sim_out_rep_args['include_timeseries_system_use_consumptions'] = False

if 'include_timeseries_unmet_hours' in sim_out_rep_args_avail:
sim_out_rep_args['include_timeseries_unmet_hours'] = False

if 'include_timeseries_resilience' in sim_out_rep_args_avail:
sim_out_rep_args['include_timeseries_resilience'] = False

if 'timeseries_num_decimal_places' in sim_out_rep_args_avail:
sim_out_rep_args['timeseries_num_decimal_places'] = 3

Expand All @@ -403,6 +410,18 @@ def create_osw(self, sim_id, building_id, upgrade_idx):
sim_out_rep_args['user_output_variables'] = ','.join([str(s.get('name')) for s in output_variables])
sim_out_rep_args.pop('output_variables')

util_bills_rep_args = {}

measures_dir = os.path.join(buildstock_dir, 'resources/hpxml-measures')
measure_path = os.path.join(measures_dir, 'ReportUtilityBills')
util_bills_rep_args_avail = get_measure_arguments(os.path.join(measure_path, 'measure.xml'))

if 'include_annual_bills' in util_bills_rep_args_avail:
util_bills_rep_args['include_annual_bills'] = True

if 'include_monthly_bills' in util_bills_rep_args_avail:
util_bills_rep_args['include_monthly_bills'] = False

osw = {
'id': sim_id,
'steps': [
Expand Down Expand Up @@ -474,7 +493,7 @@ def create_osw(self, sim_id, building_id, upgrade_idx):
},
{
'measure_dir_name': 'ReportUtilityBills',
'arguments': {}
'arguments': util_bills_rep_args
},
{
'measure_dir_name': 'UpgradeCosts',
Expand Down
8 changes: 6 additions & 2 deletions buildstockbatch/workflow_generator/test_workflow_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def test_residential_hpxml(mocker):
assert simulation_output_step['arguments']['include_annual_component_loads'] is True
assert simulation_output_step['arguments']['include_annual_hot_water_uses'] is True
assert simulation_output_step['arguments']['include_annual_hvac_summary'] is True
assert simulation_output_step['arguments']['include_annual_resilience'] is True
assert simulation_output_step['arguments']['include_timeseries_total_consumptions'] is True
assert simulation_output_step['arguments']['include_timeseries_fuel_consumptions'] is False
assert simulation_output_step['arguments']['include_timeseries_end_use_consumptions'] is True
Expand All @@ -128,6 +129,7 @@ def test_residential_hpxml(mocker):
assert simulation_output_step['arguments']['include_timeseries_zone_temperatures'] is False
assert simulation_output_step['arguments']['include_timeseries_airflows'] is False
assert simulation_output_step['arguments']['include_timeseries_weather'] is False
assert simulation_output_step['arguments']['include_timeseries_resilience'] is False
assert simulation_output_step['arguments']['timeseries_timestamp_convention'] == 'end'
assert simulation_output_step['arguments']['timeseries_num_decimal_places'] == 3
assert simulation_output_step['arguments']['add_timeseries_dst_column'] is True
Expand All @@ -136,8 +138,10 @@ def test_residential_hpxml(mocker):
hpxml_output_step = steps[4]
assert hpxml_output_step['measure_dir_name'] == 'ReportHPXMLOutput'

hpxml_output_step = steps[5]
assert hpxml_output_step['measure_dir_name'] == 'ReportUtilityBills'
utility_bills_step = steps[5]
assert utility_bills_step['measure_dir_name'] == 'ReportUtilityBills'
assert utility_bills_step['arguments']['include_annual_bills'] is True
assert utility_bills_step['arguments']['include_monthly_bills'] is False

upgrade_costs_step = steps[6]
assert upgrade_costs_step['measure_dir_name'] == 'UpgradeCosts'
Expand Down
8 changes: 8 additions & 0 deletions docs/changelog/changelog_dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ Development Changelog

No longer automatically downloads the appropriate singularity image from
S3. Also added validation to ensure the image is in the correct location.

.. change::
:tags: general, feature
:pullreq: 383

For the Residential HPXML Workflow Generator, fixes new ``include_annual_resilience`` argument to true and
adds a new optional ``include_timeseries_resilience`` argument that defaults to false. Also fixes new
``include_annual_bills`` argument to true and ``include_monthly_bills`` argument to false.
1 change: 1 addition & 0 deletions docs/workflow_generators/residential_hpxml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Arguments
- ``include_timeseries_zone_temperatures``: Generates timeseries average temperatures (in deg-F) for each space modeled (e.g., living space, attic, garage, basement, crawlspace, etc.).
- ``include_timeseries_airflows``: Generates timeseries airflow rates (in cfm) for infiltration, mechanical ventilation (including clothes dryer exhaust), natural ventilation, whole house fans.
- ``include_timeseries_weather``: Generates timeseries weather file data including outdoor temperatures, relative humidity, wind speed, and solar.
- ``include_timeseries_resilience``: Generates timeseries resilience outputs.
- ``timeseries_timestamp_convention``: Determines whether timeseries timestamps use the start-of-timestep or end-of-timestep convention. Valid choices are 'start' and 'end'.
- ``timeseries_num_decimal_places``: Allows overriding the default number of decimal places for timeseries output.
- ``add_timeseries_dst_column``: Optionally add, in addition to the default local standard Time column, a local clock TimeDST column. Requires that daylight saving time is enabled.
Expand Down

0 comments on commit 49c34aa

Please sign in to comment.