NREL/buildstockbatch

Error running an upgrade with more than 25 options

Closed this issue · 3 comments

Describe the bug
Simulation fails for upgrades that have more than 25 options in it.

To Reproduce
Steps to reproduce the behavior:

  1. This is the yaml file,
schema_version: '0.3'
buildstock_directory: ../resstock-2.5.0  # Relative to this file or absolute
project_directory: project_national  # Relative to buildstock_directory
output_directory: bsb_results
weather_files_url: https://data.nrel.gov/system/files/156/BuildStock_TMY3_FIPS.zip
# weather_files_path: /shared-projects/buildstock/weather/BuildStock_TMY3_FIPS.zip # Relative to this file or absolute path to zipped weather files

sampler:
  type: precomputed
  args:
    sample_file: buildstock.csv

workflow_generator:
  type: residential_default
  args:
    timeseries_csv_export:
      reporting_frequency: Hourly
      include_enduse_subcategories: true

baseline:
  n_buildings_represented: 133172057  # Total number of residential dwelling units in contiguous United States, including unoccupied units, resulting from a census tract level query of ACS 5-yr 2016 (i.e. 2012-2016), using this script: https://github.com/NREL/resstock-estimation/blob/master/sources/spatial/tsv_maker.py.

upgrades:
  - upgrade_name: only-25-options
    options:
      - option: Infiltration|0.25 ACH50
        apply_logic:
          - or:
            - Infiltration|0.25 ACH50
      - option: Infiltration|0.5 ACH50
        apply_logic:
          - or:
            - Infiltration|0.5 ACH50
      - option: Infiltration|0.5 ACH50
        apply_logic:
          - or:
            - Infiltration|0.75 ACH50
      - option: Infiltration|1 ACH50
        apply_logic:
          - or:
            - Infiltration|1 ACH50
      - option: Infiltration|1.5 ACH50
        apply_logic:
          - or:
            - Infiltration|1.5 ACH50
      - option: Infiltration|1.5 ACH50
        apply_logic:
          - or:
            - Infiltration|2 ACH50
      - option: Infiltration|2 ACH50
        apply_logic:
          - or:
            - Infiltration|2.25 ACH50
      - option: Infiltration|2.25 ACH50
        apply_logic:
          - or:
            - Infiltration|3 ACH50
      - option: Infiltration|3 ACH50
        apply_logic:
          - or:
            - Infiltration|3.75 ACH50
      - option: Infiltration|3 ACH50
        apply_logic:
          - or:
            - Infiltration|4 ACH50
      - option: Infiltration|3.75 ACH50
        apply_logic:
          - or:
            - Infiltration|4.5 ACH50
      - option: Infiltration|4 ACH50
        apply_logic:
          - or:
            - Infiltration|5 ACH50
      - option: Infiltration|4.5 ACH50
        apply_logic:
          - or:
            - Infiltration|5.25 ACH50
      - option: Infiltration|5 ACH50
        apply_logic:
          - or:
            - Infiltration|6 ACH50
      - option: Infiltration|5.25 ACH50
        apply_logic:
          - or:
            - Infiltration|7 ACH50
      - option: Infiltration|5.25 ACH50
        apply_logic:
          - or:
            - Infiltration|7 ACH50, 0.5 Shelter Coefficient
      - option: Infiltration|6 ACH50
        apply_logic:
          - or:
            - Infiltration|7.5 ACH50
      - option: Infiltration|7 ACH50
        apply_logic:
          - or:
            - Infiltration|8 ACH50
      - option: Infiltration|8 ACH50
        apply_logic:
          - or:
            - Infiltration|10 ACH50
      - option: Infiltration|10 ACH50
        apply_logic:
          - or:
            - Infiltration|11.25 ACH50
      - option: Infiltration|11.25 ACH50
        apply_logic:
          - or:
            - Infiltration|15 ACH50
      - option: Infiltration|15 ACH50
        apply_logic:
          - or:
            - Infiltration|18.5 ACH50
      - option: Infiltration|15 ACH50
        apply_logic:
          - or:
            - Infiltration|20 ACH50
      - option: Infiltration|20 ACH50
        apply_logic:
          - or:
            - Infiltration|25 ACH50
      - option: Infiltration|25 ACH50
        apply_logic:
          - or:
            - Infiltration|30 ACH50
  - upgrade_name: 4|Attic Air Sealing
    options:
      - option: Infiltration|0.25 ACH50
        apply_logic:
          - or:
            - Infiltration|0.25 ACH50
      - option: Infiltration|0.5 ACH50
        apply_logic:
          - or:
            - Infiltration|0.5 ACH50
      - option: Infiltration|0.5 ACH50
        apply_logic:
          - or:
            - Infiltration|0.75 ACH50
      - option: Infiltration|1 ACH50
        apply_logic:
          - or:
            - Infiltration|1 ACH50
      - option: Infiltration|1.5 ACH50
        apply_logic:
          - or:
            - Infiltration|1.5 ACH50
      - option: Infiltration|1.5 ACH50
        apply_logic:
          - or:
            - Infiltration|2 ACH50
      - option: Infiltration|2 ACH50
        apply_logic:
          - or:
            - Infiltration|2.25 ACH50
      - option: Infiltration|2.25 ACH50
        apply_logic:
          - or:
            - Infiltration|3 ACH50
      - option: Infiltration|3 ACH50
        apply_logic:
          - or:
            - Infiltration|3.75 ACH50
      - option: Infiltration|3 ACH50
        apply_logic:
          - or:
            - Infiltration|4 ACH50
      - option: Infiltration|3.75 ACH50
        apply_logic:
          - or:
            - Infiltration|4.5 ACH50
      - option: Infiltration|4 ACH50
        apply_logic:
          - or:
            - Infiltration|5 ACH50
      - option: Infiltration|4.5 ACH50
        apply_logic:
          - or:
            - Infiltration|5.25 ACH50
      - option: Infiltration|5 ACH50
        apply_logic:
          - or:
            - Infiltration|6 ACH50
      - option: Infiltration|5.25 ACH50
        apply_logic:
          - or:
            - Infiltration|7 ACH50
      - option: Infiltration|5.25 ACH50
        apply_logic:
          - or:
            - Infiltration|7 ACH50, 0.5 Shelter Coefficient
      - option: Infiltration|6 ACH50
        apply_logic:
          - or:
            - Infiltration|7.5 ACH50
      - option: Infiltration|7 ACH50
        apply_logic:
          - or:
            - Infiltration|8 ACH50
      - option: Infiltration|8 ACH50
        apply_logic:
          - or:
            - Infiltration|10 ACH50
      - option: Infiltration|10 ACH50
        apply_logic:
          - or:
            - Infiltration|11.25 ACH50
      - option: Infiltration|11.25 ACH50
        apply_logic:
          - or:
            - Infiltration|15 ACH50
      - option: Infiltration|15 ACH50
        apply_logic:
          - or:
            - Infiltration|18.5 ACH50
      - option: Infiltration|15 ACH50
        apply_logic:
          - or:
            - Infiltration|20 ACH50
      - option: Infiltration|20 ACH50
        apply_logic:
          - or:
            - Infiltration|25 ACH50
      - option: Infiltration|25 ACH50
        apply_logic:
          - or:
            - Infiltration|30 ACH50
      - option: Infiltration|30 ACH50
        apply_logic:
          - or:
            - Infiltration|40 ACH50
      - option: Infiltration|40 ACH50
        apply_logic:
          - or:
            - Infiltration|50 ACH50

