Skip to content

Commit 2ab88fe

Browse files
authored
Merge pull request #277 from urbanopt/develop
Version 1.0.0
2 parents 3f3b456 + 290e39a commit 2ab88fe

18 files changed

Lines changed: 96 additions & 79 deletions

.github/workflows/nightly_ci_build.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,28 @@ name: Scenario-gem CI
33

44
on:
55
workflow_dispatch:
6-
# push:
6+
push:
77
schedule:
88
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
99
# 5 am UTC (11pm MDT the day before) every weekday night in MDT
1010
- cron: '21 5 * * 2-6'
11-
pull_request:
12-
types: [review_requested]
1311

1412
env:
15-
# This env var should enforce develop branch of all dependencies
13+
# This env var will enforce develop branch of all dependencies
1614
FAVOR_LOCAL_GEMS: true
1715
GEM_DEVELOPER_KEY: ${{ secrets.GEM_DEVELOPER_KEY }}
1816

1917
jobs:
2018
weeknight-tests:
21-
# ubuntu-latest works since https://github.com/rbenv/ruby-build/releases/tag/v20220710 (July 10, 2022)
22-
# https://github.com/rbenv/ruby-build/discussions/1940
2319
runs-on: ubuntu-latest
2420
container:
25-
image: docker://nrel/openstudio:3.7.0
21+
image: docker://nrel/openstudio:3.9.0
2622
steps:
2723
- uses: actions/checkout@v4
2824
- name: Update gems
29-
run: bundle update
25+
run: |
26+
bundle install
27+
bundle update
3028
- name: Run Rspec
3129
run: bundle exec rspec
3230
- name: Coveralls

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# URBANopt Scenario Gem
22

