Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
40 changes: 18 additions & 22 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,32 +60,28 @@ jobs:
env:
branch_ref: ${{ steps.branch_ref.outputs.branch_ref }}
run: |
if [[ $branch_ref == 'refs/heads/master' ]]; then
steps=("ecm_prep" "run")
for step in "${steps[@]}"; do
psrecord --log memory_log_${step}.txt --include-children --interval 1 "python tests/integration_testing/run_workflow.py --run_step $step --yaml tests/integration_testing/integration_test.yml --with_profiler"
(echo -e; echo "# Elapsed time,CPU (%),Peak Real (MB),Peak Virtual (MB)"; grep -v "time" memory_log_${step}.txt | sort -k3 -n -r | head -n 1 | column -t | tr -s '[:blank:]' ',') >> results/profile_${step}.csv
mv memory_log_${step}.txt ./results/
done
else
python tests/integration_testing/run_workflow.py --yaml tests/integration_testing/integration_test.yml
fi
steps=("ecm_prep" "run")
for step in "${steps[@]}"; do
psrecord --log memory_log_${step}.txt --include-children --interval 1 "python tests/integration_testing/run_workflow.py --run_step $step --yaml tests/integration_testing/integration_test.yml --with_profiler"
(echo -e; echo "# Elapsed time,CPU (%),Peak Real (MB),Peak Virtual (MB)"; grep -v "time" memory_log_${step}.txt | sort -k3 -n -r | head -n 1 | column -t | tr -s '[:blank:]' ',') >> results/profile_${step}.csv
mv memory_log_${step}.txt ./results/
done
rm -rf ./tests/integration_testing/results/*
mv ./results/* ./tests/integration_testing/results/
mv ./generated/log_*.txt ./tests/integration_testing/results/ 2>/dev/null
- name: Compare integration test results
run: |
git fetch origin master
branch_name="${{ github.ref }}"
if [[ $(git diff --exit-code origin/master ./tests/integration_testing/results/agg_results.json ./tests/integration_testing/results/ecm_results.json) ]]; then
mkdir tests/integration_testing/base_results
git show origin/master:tests/integration_testing/results/agg_results.json > tests/integration_testing/base_results/agg_results.json
git show origin/master:tests/integration_testing/results/ecm_results.json > tests/integration_testing/base_results/ecm_results.json
git show origin/master:tests/integration_testing/results/plots/tech_potential/Summary_Data-TP.xlsx > tests/integration_testing/base_results/Summary_Data-TP.xlsx
git show origin/master:tests/integration_testing/results/plots/max_adopt_potential/Summary_Data-MAP.xlsx > tests/integration_testing/base_results/Summary_Data-MAP.xlsx
# - name: Compare integration test results
# run: |
# git fetch origin master
# branch_name="${{ github.ref }}"
# if [[ $(git diff --exit-code origin/master ./tests/integration_testing/results/agg_results.json ./tests/integration_testing/results/ecm_results.json) ]]; then
# mkdir tests/integration_testing/base_results
# git show origin/master:tests/integration_testing/results/agg_results.json > tests/integration_testing/base_results/agg_results.json
# git show origin/master:tests/integration_testing/results/ecm_results.json > tests/integration_testing/base_results/ecm_results.json
# git show origin/master:tests/integration_testing/results/plots/tech_potential/Summary_Data-TP.xlsx > tests/integration_testing/base_results/Summary_Data-TP.xlsx
# git show origin/master:tests/integration_testing/results/plots/max_adopt_potential/Summary_Data-MAP.xlsx > tests/integration_testing/base_results/Summary_Data-MAP.xlsx

python tests/integration_testing/compare_results.py --base-dir tests/integration_testing/base_results --new-dir tests/integration_testing/results
fi
# python tests/integration_testing/compare_results.py --base-dir tests/integration_testing/base_results --new-dir tests/integration_testing/results
# fi
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ jobs:
- name: Check Python code quality
run: flake8 --exclude docs/conf.py --max-line-length=100

python-tests:
runs-on: ubuntu-latest
# python-tests:
# runs-on: ubuntu-latest

# Specify python versions to run
strategy:
matrix:
python: ['3.10', '3.11', '3.12']
# # Specify python versions to run
# strategy:
# matrix:
# python: ['3.10', '3.11', '3.12']

steps:
- name: Get contents from tip of branch on push
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install scout package
run: |
python -m pip install --upgrade pip
pip install .
- name: Run tests
run: python -m unittest discover -p '*_test.py' tests/
# steps:
# - name: Get contents from tip of branch on push
# uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python }}
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python }}
# - name: Install scout package
# run: |
# python -m pip install --upgrade pip
# pip install .
# - name: Run tests
# run: python -m unittest discover -p '*_test.py' tests/

check-docs:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:

check-PR:
# Check if there is a PR - allows one main workflow with dependency on previous jobs
needs: [code-quality-checks, python-tests, check-docs]
needs: [code-quality-checks, check-docs]
runs-on: ubuntu-latest
outputs:
PR_status: ${{ steps.PR.outputs.pr_found }}
Expand All @@ -94,9 +94,9 @@ jobs:

integration-tests:
needs: [check-PR]
if: |
(needs.check-PR.outputs.PR_status == 'true' && fromJSON(needs.check-PR.outputs.PR).base.ref == 'master') ||
(github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master' && github.event.pull_request.draft == false) ||
github.ref == 'refs/heads/master'
# if: |
# (needs.check-PR.outputs.PR_status == 'true' && fromJSON(needs.check-PR.outputs.PR).base.ref == 'master') ||
# (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master' && github.event.pull_request.draft == false) ||
# github.ref == 'refs/heads/master'
uses: ./.github/workflows/integration_tests.yml
secrets: inherit
100 changes: 100 additions & 0 deletions ecm_definitions/(C) Ref. Case ASHP (RTU).json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"name": "(C) Ref. Case ASHP (RTU)",
"_description": "Ref. case central air source heat pump heating and cooling plus ventilation",
"measure_type": "fulll service",
"market_entry_year": 2025,
"market_exit_year": null,
"min_eff_elec_flag": null,
"ref_case_flag": "yes",
"climate_zone": "all",
"bldg_type": "all commercial",
"structure_type": "all",
"end_use": [
"heating",
"cooling",
"ventilation"
],
"fuel_type": "electricity",
"fuel_switch_to": null,
"backup_fuel_fraction": null,
"technology": [
"rooftop_ASHP-heat",
"rooftop_ASHP-cool",
"all ventilation"
],
"htcl_tech_link": null,
"tech_switch_to": null,
"energy_efficiency": {
"rooftop_ASHP-heat": 3.4,
"rooftop_ASHP-cool": 3.4,
"CAV_Vent": 0.0,
"VAV_Vent": 0.0
},
"energy_efficiency_units": {
"heating": "BTU out/BTU in",
"cooling": "BTU out/BTU in",
"ventilation": "relative savings (constant)"
},
"energy_efficiency_source": {
"notes": "Typical efficiency level in 2023.",
"source_data": {
"title": "Updated Buildings Sector Appliance and Equipment Costs and Efficiencies",
"author": "U.S. Energy Information Administration",
"year": 2023,
"pages": 139,
"url": "https://www.eia.gov/analysis/studies/buildings/equipcosts/pdf/full.pdf"
}
},
"installed_cost": {
"rooftop_ASHP-heat": {
"new": 163.3,
"existing": 170.4
},
"rooftop_ASHP-cool": {
"new": 0.0,
"existing": 0.0
},
"CAV_Vent": 0.0,
"VAV_Vent": 0.0
},
"cost_units": "2023$/kBtu/h heating",
"installed_cost_source": {
"notes": "Typical efficiency costs in 2023, normalized by capacity",
"source_data": "Buildings Annual Technology Baseline. NREL, forthcoming"
},
"add_elec_infr_cost": null,
"product_lifetime": 15.0,
"product_lifetime_units": "years",
"product_lifetime_source": {
"notes": "Average of typical residential air source heat pump lifetime",
"source_data": {
"title": "Updated Buildings Sector Appliance and Equipment Costs and Efficiencies: Appendix A",
"author": "U.S. Energy Information Admnistration",
"year": 2023,
"pages": 39,
"url": "https://www.eia.gov/analysis/studies/buildings/equipcosts/pdf/full.pdf"
}
},
"market_scaling_fractions": {
"rooftop_ASHP-heat": 1.0,
"rooftop_ASHP-cool": 1.0,
"CAV_Vent": 0.06,
"VAV_Vent": 0.04
},
"market_scaling_fractions_source": {
"notes": "Ventilation multiples determined by square feet in which given ventilation system (VAV or CAV) is paired with given heating system for the measure.",
"source_data": {
"title": "CBECS 2018 Microdata",
"author": "U.S. Energy Information Administration",
"year": 2023,
"pages": null,
"url": "https://www.eia.gov/consumption/commercial/data/2018/index.php?view=microdata"
}
},
"_updated_by": {
"name": "Jared Langevin",
"organization": "LBNL",
"email": "[email protected]",
"timestamp": "2025-07-10 13:50:11"
}
}
58 changes: 58 additions & 0 deletions ecm_definitions/(C) Ref. Case Electric Other.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "(C) Ref. Case Electric Other",
"_description": "Counterfactual commercial other or unspecified electricity use, no savings vs. reference case",
"measure_type": "add-on",
"market_entry_year": 2025,
"market_exit_year": null,
"min_eff_elec_flag": null,
"ref_case_flag": "yes",
"climate_zone": "all",
"bldg_type": "all commercial",
"structure_type": "all",
"end_use": [
"other",
"unspecified"
],
"fuel_type": "electricity",
"fuel_switch_to": null,
"backup_fuel_fraction": null,
"technology": "all",
"htcl_tech_link": null,
"tech_switch_to": null,
"energy_efficiency": 0.0,
"energy_efficiency_units": "relative savings (constant)",
"energy_efficiency_source": {
"notes": [
"Ref. case performance",
"see https://www.eia.gov/analysis/studies/buildings/equipcosts/ for details"
],
"source_data": null
},
"installed_cost": 0.0,
"cost_units": "2022$/ft^2 floor",
"installed_cost_source": {
"notes": [
"Ref. case cost (no additional cost)",
"see https://www.eia.gov/analysis/studies/buildings/equipcosts/ for details."
],
"source_data": null
},
"add_elec_infr_cost": null,
"product_lifetime": 10.0,
"product_lifetime_units": "years",
"product_lifetime_source": {
"notes": "Generic 10 year lifetime used for unknown loads",
"source_data": null
},
"market_scaling_fractions": null,
"market_scaling_fractions_source": {
"notes": null,
"source_data": null
},
"_updated_by": {
"name": "Aven Satre:Meloy",
"organization": "LBNL",
"email": "[email protected]",
"timestamp": "2025-07-10 13:50:11"
}
}
87 changes: 87 additions & 0 deletions ecm_definitions/(C) Ref. Case Electric Range FS.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"name": "(C) Ref. Case Electric Range FS",
"_description": "Reference case commercial electric range, fuel switching",
"measure_type": "full service",
"market_entry_year": 2025,
"market_exit_year": null,
"min_eff_elec_flag": "yes",
"ref_case_flag": "yes",
"climate_zone": "all",
"bldg_type": [
"assembly",
"education",
"food sales",
"food service",
"health care",
"lodging",
"large office",
"small office",
"mercantile/service",
"warehouse"
],
"structure_type": "all",
"end_use": "cooking",
"fuel_type": "natural gas",
"fuel_switch_to": "electricity",
"backup_fuel_fraction": null,
"technology": "all",
"htcl_tech_link": null,
"tech_switch_to": "electric_range_oven_24x24_griddle",
"energy_efficiency": 0.5,
"energy_efficiency_units": "relative savings (constant)",
"energy_efficiency_source": {
"notes": [
"Typical (2022) combined energy efficiency for electric resistance griddle, oven, and range",
"compare to typical combined gas efficiency to derive relative savings impact"
],
"source_data": {
"title": "Updated Buildings Sector Appliance and Equipment Costs and Efficiencies",
"author": "U.S. Energy Information Administration",
"year": 2023,
"pages": [
167,
168
],
"url": "https://www.eia.gov/analysis/studies/buildings/equipcosts/pdf/full.pdf"
}
},
"installed_cost": {
"new": 4319.0,
"existing": 4388.0
},
"cost_units": "2022$/kBtu/h cooking",
"installed_cost_source": {
"notes": "2022 Typical retail (new) and installed (existing) cost value for electric range with griddle and oven, normalized by kBtu/h cooking capacity (EIA assumes ~2.6 kBtu/h capacity)",
"source_data": {
"title": "Updated Buildings Sector Appliance and Equipment Costs and Efficiencies",
"author": "U.S. Energy Information Administration",
"year": 2023,
"pages": 168,
"url": "https://www.eia.gov/analysis/studies/buildings/equipcosts/pdf/full.pdf"
}
},
"add_elec_infr_cost": null,
"product_lifetime": 12.0,
"product_lifetime_units": "years",
"product_lifetime_source": {
"notes": "Average life of Typical electric range",
"source_data": {
"title": "Updated Buildings Sector Appliance and Equipment Costs and Efficiencies",
"author": "U.S. Energy Information Administration",
"year": 2023,
"pages": 168,
"url": "https://www.eia.gov/analysis/studies/buildings/equipcosts/pdf/full.pdf"
}
},
"market_scaling_fractions": null,
"market_scaling_fractions_source": {
"notes": null,
"source_data": null
},
"_updated_by": {
"name": "Jared Langevin",
"organization": "LBNL",
"email": "[email protected]",
"timestamp": "2025-07-10 13:50:11"
}
}
Loading
Loading