Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into 348-upload-buildst…
Browse files Browse the repository at this point in the history
…ockcsv-to-s3-during-postprocessing
  • Loading branch information
nmerket committed Oct 10, 2023
2 parents aa4828f + 431cd92 commit 621e574
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
23 changes: 22 additions & 1 deletion buildstockbatch/workflow_generator/residential_hpxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def validate(cls, cfg):
utility-bill-scenario-spec:
scenario_name: str(required=True)
simple_filepath: str(required=False)
detailed_filepath: str(required=False)
elec_fixed_charge: num(required=False)
elec_marginal_rate: num(required=False)
gas_fixed_charge: num(required=False)
Expand Down Expand Up @@ -110,6 +111,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 @@ -299,6 +301,7 @@ def create_osw(self, sim_id, building_id, upgrade_idx):
utility_bills_map = [
['utility_bill_scenario_names', 'scenario_name'],
['utility_bill_simple_filepaths', 'simple_filepath'],
['utility_bill_detailed_filepaths', 'detailed_filepath'],
['utility_bill_electricity_fixed_charges', 'elec_fixed_charge'],
['utility_bill_electricity_marginal_rates', 'elec_marginal_rate'],
['utility_bill_natural_gas_fixed_charges', 'gas_fixed_charge'],
Expand Down Expand Up @@ -387,12 +390,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 +412,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 +495,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
16 changes: 16 additions & 0 deletions docs/changelog/changelog_dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@ 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: 382

For the Residential HPXML Workflow Generator, add a new ``detailed_filepath`` argument
for pointing to user-specified TSV file of electricity tariff file paths. The TSV file can contain
utility rates mapped by State, or any other parameter.

.. 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.

.. change::
:tags: postprocessing, feature
:pullreq: 365
Expand Down
8 changes: 6 additions & 2 deletions docs/workflow_generators/residential_hpxml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Configuration Example
utility_bills:
- scenario_name: Bills1
gas_marginal_rate: 1.05
pv_compensation_type: NetMetering
simulation_output_report:
Expand Down Expand Up @@ -59,7 +60,7 @@ Arguments

- ``scenario_name``: Name of the emissions scenario.
- ``type``: Type of emission (e.g., CO2e, NOx, etc.).
- ``elec_folder``: Folder of schedule files with hourly electricity emissions factors values. Units are kg/MWh. Path is relative to buildstock_directory's resources folder. File names must contain GEA region names.
- ``elec_folder``: Folder of schedule files with hourly electricity emissions factors values. Units are kg/MWh. Folder path is relative to buildstock_directory's `resources`_ folder. File names must contain GEA region names.
- ``gas_value``: Annual emissions factor for natural gas. Units are lb/MBtu (million Btu).
- ``propane_value``: Annual emissions factor for propane. Units are lb/MBtu (million Btu).
- ``oil_value``: Annual emissions factor for fuel oil. Units are lb/MBtu (million Btu).
Expand All @@ -68,7 +69,8 @@ Arguments
- ``utility_bills`` (optional): Add these arguments to the `BuildExistingModel`_ measure for performing utility bill calculations.

- ``scenario_name``: Name of the utility bills scenario.
- ``simple_filepath``: File with all fixed charges / marginal rates for each option of a chosen parameter (e.g., State).
- ``simple_filepath``: TSV file with all fixed charge / marginal rate / PV argument values for each option of a chosen parameter (e.g., State). These will override any fixed charge / marginal rate / PV argument values specified in the YML file. Any blank fields will be defaulted. File path is relative to buildstock_directory's `resources`_ folder.
- ``detailed_filepath``: TSV file with electricity tariff path for each option of a chosen parameter (e.g., County). File may also contain all fixed charge / marginal rate / PV argument values. These will override any fixed charge / marginal rate / PV argument values specified in the YML file. Any blank fields will be defaulted. File path is relative to buildstock_directory's `resources`_ folder. Electricity tariff paths are relative to the parent folder of the ``detailed_filepath`` file.
- ``elec_fixed_charge``: Monthly fixed charge for electricity.
- ``elec_marginal_rate``: Marginal rate for electricity. Units are $/kWh.
- ``gas_fixed_charge``: Monthly fixed charge for natural gas.
Expand Down Expand Up @@ -108,6 +110,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 Expand Up @@ -136,6 +139,7 @@ Arguments
.. _BuildExistingModel: https://github.com/NREL/resstock/blob/develop/measures/BuildExistingModel/measure.xml
.. _ReportSimulationOutput: https://github.com/NREL/resstock/blob/develop/resources/hpxml-measures/ReportSimulationOutput/measure.xml
.. _ServerDirectoryCleanup: https://github.com/NREL/resstock/blob/develop/measures/ServerDirectoryCleanup/measure.xml
.. _resources: https://github.com/NREL/resstock/blob/develop/resources

.. _hpxml-build-existing-model-defaults:

Expand Down

0 comments on commit 621e574

Please sign in to comment.