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

BuildResidentialHPXML: make conditional arguments optional #1867

Draft
wants to merge 42 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
719024e
Change several arguments from required to optional, and start to clea…
joseph-robertson Oct 23, 2024
db5a8d7
Merge branch 'master' into optional-build-args
joseph-robertson Oct 24, 2024
ef2e09f
Remove ignored arguments from build measure test file.
joseph-robertson Oct 24, 2024
2cba857
Remove ignored arguments from template osw file.
joseph-robertson Oct 24, 2024
c80ce93
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
shorowit Oct 25, 2024
30dcd87
More optional arguments. Remove WWR arguments; fold functionality int…
shorowit Oct 25, 2024
ce9220d
Update argument descriptions [ci skip]
shorowit Oct 25, 2024
ac06a7c
Unrelated minor code cleanup.
shorowit Oct 25, 2024
ef3dde2
Merge branch 'master' into optional-build-args
joseph-robertson Oct 30, 2024
06f6253
Merge branch 'optional-build-args' of github.com:NREL/OpenStudio-HPXM…
joseph-robertson Oct 30, 2024
5075a60
Typo in hvac_perf_data_capacity_type argument.
joseph-robertson Oct 30, 2024
c07ebb2
Stub generic makeArgument method.
joseph-robertson Oct 31, 2024
54c542e
Use named arguments and reformat, introduce default_href.
joseph-robertson Oct 31, 2024
62e6fc8
Try logic for adding auto choice for bool and choice arguments with d…
joseph-robertson Oct 31, 2024
7f136a2
Merge branch 'master' into optional-build-args
joseph-robertson Oct 31, 2024
0b5478d
Handle double and integer arguments to string arguments when OS-HPXML…
joseph-robertson Oct 31, 2024
5efc333
Reorganize a bit.
joseph-robertson Oct 31, 2024
ec72127
Merge branch 'master' into optional-build-args
joseph-robertson Nov 1, 2024
00129ab
Method for converting string arguments back to appropriate data type.
joseph-robertson Nov 1, 2024
bc1232c
Handle and test what happens when auto is provided.
joseph-robertson Nov 1, 2024
18716e8
Few more spots where a string is expected for argument values that ca…
joseph-robertson Nov 1, 2024
6a64ad1
Latest results.
Nov 1, 2024
5ac7252
Progress.
joseph-robertson Nov 2, 2024
775eb16
Progress.
joseph-robertson Nov 2, 2024
1b60e91
Sweep through.
joseph-robertson Nov 2, 2024
dba3891
Clean up.
joseph-robertson Nov 2, 2024
4790ba2
Start method for defaulting optional argument values.
joseph-robertson Nov 2, 2024
14a4896
More entries to defaultOptionalArgumentValues.
joseph-robertson Nov 4, 2024
9fc0362
Try a few more auto arguments in sample file.
joseph-robertson Nov 4, 2024
ca1885e
Defaults for optional garage arguments.
joseph-robertson Nov 4, 2024
2f31f5b
More default values for previously required arguments.
joseph-robertson Nov 4, 2024
6e3bb51
Make convertArguments generic so we can use in resstock.
joseph-robertson Nov 4, 2024
2f4903e
More default values for previously required arguments.
joseph-robertson Nov 4, 2024
b03fd83
Update template osw file.
joseph-robertson Nov 4, 2024
1ae24ad
Check zip code for lead zero.
joseph-robertson Nov 5, 2024
103a820
Fix integer conversion in new method.
joseph-robertson Nov 5, 2024
487ed0e
Merge branch 'master' into optional-build-args
joseph-robertson Nov 20, 2024
20ab04f
Respond to review comments.
joseph-robertson Nov 20, 2024
abd5407
Merge branch 'master' into optional-build-args
joseph-robertson Nov 21, 2024
a763f64
Update argument descriptions, defaults, tests, etc.
joseph-robertson Nov 21, 2024
bbad3f7
Change all build osw values to strings.
joseph-robertson Nov 21, 2024
5d9edca
Merge branch 'master' into optional-build-args
joseph-robertson Dec 2, 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
1,454 changes: 581 additions & 873 deletions BuildResidentialHPXML/README.md

Large diffs are not rendered by default.

7,483 changes: 4,589 additions & 2,894 deletions BuildResidentialHPXML/measure.rb

Large diffs are not rendered by default.

1,600 changes: 842 additions & 758 deletions BuildResidentialHPXML/measure.xml

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions BuildResidentialHPXML/resources/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Collection of constants.
module Constants
Auto = 'auto'
BuildingAmerica = 'BuildingAmerica'
FacadeFront = 'front'
FacadeBack = 'back'
Expand All @@ -16,3 +17,12 @@ module Constants
RoofTypeGable = 'gable'
RoofTypeHip = 'hip'
end

