trynthink / scout

A tool for estimating the future energy use, carbon emissions, and capital and operating cost impacts of energy efficiency and demand flexibility technologies in the U.S. residential and commercial building sectors.
https://scout.energy.gov
Other
58 stars 22 forks source link

Specify ECM definitions with user arguments #372

Closed aspeake closed 2 months ago

aspeake commented 4 months ago

Fixes https://github.com/trynthink/scout/issues/365

Introduces new arguments to allow users to choose a subset of ECM definitions. The summary of updates includes:

Example usage in a yml file is provided below. This example uses a custom ecm_definitions directory, and from those definitions selects two files explicitly as well as all files that match the ecm_files_regex parttern.

ecm_prep:
  ecm_directory: "./my_custom_ecms"
  ecm_files: ["My Custom ECM 1", "My Custom ECM 2"]
  ecm_files_regex: [".*Air Sealing*"] 
trynthink commented 4 months ago

How is run.py finding out what ECMs to include? Is it drawing from generated/ecm_prep.json or is it based on the ECMs specified in the YAML?

aspeake commented 3 months ago

How is run.py finding out what ECMs to include? Is it drawing from generated/ecm_prep.json or is it based on the ECMs specified in the YAML?

run.py is unchanged so it should continue drawing from ecm_prep.json. As touched on in another comment, there may be potential for prepared measures in that file that are not specified in the yaml if ecm_prep.py is run twice. We may want to discuss if/how to address that.

aspeake commented 3 months ago

How is run.py finding out what ECMs to include? Is it drawing from generated/ecm_prep.json or is it based on the ECMs specified in the YAML?

run.py is unchanged so it should continue drawing from ecm_prep.json. As touched on in another comment, there may be potential for prepared measures in that file that are not specified in the yaml if ecm_prep.py is run twice. We may want to discuss if/how to address that.

This will be addressed by setting only the ECM files in the current yml (opts.ecm_files) as active in run_setup.json

aspeake commented 3 months ago

How is run.py finding out what ECMs to include? Is it drawing from generated/ecm_prep.json or is it based on the ECMs specified in the YAML?

run.py is unchanged so it should continue drawing from ecm_prep.json. As touched on in another comment, there may be potential for prepared measures in that file that are not specified in the yaml if ecm_prep.py is run twice. We may want to discuss if/how to address that.

This will be addressed by setting only the ECM files in the current yml (opts.ecm_files) as active in run_setup.json

Fixed in https://github.com/trynthink/scout/pull/372/commits/c8e6bdc234cc9276fa87c27394701a1163a1d8a7

aspeake commented 3 months ago

@trynthink this commit defaults ecm packages to [] and automatically pulls in ECMs if they contribute to a package.

Note that this warning: https://github.com/trynthink/scout/blob/select_ecms/scout/ecm_prep.py#L13139-L13141 is still valid as there could be contributing ECMs listed that do not exist in whatever ECM definitions directory was specified.

This warning is also valid, as the ECMs that are part of a package still do not run individually: https://github.com/trynthink/scout/blob/select_ecms/scout/ecm_prep.py#L13921-L13924