aws:
  # The job_identifier should be unique, start with alpha, not include dashes, and limited to 10 chars or data loss can occur
  job_identifier: eshu1
  s3:
    bucket: xyz
    prefix: test/baseline19
  emr:
    worker_instance_count: 1
  region: us-west-2
  use_spot: false
  batch_array_size: 2
  # To receive email updates on job progress accept the request to receive emails that will be sent from Amazon
  notifications_email: abc@xyz.com

postprocessing:
  aws:
    region_name: 'us-west-2'
    s3:
      bucket: eshu-icf2
      prefix: test/baseline19
    athena:
      glue_service_role: service-role/AWSGlueServiceRole-default
      database_name: testing
      max_crawling_time: 300 #time to wait for the crawler to complete before aborting it

The second upgrade 4|Attic Air Sealing is the upgrade I'm interested in, and it always fails with the error could not find argument 'option_26' in argument_map.

I double checked that all the options were in the options_lookup.tsv and also ran another simulation (not in the above yaml file) with just the option that was causing the error and that worked fine too. I ran yet another simulation (not in the above yaml file) with >25 options and that failed with the same error - could not find argument 'option_26' in argument_map. This time the 'option_26' was some other option, which leads me to believe it's not the option that's causing the problem, but the number of options.

I ran the above simulation to confirm that buildstockbatch fails for upgrades with more than 25 options, and it did confirm my suspicions. The first upgrade only-25-options runs just fine but the second upgrade 4|Attic Air Sealing fails. The first upgrade is the same as the second upgrade with the last two options cut off to cap the number of options at 25.

Expected behavior
I expected both upgrades to run successfully. However, the first upgrade runs successfully, while the second upgrade does not.

Logs

This is the error log in os_stdout.log file,

