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

Residential: connect to ResStock #190

Merged
merged 102 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
00acd3d
point to os37-rc2 in CI, and remove old comments
vtnate Nov 13, 2023
91746ec
start with local branches with newer dependencies
vtnate Nov 13, 2023
d90788a
Merge commit 'da0ad127a4c506fe70c078224fc18cf711b70181' into os37
vtnate Nov 13, 2023
da0ad12
Squashed 'example_project/resources/hpxml-measures/' changes from e2f…
vtnate Nov 13, 2023
410b645
get new error message in baseline mapper from cli code
vtnate Nov 13, 2023
f33b774
openstudio:update_measures which just added license text
vtnate Nov 13, 2023
0fb5b8e
point to branches to test OS3.7
vtnate Nov 20, 2023
29a5b7d
also specify core-gem in this repo, at least during testing
vtnate Nov 20, 2023
7b74925
use official OS version 3.7.0 in CI
vtnate Nov 20, 2023
31ec325
Squashed 'example_project/resources/hpxml-measures/' changes from d74…
vtnate Nov 20, 2023
c829f41
Merge commit '31ec325904a8cc59a471301c643c124327e49694' into os37
vtnate Nov 20, 2023
c080412
update BuildResidentialModel measure
vtnate Nov 20, 2023
f0616d8
change building location even for osm buildings
vtnate Nov 30, 2023
2794d20
remove hardcoded local weatherfile path from osm buildings
vtnate Nov 30, 2023
2aff9bb
Update to OS-HPXML v1.7.0 (#189)
joseph-robertson Dec 1, 2023
5414635
add chilled_water_storage to <run/process/clear/visualize>_all rake t…
vtnate Dec 1, 2023
f2876df
Merge commit 'fb89687bd040f030435ed61e618624d874f714db' as 'example_p…
joseph-robertson Dec 4, 2023
fb89687
Squashed 'example_project/resources/resstock/' content from commit 18…
joseph-robertson Dec 4, 2023
90ffc88
Stub switch between template and resstock in mapper.
joseph-robertson Dec 4, 2023
d215d11
Remove hpxml-measures since resstock has it.
joseph-robertson Dec 4, 2023
552c78b
Squashed 'example_project/resources/resstock/' changes from 18ff4bf38…
joseph-robertson Dec 4, 2023
cc1a9bc
Merge commit '552c78b9c2e883bbc9d1fdcb93f40040c8c61baa' into resstock…
joseph-robertson Dec 4, 2023
9345205
Copy some buildexistingmodel code into buildresidential model.
joseph-robertson Dec 4, 2023
1da6608
point to davids os37-rc branch of load-flex-gem
vtnate Dec 8, 2023
181fb3f
fix license link in copyright notice
vtnate Dec 8, 2023
e134a73
adding geometry orientation and aspect ratio example for single-famil…
kflemin Dec 8, 2023
006c99b
Major refactor into general residential mapping, template mapping, an…
joseph-robertson Dec 12, 2023
394a6c9
Change building_id argument name to resstock_building_id for clarity.
joseph-robertson Dec 12, 2023
2b15c0c
Add update_residential task to rakefile.
joseph-robertson Dec 12, 2023
41c4b9f
Update new rake task to use git clone with a depth of 1.
joseph-robertson Dec 12, 2023
f7eb94b
Adjust rake task based on what is required.
joseph-robertson Dec 12, 2023
9c79e09
Add back accidental folder removal.
joseph-robertson Dec 12, 2023
bc95d6b
Remove residential-measures folder.
joseph-robertson Dec 12, 2023
568667a
Re-add residential-measures without submodule.
joseph-robertson Dec 12, 2023
a8d5872
Rename the residential_resstock method to residential_samples.
joseph-robertson Dec 13, 2023
a273256
Merge branch 'os37' into resstock-connection
joseph-robertson Dec 13, 2023
6aec0ab
updating openstudio measure gems versions
kflemin Dec 15, 2023
20865e1
use newly released version of openstudio-geb-gem
vtnate Dec 15, 2023
6aedc6d
allow allow_local to work again
vtnate Dec 18, 2023
ddfdc00
use http in example project_dir gemfile, to help installer
vtnate Dec 21, 2023
38b32fe
point gemfiles to develop branches of openstudio gems
vtnate Dec 21, 2023
a3879ea
use http://rubygems.org in gemfile
vtnate Dec 21, 2023
b04b5ce
Residential: add unit tests for BuildResidentialModel (#191)
joseph-robertson Dec 21, 2023
30484a7
Merge branch 'os37' into resstock-connection
joseph-robertson Dec 21, 2023
72b0f0f
Run update_resources.
joseph-robertson Dec 21, 2023
06ab015
Update test file for feature_id name change.
joseph-robertson Dec 21, 2023
9f4629d
Update another feature_id name change.
joseph-robertson Dec 21, 2023
b8e3c11
Add a test for buildstock csv path with resstock building ids.
joseph-robertson Dec 21, 2023
4e72e90
Remove gitignore from resstock so we get os-hpxml data files.
joseph-robertson Jan 8, 2024
e139e0c
Merge branch 'develop' into resstock-connection
joseph-robertson Jan 23, 2024
33c7aa4
Fix merge conflicts.
joseph-robertson Jan 23, 2024
7be002a
Fix more merge conflicts.
joseph-robertson Jan 23, 2024
0c7582b
Added initial framework for uo_resstock connection: (1) updated Gemf…
rawadelkontar Feb 11, 2024
8a4fbc7
added example buildstock.csv for baltimore area to test
rawadelkontar Feb 11, 2024
0f345ff
updated matching algorithm to accurately find a match, added buildsto…
rawadelkontar Feb 13, 2024
816125f
deleted testing unwanted buildstock file and updated the gejson file
rawadelkontar Feb 13, 2024
9e6126f
added mapping to SFA number of units
rawadelkontar Feb 15, 2024
1fc26bc
saved a match_log file
rawadelkontar Feb 15, 2024
eeec444
changed lof match file name to uo_buildstock_match_log.csv
rawadelkontar Feb 15, 2024
2afa1fb
Added workflow to get matching building buildstock id from user inpu…
rawadelkontar Feb 16, 2024
97d7a47
added the example uo_buildstock_mapping.csv input file
rawadelkontar Feb 16, 2024
f0e75f7
Assign resstock buildstock csv path at feature level.
joseph-robertson Feb 19, 2024
dc1c61a
Move all resstock connection methods into util file.
joseph-robertson Feb 19, 2024
b1937cf
Test all resstock connection methods using unit tests.
joseph-robertson Feb 19, 2024
a96e794
Remove commented line.
joseph-robertson Feb 19, 2024
1947e18
Add unit test and error catching in build measure.
joseph-robertson Feb 20, 2024
f1696a7
Set a random seed on matches so we can reproduce results.
joseph-robertson Feb 29, 2024
562a756
Decided that resstock units are identical within a building.
joseph-robertson Feb 29, 2024
b3dab5f
Merge branch 'develop' into resstock-connection
joseph-robertson Mar 1, 2024
ced5cd7
Merge branch 'resstock-connection' into resstock-connection-refactor
joseph-robertson Mar 1, 2024
6861591
Merge pull request #193 from urbanopt/resstock-connection-refactor
joseph-robertson Mar 4, 2024
417c008
Ignore more resstock arguments.
joseph-robertson Mar 7, 2024
8393d81
Improve comments around location assignments.
joseph-robertson Mar 7, 2024
0b8901d
Clean up baseline mapper and samples util.
joseph-robertson Mar 7, 2024
314647c
Add unit test for when uo_buildstock_mapping_csv_path is specified.
joseph-robertson Mar 7, 2024
698d8cc
Sleep 2.
joseph-robertson Mar 7, 2024
4f91856
Test all features listed in uo_buildstock_mapping_csv_path.
joseph-robertson Mar 7, 2024
fb2b485
Clean up project baseline scenario and combined json.
joseph-robertson Mar 11, 2024
18cd2f2
Updates for year built and supporting units < floors.
joseph-robertson Mar 11, 2024
ab4568e
Update xml building feature 17 for weather path.
joseph-robertson Mar 12, 2024
dbe9fa6
Fix and update hvac mapping for general residential.
joseph-robertson Mar 12, 2024
46e9d0e
Add asserts on hpxml_path in residential test file.
joseph-robertson Mar 12, 2024
387372a
Updates for HPXML constant, software program, and apply_defaults.
joseph-robertson Mar 13, 2024
556fa08
Remove need for buildstock_csv_path when uo_mapping_csv_path is present.
joseph-robertson May 21, 2024
bc1a20a
Clean up baseline mapper.
joseph-robertson May 21, 2024
5c6c798
Add new method for downselecting either buildstock_csv_path or uo_map…
joseph-robertson May 21, 2024
5fdf233
Update uo_mapping_csv_path test to point to a subset of parameters.
joseph-robertson May 21, 2024
8e9bb5f
Update measure to handle a subset of parameters specified.
joseph-robertson May 21, 2024
395e31f
Improve comments in baseline mapper.
joseph-robertson May 23, 2024
19225b5
Remove lighting parameter from test uo mapping csv file.
joseph-robertson May 23, 2024
d0795cd
Update residential measure to use defaults where missing parameters d…
joseph-robertson May 23, 2024
464616c
Remove all lib folder stuff, and clean up methods and comments.
joseph-robertson May 30, 2024
aae58fc
Progress on unit tests for comparing hpxml files.
joseph-robertson May 31, 2024
fa9e1bd
Add maps for HVAC and occupants.
joseph-robertson Jun 3, 2024
919580f
Update tests for checking ducts.
joseph-robertson Jun 3, 2024
dcd932e
Tighten up mapping and tests.
joseph-robertson Jun 4, 2024
54891c2
Run residential:update_resources and overwrite all copywrite headers.
joseph-robertson Jun 25, 2024
a674277
use current versions of UO gems
vtnate Jun 27, 2024
b4856ae
Merge branch 'develop' into resstock-connection
vtnate Jun 27, 2024
a093196
allow on-demand running of CI
vtnate Jun 27, 2024
0e7db7f
add newline before output of each rake task
vtnate Jun 28, 2024
84e3ab3
update UO gem versions, and temporarily do not favor_local_gems (unti…
vtnate Jun 28, 2024
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 example_project/mappers/residential/samples/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def get_selected_id(mapped_properties, buildstock_csv_path, feature_id)
else
selected_ids = matches.sample(1, random: Random.new(12345))
selected_id = selected_ids[0]
selected_id = '1975'###
infos << "\nFeature #{feature_id}: Multiple matches found. Selected one buildstock building ID randomly: #{selected_id} from #{matches.size} matching buildings: #{matches}. #{mapped_properties}"
end

Expand Down Expand Up @@ -253,4 +252,5 @@ def residential_samples(args, resstock_building_id, buildstock_csv_path)
FileUtils.cp_r(resources_dir, lib_dir)
FileUtils.cp_r(housing_characteristics_dir, lib_dir)
FileUtils.cp(buildstock_csv_path, File.join(housing_characteristics_dir, 'buildstock.csv'))
sleep(1) # avoid Cannot find file /path/to/lib/housing_characteristics/buildstock.csv.
end
40 changes: 32 additions & 8 deletions example_project/measures/BuildResidentialModel/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def run(model, runner, user_arguments)

measures[measure_subdir] = [measure_args]

if !apply_measures(hpxml_measures_dir, measures, runner, model, true, 'OpenStudio::Measure::ModelMeasure', 'feature.osw')
if !apply_measures(hpxml_measures_dir, measures, runner, model, true, 'OpenStudio::Measure::ModelMeasure', nil)
return false
end
else # we're using an HPXML file from the xml_building folder
Expand Down Expand Up @@ -338,7 +338,7 @@ def run(model, runner, user_arguments)

measures[measure_subdir] = [measure_args]

if !apply_measures(hpxml_measures_dir, measures, runner, model, true, 'OpenStudio::Measure::ModelMeasure', 'feature.osw')
if !apply_measures(hpxml_measures_dir, measures, runner, model, true, 'OpenStudio::Measure::ModelMeasure', nil)
return false
end

Expand Down Expand Up @@ -396,23 +396,47 @@ def get_unit_positions(runner, args)
when 'single-family detached'
units << {}
when 'single-family attached'

###################################################
# # # # # #
# # # # # #
# 1 # 2 # 3 # 4 # 5 #
# # # # # #
# # # # # #
###################################################

(1..geometry_building_num_units).to_a.each do |unit_num|
case unit_num
when 1
units << { 'geometry_unit_left_wall_is_adiabatic' => true }
if geometry_building_num_units > 1
units << { 'geometry_unit_left_wall_is_adiabatic' => true } # right end unit, one adiabatic wall
else
units << { 'geometry_unit_left_wall_is_adiabatic' => false } # only one unit, no adiabatic walls
end
when geometry_building_num_units
units << { 'geometry_unit_right_wall_is_adiabatic' => true }
units << { 'geometry_unit_right_wall_is_adiabatic' => true } # left end unit, one adiabatic wall
else
units << { 'geometry_unit_left_wall_is_adiabatic' => true,
'geometry_unit_right_wall_is_adiabatic' => true } # everything in between
end
end
when 'apartment unit'

#####################
# # #
# # #
# 2 # 4 #
# # #
# # #
###############################
# # # #
# # # #
# 1 # 3 # 5 #
# # # #
# # # #
###############################

num_units_per_floor = (geometry_building_num_units / geometry_num_floors_above_grade).ceil
if num_units_per_floor == 1
runner.registerError("Unit type '#{args[:geometry_unit_type]}' with num_units_per_floor=#{num_units_per_floor} is not supported.")
return units
end

floor = 1
position = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def teardown
end

def _initialize_arguments()
# BuildResidentialModel arguments
@args[:hpxml_path] = @hpxml_path
@args[:output_dir] = @run_path
@args = {}

# BuildResidentialModel required arguments
@args[:urbanopt_feature_id] = 1
@args[:schedules_type] = 'stochastic'
@args[:schedules_random_seed] = 1
Expand Down Expand Up @@ -185,7 +185,7 @@ def test_feature_building_types_num_units_and_bedrooms

feature_building_types = ['Single-Family Detached', 'Multifamily']
feature_number_of_residential_unitss = (2..4).to_a
feature_number_of_bedroomss = (11..13).to_a
feature_number_of_bedroomss = (11..13).to_a

test_folder = @run_path / __method__.to_s
feature_building_types.each do |feature_building_type|
Expand Down Expand Up @@ -308,7 +308,7 @@ def test_residential_templates
test_folder = @run_path / __method__.to_s
feature_templates.each do |feature_template|
climate_zones.each do |climate_zone|
@args = {}
@hpxml_path = test_folder / "#{feature_template}_#{climate_zone}" / 'feature.xml'
_initialize_arguments()

@template = feature_template
Expand All @@ -330,6 +330,8 @@ def test_residential_samples
# - "characterize_residential_buildings_from_buildstock_csv"
# - "resstock_buildstock_csv_path"

FileUtils.mkdir_p(File.join(File.dirname(__FILE__), '../../../run'))

@buildstock_csv_path = File.absolute_path(File.join(File.dirname(__FILE__), '../../../resources/residential-measures/test/base_results/baseline/annual/buildstock.csv'))
@number_of_stories_above_ground = nil
@year_built = nil
Expand All @@ -338,9 +340,13 @@ def test_residential_samples
feature_number_of_residential_unitss = [1, 5, 7]
feature_floor_areas = [5000, 9000]

test_folder = @run_path / __method__.to_s
feature_building_types.each do |feature_building_type|
feature_number_of_residential_unitss.each do |feature_number_of_residential_units|
feature_floor_areas.each do |feature_floor_area|
@hpxml_path = test_folder / "#{feature_building_type}_#{feature_number_of_residential_units}_#{feature_floor_area}" / 'feature.xml'
_initialize_arguments()

@building_type = feature_building_type
@number_of_residential_units = feature_number_of_residential_units
@floor_area = feature_floor_area
Expand Down Expand Up @@ -372,18 +378,24 @@ def test_residential_samples2
# - "characterize_residential_buildings_from_buildstock_csv"
# - "resstock_buildstock_csv_path"

FileUtils.mkdir_p(File.join(File.dirname(__FILE__), '../../../run'))

@buildstock_csv_path = File.absolute_path(File.join(File.dirname(__FILE__), '../../../resources/residential-measures/test/base_results/baseline/annual/buildstock.csv'))
@building_type = 'Multifamily'
@number_of_residential_units = 8
@floor_area = 505 * @number_of_residential_units

feature_number_of_stories_above_grounds = [2, 3]
feature_year_builts = [1967, 1985]
feature_number_of_bedroomss = [8, 16]

test_folder = @run_path / __method__.to_s
feature_number_of_stories_above_grounds.each do |feature_number_of_stories_above_ground|
feature_year_builts.each do |feature_year_built|
feature_number_of_bedroomss.each do |feature_number_of_bedrooms|
@hpxml_path = test_folder / "#{feature_number_of_stories_above_ground}_#{feature_year_built}_#{feature_number_of_bedrooms}" / 'feature.xml'
_initialize_arguments()

@building_type = 'Multifamily'
@floor_area = 505 * @number_of_residential_units
@number_of_stories_above_ground = feature_number_of_stories_above_ground
@year_built = feature_year_built
@number_of_bedrooms = feature_number_of_bedrooms
Expand Down