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

PR for testing OS 3.8.0rc-2 #169

Merged
merged 23 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
26d1318
initial commit for os 3.8 support
DavidGoldwasser Apr 30, 2024
1086749
Replace OsLib_HelperMethod calls with new runner methods.
joseph-robertson May 1, 2024
ec23414
seeing what happens if comment out ext gem and standards from gemspec
DavidGoldwasser May 7, 2024
effcc3f
Update openstudio-common-measures.gemspec
DavidGoldwasser May 7, 2024
204410e
for testing matching gemfile from openstuido-ee-gem
DavidGoldwasser May 7, 2024
b58d1d9
removed require openstuio-extension but didn't fix measures
DavidGoldwasser May 7, 2024
5138ce9
updating min version of relevant measures
DavidGoldwasser May 7, 2024
bc4c412
Merge branch '0.10.0-rc1' into replace-os-lib-helper-methods
DavidGoldwasser May 8, 2024
d4434b0
Merge pull request #167 from NREL/replace-os-lib-helper-methods
DavidGoldwasser May 8, 2024
1ed804d
updates to openstudio_results
DavidGoldwasser May 14, 2024
ae5620c
updates for various measures
DavidGoldwasser May 14, 2024
ce68098
updates to generic qaqc
DavidGoldwasser May 14, 2024
d8c8773
updating Gemfile adn gemspec to match model articulation repo
DavidGoldwasser May 14, 2024
b5a9469
adding make_qaqc_results_vector
DavidGoldwasser May 15, 2024
04d1b9d
adding sql file as argument to method
DavidGoldwasser May 17, 2024
e152613
Update 0116_OfficeTest121_dev.osm
DavidGoldwasser May 17, 2024
2f0f7ec
updating jenkins file to match model articulation to get CI running a…
DavidGoldwasser May 17, 2024
c904d19
reverting xcel qaqc reporting to not use standard for now
DavidGoldwasser Jun 7, 2024
79ffbbd
update to openstudio-standards 0.6.1
DavidGoldwasser Jun 7, 2024
6d8cc3c
Trying update to test model
DavidGoldwasser Jun 7, 2024
d65e411
Update gha for OS 3.8
kflemin Jul 9, 2024
a6be626
cleanup gemspec
kflemin Jul 10, 2024
46b8e29
ran update_measures
kflemin Jul 11, 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# OpenStudio Common Measures Gem

## Version 0.10.0
- Support for OpenStudio 3.8 (upgrade to standards gem 0.6.0, extension gem 0.8.0)
- Support Ruby 3.2.2

## Version 0.9.0

- Support for OpenStudio 3.7 (upgrade to standards gem 0.5.0, extension gem 0.7)
Expand Down
15 changes: 10 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
source 'http://rubygems.org'

# Specify your gem's dependencies in openstudio-model-articulation.gemspec
gemspec

# Local gems are useful when developing and integrating the various dependencies.
Expand All @@ -10,12 +11,16 @@ gemspec
# checkout the latest version (develop) from github.
allow_local = ENV['FAVOR_LOCAL_GEMS']

# Delete when these branchesa are merged and released
# gem 'openstudio-extension', github: 'NREL/OpenStudio-extension-gem', branch: 'wenyi-bypass-zlib'
# gem 'openstudio-standards', github: 'NREL/openstudio-standards', tag: 'v0.6.0.rc2', ref: "1c42110"
# gem 'openstudio_measure_tester', :git => 'https://github.com/NREL/OpenStudio-measure-tester-gem.git', :branch => 'wenyi-dependencies-update'
# gem 'openstudio-workflow', :git => 'https://github.com/NREL/OpenStudio-workflow-gem.git', :branch => 'develop', ref: "32126e9b9f6"
# gem 'bcl', :git => 'https://github.com/wenyikuang/bcl-gem.git', :branch => 'develop'

# Only uncomment if you need to test a different version of the extension gem
if allow_local && File.exist?('../OpenStudio-extension-gem')
gem 'openstudio-extension', path: '../OpenStudio-extension-gem'
elsif allow_local
gem 'openstudio-extension', github: 'NREL/OpenStudio-extension-gem', branch: 'develop'
end

# For Testing
# gem 'openstudio-standards', github: 'NREL/openstudio-standards', branch: '3.5.0_changes'
# gem 'openstudio-extension', github: 'NREL/OpenStudio-extension-gem', branch: 'v0.6.0'
end
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//Jenkins pipelines are stored in shared libraries. Please see: https://github.com/NREL/cbci_jenkins_libs

@Library('cbci_shared_libs') _
@Library('cbci_shared_libs@developExtension') _

// Build for PR to develop branch only.
if ((env.CHANGE_ID) && (env.CHANGE_TARGET) ) { // check if set
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ bundle exec rake openstudio:test_with_openstudio

|OpenStudio Common Measures Gem|OpenStudio|Ruby|
|:--------------:|:----------:|:--------:|
| 0.10.0 | 3.8 | 3.2.2 |
| 0.9.0 | 3.7 | 2.7 |
| 0.8.0 | 3.6 | 2.7 |
| 0.7.0 | 3.5 | 2.7 |
Expand Down
21 changes: 8 additions & 13 deletions lib/measures/ChangeBuildingLocation/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@
# Authors : Nicholas Long, David Goldwasser
# Simple measure to load the EPW file and DDY file

# load OpenStudio measure libraries from openstudio-extension gem
require 'openstudio-extension'
require 'openstudio/extension/core/os_lib_helper_methods'
require 'openstudio/extension/core/os_lib_model_generation.rb'

class ChangeBuildingLocation < OpenStudio::Measure::ModelMeasure
Dir[File.dirname(__FILE__) + '/resources/*.rb'].each { |file| require file }

# resource file modules
include OsLib_HelperMethods
include OsLib_ModelGeneration
require 'openstudio-standards'

# define the name that a user will see, this method may be deprecated as
# the display name in PAT comes from the name field in measure.xml
Expand All @@ -34,10 +26,11 @@ def arguments(model)
args << weather_file_name

# make choice argument for climate zone
choices = OpenStudio::StringVector.new
#choices = OpenStudio::StringVector.new
choices = OpenstudioStandards::CreateTypical.get_climate_zones
choices << 'Lookup From Stat File'

climate_zone = OpenStudio::Measure::OSArgument.makeChoiceArgument('climate_zone', get_climate_zones(false, 'Lookup From Stat File'), true)
climate_zone = OpenStudio::Measure::OSArgument.makeChoiceArgument('climate_zone', choices, true)
climate_zone.setDisplayName('Climate Zone.')
climate_zone.setDefaultValue('Lookup From Stat File')
args << climate_zone
Expand Down Expand Up @@ -74,14 +67,16 @@ def run(model, runner, user_arguments)
super(model, runner, user_arguments)

# assign the user inputs to variables
args = OsLib_HelperMethods.createRunVariables(runner, model, user_arguments, arguments(model))
args = runner.getArgumentValues(arguments(model), user_arguments)
args = Hash[args.collect{ |k, v| [k.to_s, v] }]
if !args then return false end

# lookup and replace argument values from upstream measures
if args['use_upstream_args'] == true
args.each do |arg, value|
next if arg == 'use_upstream_args' # this argument should not be changed
value_from_osw = OsLib_HelperMethods.check_upstream_measure_for_arg(runner, arg)
value_from_osw = runner.getPastStepValuesForName(arg)
value_from_osw = value_from_osw.collect{ |k, v| Hash[:measure_name => k, :value => v] }.first if !value_from_osw.empty?
if !value_from_osw.empty?
runner.registerInfo("Replacing argument named #{arg} from current measure with a value of #{value_from_osw[:value]} from #{value_from_osw[:measure_name]}.")
new_val = value_from_osw[:value]
Expand Down
2 changes: 1 addition & 1 deletion lib/measures/ChangeBuildingLocation/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@
<version>
<software_program>OpenStudio</software_program>
<identifier>2.0.0</identifier>
<min_compatible>3.0.0</min_compatible>
<min_compatible>3.8.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
Expand Down
4 changes: 3 additions & 1 deletion lib/measures/XcelEDAReportingandQAQC/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# start the measure
class XcelEDAReportingandQAQC < OpenStudio::Measure::ReportingMeasure
require 'openstudio-standards'

# require all .rb files in resources folder
Dir[File.dirname(__FILE__) + '/resources/*.rb'].each { |file| require file }
Expand Down Expand Up @@ -133,7 +134,8 @@ def run(runner, user_arguments)

# vector to store the results and checks
report_elems = OpenStudio::AttributeVector.new
report_elems << create_results(skip_weekends = true,
report_elems << OpenstudioStandards::QAQC.make_qaqc_results_vector(@sql,
skip_weekends = true,
skip_holidays = true,
start_mo = 'June',
start_day = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,10 @@ OS:ScheduleTypeLimits,

OS:SimulationControl,
{657ba578-29ab-439c-87b6-218865343bf2}, ! Handle
No, ! Do Zone Sizing Calculation
No, ! Do System Sizing Calculation
No, ! Do Plant Sizing Calculation
No, ! Run Simulation for Sizing Periods
Yes, ! Do Zone Sizing Calculation
Yes, ! Do System Sizing Calculation
Yes, ! Do Plant Sizing Calculation
Yes, ! Run Simulation for Sizing Periods
Yes, ! Run Simulation for Weather File Run Periods
0.040000000000000001, ! Loads Convergence Tolerance Value
0.40000000000000002, ! Temperature Convergence Tolerance Value
Expand Down
2 changes: 0 additions & 2 deletions lib/measures/add_ems_emissions_reporting/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# *******************************************************************************

require 'csv'
require 'openstudio-extension'
require 'openstudio/extension/core/os_lib_helper_methods'

# start the measure
class AddEMSEmissionsReporting < OpenStudio::Measure::ModelMeasure
Expand Down
2 changes: 1 addition & 1 deletion lib/measures/add_ems_emissions_reporting/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@
<version>
<software_program>OpenStudio</software_program>
<identifier>2.5.1</identifier>
<min_compatible>2.5.1</min_compatible>
<min_compatible>3.8.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
Expand Down
2 changes: 0 additions & 2 deletions lib/measures/add_ems_to_control_ev_charging/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# *******************************************************************************

# start the measure
require 'openstudio-extension'
require 'openstudio/extension/core/os_lib_helper_methods'
class AddEMSToControlEVCharging < OpenStudio::Measure::ModelMeasure
# human readable name
def name
Expand Down
2 changes: 1 addition & 1 deletion lib/measures/add_ems_to_control_ev_charging/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<version>
<software_program>OpenStudio</software_program>
<identifier>2.5.1</identifier>
<min_compatible>2.5.1</min_compatible>
<min_compatible>3.8.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
Expand Down
12 changes: 5 additions & 7 deletions lib/measures/add_rooftop_pv/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
# see the URL below for information on how to write OpenStudio measures
# http://nrel.github.io/OpenStudio-user-documentation/measures/measure_writing_guide/

# load OpenStudio measure libraries from openstudio-extension gem
require 'openstudio-extension'
require 'openstudio/extension/core/os_lib_helper_methods'
require 'openstudio/extension/core/os_lib_schedules'

# start the measure
class AddRooftopPV < OpenStudio::Measure::ModelMeasure
require 'openstudio-standards'

# human readable name
def name
return 'Add Rooftop PV'
Expand Down Expand Up @@ -68,7 +65,8 @@ def run(model, runner, user_arguments)
end

# assign the user inputs to variables
args = OsLib_HelperMethods.createRunVariables(runner, model, user_arguments, arguments(model))
args = runner.getArgumentValues(arguments(model), user_arguments)
args = Hash[args.collect{ |k, v| [k.to_s, v] }]
if !args then return false end

# check expected values of double arguments
Expand Down Expand Up @@ -101,7 +99,7 @@ def run(model, runner, user_arguments)
'summerTimeValuePairs' => { 24.0 => target_transmittance },
'defaultTimeValuePairs' => { 24.0 => target_transmittance }
}
pv_shading_transmittance_schedule = OsLib_Schedules.createSimpleSchedule(model, inputs)
pv_shading_transmittance_schedule = OpenstudioStandards::Schedules.create_simple_schedule(model, inputs)
runner.registerInfo("Created transmittance schedule for PV shading surfaces with constant value of #{target_transmittance}")

model.getSurfaces.each do |surface|
Expand Down
2 changes: 1 addition & 1 deletion lib/measures/add_rooftop_pv/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<version>
<software_program>OpenStudio</software_program>
<identifier>2.0.0</identifier>
<min_compatible>2.8.0</min_compatible>
<min_compatible>3.8.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
Expand Down
10 changes: 4 additions & 6 deletions lib/measures/air_wall_zone_mixing/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
# see the URL below for information on how to write OpenStudio measures
# http://nrel.github.io/OpenStudio-user-documentation/measures/measure_writing_guide/

# load OpenStudio measure libraries from openstudio-extension gem
require 'openstudio-extension'
require 'openstudio/extension/core/os_lib_geometry'

# start the measure
class AirWallZoneMixing < OpenStudio::Measure::ModelMeasure
require 'openstudio-standards'

# human readable name
def name
return 'Air Wall Zone Mixing'
Expand Down Expand Up @@ -78,8 +76,8 @@ def run(model, runner, user_arguments)
max_space_height = 0
zone.spaces.each do |space|
volume_counter += space.volume
min_space_zvalue = OsLib_Geometry.getSurfaceZValues(space.surfaces).sort.first # this expects an array of surfaces
max_space_zvalue = OsLib_Geometry.getSurfaceZValues(space.surfaces).sort.last # this expects an array of surfaces
min_space_zvalue = OpenstudioStandards::Geometry.surfaces_get_z_values(space.surfaces).sort.first # this expects an array of surfaces
max_space_zvalue = OpenstudioStandards::Geometry.surfaces_get_z_values(space.surfaces).sort.last # this expects an array of surfaces
if max_space_zvalue - min_space_zvalue > max_space_height
max_space_height = max_space_zvalue - min_space_zvalue
end
Expand Down
2 changes: 1 addition & 1 deletion lib/measures/air_wall_zone_mixing/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Zone mixing will only be added where there is an air wall and where the matched
<version>
<software_program>OpenStudio</software_program>
<identifier>2.0.0</identifier>
<min_compatible>2.8.0</min_compatible>
<min_compatible>3.8.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
Expand Down
4 changes: 0 additions & 4 deletions lib/measures/envelope_and_internal_load_breakdown/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
require 'erb'
require 'json'

# load OpenStudio measure libraries from openstudio-extension gem
require 'openstudio-extension'
require 'openstudio/extension/core/os_lib_helper_methods'

require "#{File.dirname(__FILE__)}/resources/os_lib_reporting_envelope_and_internal_loads_breakdown"

# start the measure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
<version>
<software_program>OpenStudio</software_program>
<identifier>2.0.0</identifier>
<min_compatible>3.1.0</min_compatible>
<min_compatible>3.8.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
Expand Down
7 changes: 2 additions & 5 deletions lib/measures/example_report/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
require 'erb'
require 'json'

# load OpenStudio measure libraries from openstudio-extension gem
require 'openstudio-extension'
require 'openstudio/extension/core/os_lib_helper_methods'

require "#{File.dirname(__FILE__)}/resources/os_lib_reporting_example"

# start the measure
Expand Down Expand Up @@ -88,7 +84,8 @@ def run(runner, user_arguments)
web_asset_path = setup[:web_asset_path]

# assign the user inputs to variables
args = OsLib_HelperMethods.createRunVariables(runner, model, user_arguments, arguments)
args = runner.getArgumentValues(arguments, user_arguments)
args = Hash[args.collect{ |k, v| [k.to_s, v] }]
unless args
return false
end
Expand Down
2 changes: 1 addition & 1 deletion lib/measures/example_report/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<version>
<software_program>OpenStudio</software_program>
<identifier>2.0.0</identifier>
<min_compatible>3.1.0</min_compatible>
<min_compatible>3.8.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
Expand Down
23 changes: 8 additions & 15 deletions lib/measures/generic_qaqc/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,14 @@
require 'json'
require 'openstudio-standards'

# load OpenStudio measure libraries from openstudio-extension gem
require 'openstudio-extension'
require 'openstudio/extension/core/os_lib_schedules'
require 'openstudio/extension/core/os_lib_helper_methods'
require 'openstudio/extension/core/os_lib_model_generation.rb'

# require all .rb files in resources folder
# todo - remove resource ruby files and connect to OpenstudioStandards::QAQC
Dir[File.dirname(__FILE__) + '/resources/*.rb'].each { |file| require file }

# start the measure
class GenericQAQC < OpenStudio::Measure::ReportingMeasure
# all QAQC checks should be in OsLib_QAQC module
include OsLib_QAQC
include OsLib_HelperMethods
include OsLib_ModelGeneration

# OsLib_CreateResults is needed for utility EDA programs but not the generic QAQC measure
# include OsLib_CreateResults

# define the name that a user will see, this method may be deprecated as
# the display name in PAT comes from the name field in measure.xml
Expand Down Expand Up @@ -92,7 +82,7 @@ def arguments(model = nil)
args = OpenStudio::Measure::OSArgumentVector.new

# Make an argument for the template
template = OpenStudio::Measure::OSArgument.makeChoiceArgument('template', get_doe_templates(false), true)
template = OpenStudio::Measure::OSArgument.makeChoiceArgument('template', OpenstudioStandards::CreateTypical.get_doe_templates(false), true)
template.setDisplayName('Target ASHRAE Standard')
template.setDescription('This used to set the target standard for most checks.')
template.setDefaultValue('90.1-2013') # there is override variable in run method for this
Expand Down Expand Up @@ -169,7 +159,8 @@ def energyPlusOutputRequests(runner, user_arguments)
result = OpenStudio::IdfObjectVector.new

# assign the user inputs to variables
args = OsLib_HelperMethods.createRunVariables(runner, @model, user_arguments, arguments)
args = runner.getArgumentValues(arguments, user_arguments)
args = Hash[args.collect{ |k, v| [k.to_s, v] }]
unless args
return false
end
Expand Down Expand Up @@ -231,7 +222,8 @@ def run(runner, user_arguments)
climateZones.setClimateZone('ASHRAE', cz)

# assign the user inputs to variables
args = OsLib_HelperMethods.createRunVariables(runner, @model, user_arguments, arguments)
args = runner.getArgumentValues(arguments, user_arguments)
args = Hash[args.collect{ |k, v| [k.to_s, v] }]
unless args
return false
end
Expand All @@ -246,7 +238,8 @@ def run(runner, user_arguments)
if args['use_upstream_args'] == true
args.each do |arg, value|
next if arg == 'use_upstream_args' # this argument should not be changed
value_from_osw = OsLib_HelperMethods.check_upstream_measure_for_arg(runner, arg)
value_from_osw = runner.getPastStepValuesForName(arg)
value_from_osw = value_from_osw.collect{ |k, v| Hash[:measure_name => k, :value => v] }.first if !value_from_osw.empty?
if !value_from_osw.empty?
runner.registerInfo("Replacing argument named #{arg} from current measure with a value of #{value_from_osw[:value]} from #{value_from_osw[:measure_name]}.")
new_val = value_from_osw[:value]
Expand Down
2 changes: 1 addition & 1 deletion lib/measures/generic_qaqc/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@
<version>
<software_program>OpenStudio</software_program>
<identifier>2.0.0</identifier>
<min_compatible>3.1.0</min_compatible>
<min_compatible>3.8.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
Expand Down
4 changes: 2 additions & 2 deletions lib/measures/generic_qaqc/resources/check_air_sys_temps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def check_air_sys_temps(category, target_standard, max_sizing_temp_delta = 0.1,
when 'OS_SetpointManager_Scheduled'
sch = spm.to_SetpointManagerScheduled.get.schedule
if sch.to_ScheduleRuleset.is_initialized
min_c = std.schedule_ruleset_annual_min_max_value(sch.to_ScheduleRuleset.get)['min']
max_c = std.schedule_ruleset_annual_min_max_value(sch.to_ScheduleRuleset.get)['max']
min_c = openstudiostandards::schedules.schedule_ruleset_annual_min_max_value(sch.to_ScheduleRuleset.get)['min']
max_c = openstudiostandards::schedules.schedule_ruleset_annual_min_max_value(sch.to_ScheduleRuleset.get)['max']
elsif sch.to_ScheduleConstant.is_initialized
min_c = std.schedule_constant_annual_min_max_value(sch.to_ScheduleConstant.get)['min']
max_c = std.schedule_constant_annual_min_max_value(sch.to_ScheduleConstant.get)['max']
Expand Down
Loading
Loading