[11:00:48.381745 ERROR] Could not find argument 'option_26' in argument_map
	:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/util/measure.rb:210:in `apply_arguments_2'
	:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/util/measure.rb:439:in `block in apply_measure'
	:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/util/measure.rb:429:in `each'
	:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/util/measure.rb:429:in `apply_measure'
	:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/util/measure.rb:114:in `block in apply_measures'
	:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/util/measure.rb:67:in `each_index'
	:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/util/measure.rb:67:in `apply_measures'
	:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/jobs/run_os_measures.rb:70:in `perform'
	:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/run.rb:291:in `step'
	:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/run.rb:233:in `run'
	:/openstudio_cli.rb:1067:in `execute'
	:/openstudio_cli.rb:803:in `execute'
	:/openstudio_cli.rb:1855:in `<main>'
	eval:186:in `eval'
	eval:186:in `require_embedded_absolute'
	eval:171:in `block in require_embedded'
	eval:165:in `each'
	eval:165:in `require_embedded'
	eval:124:in `require'
	eval:3:in `<main>'

This is the in.osw file,

            "measure_dir_name": "ApplyUpgrade",
            "arguments": {
                "run_measure": 1,
                "upgrade_name": "4|Attic Air Sealing",
                "option_1": "Infiltration|0.25 ACH50",
                "option_1_apply_logic": "((Infiltration|0.25 ACH50))",
                "option_2": "Infiltration|0.5 ACH50",
                "option_2_apply_logic": "((Infiltration|0.5 ACH50))",
                "option_3": "Infiltration|0.5 ACH50",
                "option_3_apply_logic": "((Infiltration|0.75 ACH50))",
                "option_4": "Infiltration|1 ACH50",
                "option_4_apply_logic": "((Infiltration|1 ACH50))",
                "option_5": "Infiltration|1.5 ACH50",
                "option_5_apply_logic": "((Infiltration|1.5 ACH50))",
                "option_6": "Infiltration|1.5 ACH50",
                "option_6_apply_logic": "((Infiltration|2 ACH50))",
                "option_7": "Infiltration|2 ACH50",
                "option_7_apply_logic": "((Infiltration|2.25 ACH50))",
                "option_8": "Infiltration|2.25 ACH50",
                "option_8_apply_logic": "((Infiltration|3 ACH50))",
                "option_9": "Infiltration|3 ACH50",
                "option_9_apply_logic": "((Infiltration|3.75 ACH50))",
                "option_10": "Infiltration|3 ACH50",
                "option_10_apply_logic": "((Infiltration|4 ACH50))",
                "option_11": "Infiltration|3.75 ACH50",
                "option_11_apply_logic": "((Infiltration|4.5 ACH50))",
                "option_12": "Infiltration|4 ACH50",
                "option_12_apply_logic": "((Infiltration|5 ACH50))",
                "option_13": "Infiltration|4.5 ACH50",
                "option_13_apply_logic": "((Infiltration|5.25 ACH50))",
                "option_14": "Infiltration|5 ACH50",
                "option_14_apply_logic": "((Infiltration|6 ACH50))",
                "option_15": "Infiltration|5.25 ACH50",
                "option_15_apply_logic": "((Infiltration|7 ACH50))",
                "option_16": "Infiltration|5.25 ACH50",
                "option_16_apply_logic": "((Infiltration|7 ACH50, 0.5 Shelter Coefficient))",
                "option_17": "Infiltration|6 ACH50",
                "option_17_apply_logic": "((Infiltration|7.5 ACH50))",
                "option_18": "Infiltration|7 ACH50",
                "option_18_apply_logic": "((Infiltration|8 ACH50))",
                "option_19": "Infiltration|8 ACH50",
                "option_19_apply_logic": "((Infiltration|10 ACH50))",
                "option_20": "Infiltration|10 ACH50",
                "option_20_apply_logic": "((Infiltration|11.25 ACH50))",
                "option_21": "Infiltration|11.25 ACH50",
                "option_21_apply_logic": "((Infiltration|15 ACH50))",
                "option_22": "Infiltration|15 ACH50",
                "option_22_apply_logic": "((Infiltration|18.5 ACH50))",
                "option_23": "Infiltration|15 ACH50",
                "option_23_apply_logic": "((Infiltration|20 ACH50))",
                "option_24": "Infiltration|20 ACH50",
                "option_24_apply_logic": "((Infiltration|25 ACH50))",
                "option_25": "Infiltration|25 ACH50",
                "option_25_apply_logic": "((Infiltration|30 ACH50))",
                "option_26": "Infiltration|30 ACH50",
                "option_26_apply_logic": "((Infiltration|40 ACH50))",
                "option_27": "Infiltration|40 ACH50",
                "option_27_apply_logic": "((Infiltration|50 ACH50))"

Platform (please complete the following information):

  • Simulation platform: AWS
  • BuildStockBatch version, branch, or sha: v0.21
  • resstock or comstock repo version, branch, or sha:v2.5.0
  • Local Desktop OS: Windows WSL2

Here is a related issue about it: NREL/resstock#1005.

That helped, thank you!