3+
## Version 1.0.0
4+
5+
Date Range: 05/06/24 - 01/23/25
6+
7+
* Upgrade to OpenStudio 3.9 and Ruby 3.2.2 by @vtnate in https://github.com/urbanopt/urbanopt-scenario-gem/pull/276
8+
* Fixup openstudio-extension-gem sub bundle errors by @jmarrec in https://github.com/urbanopt/urbanopt-scenario-gem/pull/275
9+
10+
### New Contributors
11+
12+
* @jmarrec made their first contribution in https://github.com/urbanopt/urbanopt-scenario-gem/pull/275
13+
14+
**Full Changelog**: https://github.com/urbanopt/urbanopt-scenario-gem/compare/v0.12.0...v1.0.0
15+
316
## Version 0.12.0
417
Date Range: 01/10/24 - 05/06/24
518
* Use new version of reporting-gem by @vtnate in https://github.com/urbanopt/urbanopt-scenario-gem/pull/271
@@ -194,7 +207,7 @@ Date Range: 01/15/20 - 03/30/20:
194207
- Fixed [#83]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/83 ), add multiple pV
195208
- Fixed [#88]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/88 ), add units to CSV reports
196209
- Fixed [#89]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/89 ), created Save feature report method
197-
- Fixed [#91]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/91 ), add total_costruction_cost to reports
210+
- Fixed [#91]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/91 ), add total_construction_cost to reports
198211
- Fixed [#95]( https://github.com/urbanopt/urbanopt-scenario-gem/issues/95 ), list datapoint failures
199212
- Fixed [#98]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/98 ), add power, net power, net energy and apparent power to timeseries results
200213
- Fixed [#101]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/101 ), fix for unit conversion when timeseries doe not exist

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ allow_local = ENV['FAVOR_LOCAL_GEMS']
2323
# if allow_local && File.exist?('../urbanopt-core-gem')
2424
# gem 'urbanopt-core', path: '../urbanopt-core-gem'
2525
# elsif allow_local
26-
# gem 'urbanopt-core', github: 'URBANopt/urbanopt-core-gem', branch: 'os37'
26+
# gem 'urbanopt-core', github: 'URBANopt/urbanopt-core-gem', branch: 'os39'
2727
# end
2828

2929
# if allow_local && File.exist?('../openstudio-common-measures-gem')

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
URBANopt (tm), Copyright (c) 2019-2024, Alliance for Sustainable Energy, LLC, and other
1+
URBANopt (tm), Copyright (c) 2019-2025, Alliance for Sustainable Energy, LLC, and other
22
contributors. All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification,

doc_templates/LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
URBANopt (tm), Copyright (c) 2019-2024, Alliance for Sustainable Energy, LLC, and other
1+
URBANopt (tm), Copyright (c) 2019-2025, Alliance for Sustainable Energy, LLC, and other
22
contributors. All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification,

doc_templates/copyright_erb.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%
22
# *********************************************************************************
3-
# URBANopt (tm), Copyright (c) 2019-2024, Alliance for Sustainable Energy, LLC, and other
3+
# URBANopt (tm), Copyright (c) 2019-2025, Alliance for Sustainable Energy, LLC, and other
44
# contributors. All rights reserved.
55

66
# Redistribution and use in source and binary forms, with or without modification,

lib/urbanopt/scenario/logger.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module URBANopt
99
module Scenario
1010
@@logger = Logger.new($stdout)
1111

12-
# Definining class variable "@@logger" to log errors, info and warning messages.
12+
# Defining class variable "@@logger" to log errors, info and warning messages.
1313
def self.logger
1414
@@logger
1515
end

lib/urbanopt/scenario/scenario_csv.rb

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,31 @@ def initialize(name, root_dir, run_dir, feature_file, mapper_files_dir, csv_file
4848
# Require all simulation mappers in mapper_files_dir
4949
def load_mapper_files
5050
# loads default values from extension gem
51-
options = OpenStudio::Extension::RunnerConfig.default_config
51+
@options = OpenStudio::Extension::RunnerConfig.default_config(@root_dir)
5252
# check if runner.conf file exists
5353
if File.exist?(File.join(@root_dir, OpenStudio::Extension::RunnerConfig::FILENAME))
5454
runner_config = OpenStudio::Extension::RunnerConfig.new(@root_dir)
55-
# use the default values overriden with runner.conf values
56-
options = options.merge(runner_config.options)
55+
# use the default values overridden with runner.conf values where not
56+
# nil nor empty strings
57+
@options = @options.merge(runner_config.options.reject{|k, v| v.nil? || (v.kind_of?(String) && v === '')})
5758
end
5859

5960
# bundle path is assigned from the runner.conf if it exists or is assigned in the root_dir
60-
bundle_path = !options.key?(:bundle_install_path) || options[:bundle_install_path] === '' ? File.join(@root_dir, '.bundle/install/') : options[:bundle_install_path]
61+
# if bundle install path is not provided or is empty, it will be placed in root_dir/.bundle/install, otherwise use the provided path
62+
if !@options.key?(:bundle_install_path) || @options[:bundle_install_path] === ''
63+
@options[:bundle_install_path] = File.join(@root_dir, '.bundle/install/')
64+
else
65+
@options[:bundle_install_path]= Pathname.new(@options[:bundle_install_path]).cleanpath.to_s
66+
end
67+
bundle_path = @options[:bundle_install_path]
68+
69+
puts "Bundle final path is set to: #{bundle_path}"
6170

6271
# checks if bundle path doesn't exist or is empty
6372
if !Dir.exist?(bundle_path) || Dir.empty?(bundle_path)
64-
# install bundle
65-
OpenStudio::Extension::Runner.new(@root_dir)
73+
Bundler.with_unbundled_env do
74+
OpenStudio::Extension::Runner.new(@root_dir, [], @options)
75+
end
6676
end
6777

6878
# find all lib dirs in the bundle path and add them to the path

lib/urbanopt/scenario/scenario_datapoint_base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def create_osw
8989
# rubocop: enable Style/EvalWithLocation #:nodoc:
9090

9191
##
92-
# Return true if the datapoint is out of date, false otherwise. Non-existant files are out of date.
92+
# Return true if the datapoint is out of date, false otherwise. Non-existent files are out of date.
9393
##
9494
# [return:] _Boolean_ - True if the datapoint is out of date, false otherwise.
9595
def out_of_date?

lib/urbanopt/scenario/scenario_runner_osw.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ def create_simulation_files(scenario, force_clear = false)
4646

4747
##
4848
# Create and run all SimulationFileOSW for Scenario.
49-
# A staged runner is implented to run buildings, then transformers then district systems.
49+
# A staged runner is implemented to run buildings, then transformers then district systems.
5050
# - instantiate openstudio runner to run .osw files.
5151
# - create simulation files for this scenario.
5252
# - get feature_type value from in.osw files
53-
# - cretae 3 groups to store .osw files (+building_osws+ , +transformer_osws+ , +district_system_osws+)
53+
# - create 3 groups to store .osw files (+building_osws+ , +transformer_osws+ , +district_system_osws+)
5454
# - add each osw file to its corresponding group id +simulation_dir+ is out_of_date
5555
# - Run osw file groups in order and store simulation failure in a array.
5656
##
@@ -78,7 +78,7 @@ def run(scenario, force_clear = false, options = {})
7878
# end
7979
# end
8080

81-
# cretae 3 groups to store .osw files (+building_osws+ , +transformer_osws+ , +district_system_osws+)
81+
# create 3 groups to store .osw files (+building_osws+ , +transformer_osws+ , +district_system_osws+)
8282
building_osws = []
8383
transformer_osws = []
8484
district_system_osws = []

0 commit comments

Comments
 (0)