Skip to content
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

Updates postprocessing for new sampling / increased geographic resolution #275

Merged
merged 133 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
ae0316e
Update .gitignore
mdahlhausen Oct 15, 2024
9c57ceb
Update test_template.rb
mdahlhausen Oct 15, 2024
79521cb
update add_blinds_to_selected_windows test
mdahlhausen Oct 15, 2024
a59f6cf
update ChangeBuildingLocation tests
mdahlhausen Oct 15, 2024
67ddbfd
rubocop edits to add_blinds_to_selected_windows
mdahlhausen Oct 16, 2024
90f803c
update add_hvac_nighttime_operation_variability
mdahlhausen Oct 16, 2024
a87d924
update simulation_settings measure tests
mdahlhausen Oct 16, 2024
791f318
update add thermostat_setpoint_variability_test
mdahlhausen Oct 16, 2024
f5f98e2
update adjust_occupancy_schedule test
mdahlhausen Oct 16, 2024
b0c02c8
update fault_hvac_economizer_changeover_temperature
mdahlhausen Oct 16, 2024
a2c881e
update fault_hvac_economizer_damper_stuck
mdahlhausen Oct 16, 2024
e4f8bf2
remove hvac_nighttime_oa_controls
mdahlhausen Oct 16, 2024
68dd59f
update replace_baseline_windows
mdahlhausen Oct 16, 2024
8fe1aeb
update set_electric_equipment_bpr
mdahlhausen Oct 16, 2024
1f6586c
update set_exterior_lighting_template
mdahlhausen Oct 16, 2024
614c52b
update set_exterior_lighting_template
mdahlhausen Oct 16, 2024
0b5f6e0
update set_heating_fuel
mdahlhausen Oct 16, 2024
90a9173
update set_hvac_template
mdahlhausen Oct 16, 2024
adb352e
update set_interior_equipment_template
mdahlhausen Oct 16, 2024
b20fbb6
update set_interior_lighting_bpr
mdahlhausen Oct 16, 2024
339f73f
update set_interior_lighting_technology
mdahlhausen Oct 16, 2024
684e561
update set_primary_kitchen_equipment
mdahlhausen Oct 16, 2024
ea33b6b
update set_roof_template
mdahlhausen Oct 16, 2024
13815b4
update set_wall_template
mdahlhausen Oct 16, 2024
30c2647
update set_space_type_load_categories
mdahlhausen Oct 17, 2024
5fa99e5
update set_service_water_heating_fuel
mdahlhausen Oct 17, 2024
300c4ce
update simulating_settings test file name
mdahlhausen Oct 17, 2024
491f779
update set_service_water_heating_template
mdahlhausen Oct 17, 2024
6536b12
update set_nist_infiltration_correlations
mdahlhausen Oct 17, 2024
62c6df6
update hardsize_model
mdahlhausen Oct 17, 2024
33b46de
update prototype_space_type_assignment
mdahlhausen Oct 17, 2024
e6aad5a
update expected hardsize_model test results
mdahlhausen Oct 17, 2024
c0bdd6b
update create_bar_from_building_type_ratios
mdahlhausen Oct 17, 2024
c27a465
update create_bar_from_building_type_ratios
mdahlhausen Oct 17, 2024
9be4855
update create_typical_Building_from_model
mdahlhausen Oct 17, 2024
677b999
Update README.md
mdahlhausen Oct 17, 2024
304d0d5
update ChangeBuildingLocation
mdahlhausen Oct 18, 2024
e97edc4
shorten hardsize test path name
mdahlhausen Oct 18, 2024
73aaf35
update test_hvac in create_typical
mdahlhausen Oct 18, 2024
8bc42fe
Update Jenkins branch
mdahlhausen Oct 23, 2024
d9fcfbd
ApplyUpgrade rubocop
mdahlhausen Oct 28, 2024
60f9375
BuildExistingModel rubocop
mdahlhausen Oct 28, 2024
bc64eec
EmissionReporting rubocop
mdahlhausen Oct 28, 2024
5445c64
QOI Report rubocop
mdahlhausen Oct 28, 2024
6378fa4
RunDirectoryCleanup rubocop
mdahlhausen Oct 28, 2024
93cf7a7
simulation settings check rubocop
mdahlhausen Oct 28, 2024
d573cd9
Simulation Output Report rubocop
mdahlhausen Oct 28, 2024
6b11811
Update .gitignore
mdahlhausen Oct 29, 2024
91d5fc8
TimeseriesCSVExport rubocop
mdahlhausen Oct 29, 2024
f64edfe
remove comment
mdahlhausen Oct 29, 2024
be21396
Aggregate the error summaries per each upgrade.
wenyikuang Nov 1, 2024
3147055
Made the err log sorted and cleanup the individual err csv.
wenyikuang Nov 5, 2024
9ab9e7d
Merge pull request #248 from NREL/wenyi/fix-234-main
ChristopherCaradonna Nov 6, 2024
546e792
merge from main
mdahlhausen Nov 6, 2024
13d4f78
Update Rakefile
mdahlhausen Nov 6, 2024
23aeeec
Generated the aggregated failure summary. (#239)
wenyikuang Nov 6, 2024
affe481
Merge branch 'main' into mdahlhau/test_template_update
mdahlhausen Nov 7, 2024
5280df5
Merge pull request #235 from NREL/mdahlhau/test_template_update
mdahlhausen Nov 7, 2024
e62a6d5
Merge branch 'main' into mdahlhau/report_measure_rubocop
mdahlhausen Nov 7, 2024
26c2c40
Merge branch 'main' into mdahlhau/report_measure_rubocop
mdahlhausen Nov 7, 2024
c0250be
Delete resource_measure_tests.txt
mdahlhausen Nov 7, 2024
2fad570
Rubocop updates to Gemfile
mdahlhausen Nov 7, 2024
4fabf4b
Rubocop updates to Rakefile
mdahlhausen Nov 7, 2024
bbf0036
emissions measure rubocop
mdahlhausen Nov 7, 2024
48eb36c
comstock_sensitivity_reports rubocop
mdahlhausen Nov 7, 2024
77ca957
utility_bills rubocop
mdahlhausen Nov 7, 2024
8e58a52
guarantee change back to starting directory
mdahlhausen Nov 8, 2024
0fb8074
use __dir__ for file dir
mdahlhausen Nov 8, 2024
f218edf
add oudoor temp output variable
mdahlhausen Nov 9, 2024
8698976
rubocop edits
mdahlhausen Nov 9, 2024
7daeb58
Update pull_request_template.md
mdahlhausen Nov 9, 2024
25d4c59
Fix* emissions reporting (#231)
eringold Nov 11, 2024
287ef98
Merge branch 'main' into mdahlhau/report_measure_rubocop
mdahlhausen Nov 12, 2024
c17eb2c
merge updates
mdahlhausen Nov 12, 2024
7a46afa
Update emissions_reporting_test.rb
mdahlhausen Nov 12, 2024
00bc03e
updated indexing of all_tests.
wenyikuang Nov 12, 2024
4d7baa7
Merge pull request #254 from NREL/mdahlhau/report_measure_rubocop
mdahlhausen Nov 12, 2024
1270810
drop the raising exception of downselect columns in comstock for bypa…
wenyikuang Nov 17, 2024
68aaae1
drop the estimated_size since we are using lazyframe now.
wenyikuang Nov 17, 2024
d4b80f2
Fixed the column naming following the other column patterns.
wenyikuang Nov 20, 2024
b721ee7
sampling changes to support new bucket development approach.
rHorsey Nov 20, 2024
07f51b3
make sure outstanding changes are accounted for.
rHorsey Nov 20, 2024
f90b68b
Merge branch 'rhorsey/more-euss-changes' into wenyi/euss_r3
rHorsey Nov 20, 2024
b490cd3
Reverts to pre-emissions-fix emissions columns
asparke2 Nov 21, 2024
d39b6b3
Update column definitions for sampling
asparke2 Nov 21, 2024
89181e4
Filtered out known missing columns.
wenyikuang Nov 23, 2024
a2e2ac6
Add weight to self.data no matter how.
wenyikuang Nov 23, 2024
c708b75
Adding fix for Primary School Size Bin 0
rHorsey Nov 25, 2024
492eeea
Postprocessing update: add output variables related to peak intensity…
JieXiong9119 Nov 26, 2024
689c876
Handle Pandas deprecation warning for silent type downcasting
asparke2 Nov 26, 2024
935b893
Removing very small schools (under 2k sqft) where possible plus some …
rHorsey Nov 27, 2024
65e9379
Merge branch 'wenyi/euss_r3' of https://github.com/nrel/comstock into…
rHorsey Nov 27, 2024
0dae8fa
Add metadata_and_annual_results export capability
asparke2 Dec 5, 2024
15eed72
Cleans up unweighted savings calcs
asparke2 Dec 9, 2024
ee8e32a
Handle duplicate geography columns
asparke2 Dec 10, 2024
ac9ab13
Enable apportionment to be reloaded from cache
asparke2 Dec 10, 2024
2e4f061
Combined unweighted savings calculations
asparke2 Dec 10, 2024
01a618c
Reduce terminal output
asparke2 Dec 10, 2024
bad1408
Downselect to unique columns for export
asparke2 Dec 10, 2024
576545f
Adds climate zone to plotting DF
asparke2 Dec 11, 2024
4aff738
Reorder metadata folder structure
asparke2 Dec 11, 2024
53fb676
Creates metadata aggregates
asparke2 Dec 12, 2024
bf1e813
Enable all geographic exports
asparke2 Dec 12, 2024
06b59d3
Compress CSV files to gzip
asparke2 Dec 12, 2024
b34e531
Adds geospatial data for county and puma aggregates
asparke2 Dec 12, 2024
74ec6f5
Adds agg to aggregate file names
asparke2 Dec 12, 2024
e35d8b8
Removes categoricals and hive partitioning column
asparke2 Dec 16, 2024
b96b318
Adds ..ft2 back to in.sqft column
asparke2 Dec 16, 2024
7118ef5
Removing the now obsolete v99 TSV zip
rHorsey Dec 17, 2024
7fb6f9d
Adding the v25 TSVs - the set used for EUSS 2024 Nov release.
rHorsey Dec 17, 2024
080326e
Fixes #240 by disabling reporting of HVAC counts
asparke2 Dec 17, 2024
bad577d
Merge remote-tracking branch 'origin/wenyi/euss_r3' into wenyi/euss_r3
asparke2 Dec 17, 2024
fcc1205
Adds units to in.sqft column name
asparke2 Dec 18, 2024
7444c63
Enables writing metadata to S3
asparke2 Dec 18, 2024
232be17
Remove upgrade_id from fkt
asparke2 Dec 18, 2024
0f2ba2b
Reducing log messages
asparke2 Dec 19, 2024
eae55c7
Fix climate zones is plotting LazyFrame
asparke2 Dec 19, 2024
db926ab
Export all columns for plotting LazyFrame
asparke2 Dec 19, 2024
451fbf2
Make export_metadata configurable
asparke2 Dec 20, 2024
5b2a764
Allows writing of compressed CSVs to S3
asparke2 Dec 27, 2024
c661829
Report full path for CBECS
asparke2 Dec 30, 2024
af78c81
Use full path for Apportionment
asparke2 Dec 30, 2024
046cd26
Cache fkt and hive partition ComStock wide
asparke2 Dec 30, 2024
b51f3d1
Export all columns with no downselection
asparke2 Dec 30, 2024
4f54f8a
Removes metadata_index and orders basic columns
asparke2 Dec 30, 2024
2c3fb15
Fixes csv.gz creation
asparke2 Jan 2, 2025
2e9658d
Collect all geographies at once
asparke2 Jan 3, 2025
60a8b7e
Fix raw un-aggregated and adds PUMA to fkt
asparke2 Jan 3, 2025
a4a7c73
Handle aggregate and non-aggregate differently
asparke2 Jan 3, 2025
a24497d
Collect first-level geographies for multi-level no-aggregations
asparke2 Jan 6, 2025
ccc3a86
Multi-variable aggregations in export_metadata
asparke2 Jan 14, 2025
e91a230
Fixes national-scale partitioning
asparke2 Jan 14, 2025
7c157c0
Parallelize export_metadata
asparke2 Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Author pull request checklist:
- [ ] 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/measure_tests.txt` or/and `test/resource_measure_tests.txt`
- [ ] 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
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.temp
.idea
.DS_Store
.vs
clusters
data
local_configuration.*
Expand All @@ -26,3 +27,8 @@ lib/
/sampling/truth_data
*.pyc
report.xml
resources/Gemfile.lock

# Rubocop output
/.rubocop
/.rubocop-http*
2 changes: 1 addition & 1 deletion Jenkinsfile_main_develop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/groovy

@Library('cbci_shared_libs@develop') _
@Library('cbci_shared_libs@comstock-dev') _


// Build for PR to main branch only.
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,17 @@ conda activate buildstockbatch
pip install GHEDesigner==1.0
pip install NREL-PySAM==4.2.0
```

## Measure Tests
1. Follow the developer installation instructions above. In particular, `GHEDesigner==1.0` must be installed with `pip install GHEDesigner==1.0`.
2. Run the measure tests with the rake command:
- `bundle exec rake unit_tests:all_tests` to run all measure tests.
- `bundle exec rake unit_tests:reporting_measure_tests` to run all reporting measure tests.
- `bundle exec rake unit_tests:workflow_measure_tests` to run all workflow measure tests.
- `bundle exec rake unit_tests:upgrade_measure_tests` to run all `upgrade_` measure tests.

## Running Rubocop
1. Follow the developer installation instructions above
2. navigate to the `.custom_gems` directory
3. run `bundle exec rake rubocop:show` in terminal
4. review results by opening the `rubocop-results.html` in the `.rubocop/` directory
115 changes: 78 additions & 37 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,89 @@
require 'rake'
require 'rake/testtask'
require 'minitest/reporters' # Require the gem
require 'minitest/reporters'
require 'parallel'
require 'rubocop/rake_task'

# Configure the JUnit reporter

desc 'Perform tasks related to unit tests'
desc 'Run measure tests'
namespace :unit_tests do
desc 'Run measure tests'
Rake::TestTask.new('measure_tests') do |t|
MEASURETESTS_PATH = "test/measure_tests.txt"
if File.exist?(MEASURETESTS_PATH)
# load test files from file.
full_file_list = FileList.new(File.readlines(MEASURETESTS_PATH).map(&:chomp))
full_file_list.select! { |item| item.include?('rb')}
p full_file_list
desc 'Run all measure tests'
task all_tests: [:reporting_measure_tests, :workflow_measure_tests, :upgrade_measure_tests] do
puts 'Running all measure tests:'
end

desc 'Run reporting measure tests'
task :reporting_measure_tests do
puts 'Running all reporting measure tests:'
# load test files from file
file_list = FileList.new(File.readlines('test/reporting_measure_tests.txt').map(&:chomp))
file_list.select! { |item| item.include?('rb') && File.exist?(item) }
Parallel.each(file_list, in_processes: Parallel.processor_count) do |file|
puts "Running test #{file} in process #{Process.pid}"
load file
true
rescue StandardError => e
puts "Error in #{file}: #{e.message}"
Minitest::Reporters.reporter.report_error(file, e)
false
end
t.test_files = full_file_list
p(full_file_list)
t.verbose = false
t.warning = false
end

Rake::TestTask.new('resource_measure_tests') do |t|
RESOURCE_MEASURETESTS_PATH = "test/resource_measure_tests.txt"
if File.exist?(RESOURCE_MEASURETESTS_PATH)
# load test files from file.
full_file_list = FileList.new(File.readlines(RESOURCE_MEASURETESTS_PATH).map(&:chomp))
full_file_list.select! { |item| item.include?('rb') && File.exist?(item) }
p full_file_list
desc 'Run workflow measure tests'
task :workflow_measure_tests do
puts 'Running all workflow measure tests:'
# load test files from file
file_list = FileList.new(File.readlines('test/workflow_measure_tests.txt').map(&:chomp))
file_list.select! { |item| item.include?('rb') && !item.include?('upgrade') && File.exist?(item) }
Parallel.each(file_list, in_processes: Parallel.processor_count) do |file|
puts "Running test #{file} in process #{Process.pid}"
load file
true
rescue StandardError => e
puts "Error in #{file}: #{e.message}"
Minitest::Reporters.reporter.report_error(file, e)
false
end
t.test_files = full_file_list.select do |file|
begin
# Try to load the file to check for syntax errors
load file
true
rescue Exception => e
puts "Error in #{file}: #{e.message}"
Minitest::Reporters.reporter.report_error(file, e)
false
end
end

desc 'Run upgrade measure tests'
task :upgrade_measure_tests do
puts 'Running all upgrade measure tests:'
# load test files from file
file_list = FileList.new(File.readlines('test/upgrade_measure_tests.txt').map(&:chomp))
file_list.select! { |item| item.include?('rb') && item.include?('upgrade') && File.exist?(item) }
Parallel.each(file_list, in_processes: Parallel.processor_count) do |file|
puts "Running test #{file} in process #{Process.pid}"
load file
true
rescue StandardError => e
puts "Error in #{file}: #{e.message}"
Minitest::Reporters.reporter.report_error(file, e)
false
end
p(full_file_list)
t.verbose = false
t.warning = false
end
end

desc 'Check the code for style consistency'
RuboCop::RakeTask.new(:rubocop) do |t|
# Make a folder for the output
out_dir = '.rubocop'
FileUtils.mkdir_p(out_dir)
# Output both XML (CheckStyle format) and HTML
t.options = ["--out=#{out_dir}/rubocop-results.xml", '--format=h', "--out=#{out_dir}/rubocop-results.html", '--format=offenses', "--out=#{out_dir}/rubocop-summary.txt"]
t.requires = ['rubocop/formatter/checkstyle_formatter']
t.formatters = ['RuboCop::Formatter::CheckstyleFormatter']
# don't abort rake on failure
t.fail_on_error = false
end

desc 'Show the rubocop output in a web browser'
task 'rubocop:show' => [:rubocop] do
link = "#{__dir__}/.rubocop/rubocop-results.html"
case RbConfig::CONFIG['host_os']
when /mswin/, /mingw/, /cygwin/
system "start #{link}"
when /darwin/
system "open #{link}"
when /linux/, /bsd/
system "xdg-open #{link}"
end
end
Loading