Skip to content

EEDF: add new demand flexibility output variables related to the grid peak load reduction objective #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

JieXiong9119
Copy link
Collaborator

@JieXiong9119 JieXiong9119 commented Apr 10, 2025

Pull request overview

3 changes are present in this PR to add new DF metrics in reporting & postprocessing:

  1. Add mean statistic for the monthly peak variables - 12 new columns
  2. Add grid peak related metrics - 24 new columns
  • Given the new objective option for DF measures - grid level peak load reduction, we need to have a way to assess the impacts of measure with this option. Similar to the existing variables that reveal the individual building peaks by month, we want to extract the load representatives (statistics) of a specific building/sample that correspond to the grid peak (period), on which the DF measures apply controls, so that we could perform impact analysis targeting the load on the time of interest (by comparing these variables between baseline and upgrades).
  • The actual processing of the added statistics take place in measures\qoi_report\measure.rb, where the mean peak during grid peak window (4 hour) by month, and the mean peak on grid peak (1 hour) by month, are calculated. Since the grid peaks are determined/sourced from the Cambium load data in the DF measures, we add the same resources into the reporting measure, so the measure will read the Cambium grid load data and generate the grid peak schedule to extract the building load corresponding to the grid peak schedule.
  1. Update postprocessing\comstockpostproc\resources\comstock_column_definitions.csv and postprocessing\comstockpostproc\naming_mixin.py to include all these new variables, and clean up for unnecessary variables
  • There are calculated variables derived from the added variables based on the built-in workflow in postprocessing\comstockpostproc\comstock.py, such as intensity,savings,'percent_savings`, which are also added into the column definition file, but set to FALSE to both basic and full metadata to avoid giant changes (~180 more columns) to the actual data release.
  • Some old variables are of low priority for DF analysis and other use cases, so they are set to FALSE, including q1 and q3 stats, minimum peaks and median daily peak timing (corresponding to 48 columns).

Pull Request Author

This pull request makes changes to (select all the apply):

  • Documentation
  • Infrastructure (includes apptainer image, buildstock batch, dependencies, continuous integration tests)
  • Sampling
  • Workflow Measures
  • Upgrade Measures
  • Reporting Measures
  • Postprocessing

Author pull request checklist:

  • Tagged the pull request with the appropriate label (documentation, infrastructure, sampling, workflow measure, upgrade measure, reporting measure, postprocessing) to help categorize changes in the release notes.
  • Added tests for new measures
  • Updated measure .xml(s)
  • Register values added to comstock_column_definitions.csv
  • Both options_lookup.tsv files updated
  • 10k+ test run
  • Change documentation written
  • Measure documentation written
  • ComStock documentation updated
  • Changes reflected in example .yml files
  • Changes reflected in README.md files
  • Added 'See ComStock License' language to first two lines of each code file
  • Implements corresponding measure tests and indexing path in test/reporting_measure_tests.txt, test/workflow_measure_tests.txt, or test/upgrade_measure_tests.txt
  • All new and existing tests pass the CI

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a code review on GitHub
  • All related changes have been implemented: data and method additions, changes, tests
  • If fixing a defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • Reviewed change documentation
  • Ensured code files contain License reference
  • Results differences are reasonable
  • Make sure the newly added measures has been added with tests and indexed properly
  • CI status: all tests pass

ComStock Licensing Language - Add to Beginning of Each Code File

# ComStock™, Copyright (c) 2023 Alliance for Sustainable Energy, LLC. All rights reserved.
# See top level LICENSE.txt file for license terms.

@JieXiong9119 JieXiong9119 added reporting measure PR improves or adds reporting measures postprocessing PR improves or adds postprocessing content labels Apr 10, 2025
@JieXiong9119 JieXiong9119 self-assigned this Apr 10, 2025
@JieXiong9119 JieXiong9119 changed the title EEDF: add new demand flexibility metric output variables related to the grid peak load reduction objective EEDF: add new demand flexibility output variables related to the grid peak load reduction objective Apr 10, 2025
Comment on lines 180 to 186
def mean_daily_peak_by_month
output_names = []
months.each do |month, _month_val|
output_names << "mean_daily_peak_use_#{month}_kw"
end
output_names
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this instead work?