# TODO
module Argument
Choice = 'makeChoiceArgument'
String = 'makeStringArgument'
Double = 'makeDoubleArgument'
Integer = 'makeIntegerArgument'
Boolean = 'makeBoolArgument'
end
56 changes: 24 additions & 32 deletions BuildResidentialHPXML/resources/geometry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -676,10 +676,10 @@ def self.create_single_family_attached(model:,
geometry_attic_type:,
geometry_roof_type:,
geometry_roof_pitch:,
geometry_unit_left_wall_is_adiabatic:,
geometry_unit_right_wall_is_adiabatic:,
geometry_unit_front_wall_is_adiabatic:,
geometry_unit_back_wall_is_adiabatic:,
geometry_unit_left_wall_is_adiabatic: false,
geometry_unit_right_wall_is_adiabatic: false,
geometry_unit_front_wall_is_adiabatic: false,
geometry_unit_back_wall_is_adiabatic: false,
**)

cfa = geometry_unit_cfa
Expand Down Expand Up @@ -976,10 +976,10 @@ def self.create_apartment(model:,
geometry_attic_type:,
geometry_roof_type:,
geometry_roof_pitch:,
geometry_unit_left_wall_is_adiabatic:,
geometry_unit_right_wall_is_adiabatic:,
geometry_unit_front_wall_is_adiabatic:,
geometry_unit_back_wall_is_adiabatic:,
geometry_unit_left_wall_is_adiabatic: false,
geometry_unit_right_wall_is_adiabatic: false,
geometry_unit_front_wall_is_adiabatic: false,
geometry_unit_back_wall_is_adiabatic: false,
**)

cfa = geometry_unit_cfa
Expand Down Expand Up @@ -1375,14 +1375,10 @@ def self.create_doors(runner:,
#
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param window_front_wwr [Double] ratio of window to wall area for the unit's front facade (frac)
# @param window_back_wwr [Double] ratio of window to wall area for the unit's back facade (frac)
# @param window_left_wwr [Double] ratio of window to wall area for the unit's left facade (frac)
# @param window_right_wwr [Double] ratio of window to wall area for the unit's right facade (frac)
# @param window_area_front [Double] amount of window area on unit's front facade (ft2)
# @param window_area_back [Double] amount of window area on unit's back facade (ft2)
# @param window_area_left [Double] amount of window area on unit's left facade (ft2)
# @param window_area_right [Double] amount of window area on unit's right facade (ft2)
# @param window_area_front [Double] amount of window area on unit's front facade or window to wall ratio if less than 1 (ft2 or frac)
# @param window_area_back [Double] amount of window area on unit's back facade or window to wall ratio if less than 1 (ft2 or frac)
# @param window_area_left [Double] amount of window area on unit's left facade or window to wall ratio if less than 1 (ft2 or frac)
# @param window_area_right [Double] amount of window area on unit's right facade or window to wall ratio if less than 1 (ft2 or frac)
# @param window_aspect_ratio [Double] ratio of window height to width (frac)
# @param skylight_area_front [Double] amount of skylight area on the unit's front conditioned roof facade (ft2)
# @param skylight_area_back [Double] amount of skylight area on the unit's back conditioned roof facade (ft2)
Expand All @@ -1391,32 +1387,28 @@ def self.create_doors(runner:,
# @return [Boolean] true if successful
def self.create_windows_and_skylights(runner:,
model:,
window_front_wwr:,
window_back_wwr:,
window_left_wwr:,
window_right_wwr:,
window_area_front:,
window_area_back:,
window_area_left:,
window_area_right:,
window_aspect_ratio:,
skylight_area_front:,
skylight_area_back:,
skylight_area_left:,
skylight_area_right:,
skylight_area_front: 0,
skylight_area_back: 0,
skylight_area_left: 0,
skylight_area_right: 0,
**)
facades = [Constants::FacadeBack, Constants::FacadeRight, Constants::FacadeFront, Constants::FacadeLeft]

wwrs = {}
wwrs[Constants::FacadeBack] = window_back_wwr
wwrs[Constants::FacadeRight] = window_right_wwr
wwrs[Constants::FacadeFront] = window_front_wwr
wwrs[Constants::FacadeLeft] = window_left_wwr
wwrs[Constants::FacadeBack] = (window_area_back < 1 ? window_area_back : 0.0)
wwrs[Constants::FacadeRight] = (window_area_right < 1 ? window_area_right : 0.0)
wwrs[Constants::FacadeFront] = (window_area_front < 1 ? window_area_front : 0.0)
wwrs[Constants::FacadeLeft] = (window_area_left < 1 ? window_area_left : 0.0)
window_areas = {}
window_areas[Constants::FacadeBack] = window_area_back
window_areas[Constants::FacadeRight] = window_area_right
window_areas[Constants::FacadeFront] = window_area_front
window_areas[Constants::FacadeLeft] = window_area_left
window_areas[Constants::FacadeBack] = (window_area_back >= 1 ? window_area_back : 0.0)
window_areas[Constants::FacadeRight] = (window_area_right >= 1 ? window_area_right : 0.0)
window_areas[Constants::FacadeFront] = (window_area_front >= 1 ? window_area_front : 0.0)
window_areas[Constants::FacadeLeft] = (window_area_left >= 1 ? window_area_left : 0.0)

skylight_areas = {}
skylight_areas[Constants::FacadeBack] = skylight_area_back
Expand Down
Loading