def min_daily_peak_by_month
  months.keys.map { |month| "minimum_daily_peak_#{month}_kw" }
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and if does, I guess we can trim a lot of lines with the methods with similar structure?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm following the format/definition used for the previous variables developed by whoever first create this measure. Do we want to refactor this measure now given the limited timeline?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this structural change seems reasonable and sort of similar to how it worked for me for the other cases

Comment on lines +371 to +415
COLS_QOI_MONTHLY_MEAN_DAILY_PEAK = [
'out.qoi.mean_daily_peak_jan..kw',
'out.qoi.mean_daily_peak_feb..kw',
'out.qoi.mean_daily_peak_mar..kw',
'out.qoi.mean_daily_peak_apr..kw',
'out.qoi.mean_daily_peak_may..kw',
'out.qoi.mean_daily_peak_jun..kw',
'out.qoi.mean_daily_peak_jul..kw',
'out.qoi.mean_daily_peak_aug..kw',
'out.qoi.mean_daily_peak_sep..kw',
'out.qoi.mean_daily_peak_oct..kw',
'out.qoi.mean_daily_peak_nov..kw',
'out.qoi.mean_daily_peak_dec..kw'
]

COLS_QOI_MONTHLY_MEAN_DAILY_PEAK_GRID_WIN = [
'out.qoi.mean_daily_peak_grid_window_jan..kw',
'out.qoi.mean_daily_peak_grid_window_feb..kw',
'out.qoi.mean_daily_peak_grid_window_mar..kw',
'out.qoi.mean_daily_peak_grid_window_apr..kw',
'out.qoi.mean_daily_peak_grid_window_may..kw',
'out.qoi.mean_daily_peak_grid_window_jun..kw',
'out.qoi.mean_daily_peak_grid_window_jul..kw',
'out.qoi.mean_daily_peak_grid_window_aug..kw',
'out.qoi.mean_daily_peak_grid_window_sep..kw',
'out.qoi.mean_daily_peak_grid_window_oct..kw',
'out.qoi.mean_daily_peak_grid_window_nov..kw',
'out.qoi.mean_daily_peak_grid_window_dec..kw'
]

COLS_QOI_MONTHLY_MEAN_DAILY_PEAK_GRID_PEAK = [
'out.qoi.mean_daily_peak_grid_peak_jan..kw',
'out.qoi.mean_daily_peak_grid_peak_feb..kw',
'out.qoi.mean_daily_peak_grid_peak_mar..kw',
'out.qoi.mean_daily_peak_grid_peak_apr..kw',
'out.qoi.mean_daily_peak_grid_peak_may..kw',
'out.qoi.mean_daily_peak_grid_peak_jun..kw',
'out.qoi.mean_daily_peak_grid_peak_jul..kw',
'out.qoi.mean_daily_peak_grid_peak_aug..kw',
'out.qoi.mean_daily_peak_grid_peak_sep..kw',
'out.qoi.mean_daily_peak_grid_peak_oct..kw',
'out.qoi.mean_daily_peak_grid_peak_nov..kw',
'out.qoi.mean_daily_peak_grid_peak_dec..kw'
]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes sense too

Copy link
Contributor

@JanghyunJK JanghyunJK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made some comments but approving! thanks!

@JieXiong9119
Copy link
Collaborator Author

Going to merge this to the DF branch after confirming with spot checks on 10k test.

@JieXiong9119 JieXiong9119 merged commit bd6489c into jx/demand-flexibility-grid-peak-objective Apr 14, 2025
@JieXiong9119 JieXiong9119 deleted the jx/demand-flexibility-df-metrics branch April 14, 2025 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postprocessing PR improves or adds postprocessing content reporting measure PR improves or adds reporting measures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants