urbanopt-scenario 0.12.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f57c37ca80b5720cc531f38164d66148b350ab038c826c06de5e4e74eb2f1d12
4
- data.tar.gz: adb6a418f90e07392b33c51f65e8559ac39930f695c5e126dc0df0428e44cff6
3
+ metadata.gz: ac3b8620cce878dcc8a1053ba2a5341c65d7548ae5132fafe1239333cf819864
4
+ data.tar.gz: 392fd2ce49e3c470661b2e43c8e68ef6eb726587132ccb780aff11cd02877e61
5
5
  SHA512:
6
- metadata.gz: 3c3b92bfbb9679bd2db1b55aa47db0418c669a1c293364b77732c15b817cebca5a9977b6b206841f00d43f279350260bf114905178a5bc1ccb6870f76e0dd3d8
7
- data.tar.gz: 76c16600d3634084e0ff6011d2952ac8ed7abf4ef8573d2d97d01efd502b535fdc409c69b2d22f51b6ee3bc27349e5a580b5d37c6441b3d594b3ce453f74d89c
6
+ metadata.gz: 27c005602ae92c2dfa18c74820d6986f1b600adba88880b9b34835950b71d2668478720c2ccdba1f3e1758002b72be07eefbd4910c24ca60a3ec8b8cdd16e8f6
7
+ data.tar.gz: a7f7b94a01bb2523dc5cbfa054a13974f00319125688e5b93b80a79f6490c9416fcd8b2885deb91bba3a7b38c40c376c73f9f7dabce2340251ecfe2dcbc49afc
@@ -3,30 +3,28 @@ name: Scenario-gem CI
3
3
 
4
4
  on:
5
5
  workflow_dispatch:
6
- # push:
6
+ push:
7
7
  schedule:
8
8
  # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
9
9
  # 5 am UTC (11pm MDT the day before) every weekday night in MDT
10
10
  - cron: '21 5 * * 2-6'
11
- pull_request:
12
- types: [review_requested]
13
11
 
14
12
  env:
15
- # This env var should enforce develop branch of all dependencies
13
+ # This env var will enforce develop branch of all dependencies
16
14
  FAVOR_LOCAL_GEMS: true
17
15
  GEM_DEVELOPER_KEY: ${{ secrets.GEM_DEVELOPER_KEY }}
18
16
 
19
17
  jobs:
20
18
  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
23
19
  runs-on: ubuntu-latest
24
20
  container:
25
- image: docker://nrel/openstudio:3.7.0
21
+ image: docker://nrel/openstudio:3.9.0
26
22
  steps:
27
23
  - uses: actions/checkout@v4
28
24
  - name: Update gems
29
- run: bundle update
25
+ run: |
26
+ bundle install
27
+ bundle update
30
28
  - name: Run Rspec
31
29
  run: bundle exec rspec
32
30
  - name: Coveralls
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # URBANopt Scenario Gem
2
2
 
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
+
3
16
  ## Version 0.12.0
4
17
  Date Range: 01/10/24 - 05/06/24
5
18
  * 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:
194
207
  - Fixed [#83]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/83 ), add multiple pV
195
208
  - Fixed [#88]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/88 ), add units to CSV reports
196
209
  - 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
198
211
  - Fixed [#95]( https://github.com/urbanopt/urbanopt-scenario-gem/issues/95 ), list datapoint failures
199
212
  - Fixed [#98]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/98 ), add power, net power, net energy and apparent power to timeseries results
200
213
  - Fixed [#101]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/101 ), fix for unit conversion when timeseries doe not exist
data/Gemfile CHANGED
@@ -23,7 +23,7 @@ allow_local = ENV['FAVOR_LOCAL_GEMS']
23
23
  # if allow_local && File.exist?('../urbanopt-core-gem')
24
24
  # gem 'urbanopt-core', path: '../urbanopt-core-gem'
25
25
  # 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'
27
27
  # end
28
28
 
29
29
  # if allow_local && File.exist?('../openstudio-common-measures-gem')
data/LICENSE.md CHANGED
@@ -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
2
2
  contributors. All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
@@ -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
2
2
  contributors. All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
@@ -1,6 +1,6 @@
1
1
  <%
2
2
  # *********************************************************************************
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
4
4
  # contributors. All rights reserved.
5
5
 
6
6
  # Redistribution and use in source and binary forms, with or without modification,
@@ -9,7 +9,7 @@ module URBANopt
9
9
  module Scenario
10
10
  @@logger = Logger.new($stdout)
11
11
 
12
- # Definining class variable "@@logger" to log errors, info and warning messages.
12
+ # Defining class variable "@@logger" to log errors, info and warning messages.
13
13
  def self.logger
14
14
  @@logger
15
15
  end
@@ -48,21 +48,31 @@ module URBANopt
48
48
  # Require all simulation mappers in mapper_files_dir
49
49
  def load_mapper_files
50
50
  # loads default values from extension gem
51
- options = OpenStudio::Extension::RunnerConfig.default_config
51
+ @options = OpenStudio::Extension::RunnerConfig.default_config(@root_dir)
52
52
  # check if runner.conf file exists
53
53
  if File.exist?(File.join(@root_dir, OpenStudio::Extension::RunnerConfig::FILENAME))
54
54
  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 === '')})
57
58
  end
58
59
 
59
60
  # 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}"
61
70
 
62
71
  # checks if bundle path doesn't exist or is empty
63
72
  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
66
76
  end
67
77
 
68
78
  # find all lib dirs in the bundle path and add them to the path
@@ -89,7 +89,7 @@ module URBANopt
89
89
  # rubocop: enable Style/EvalWithLocation #:nodoc:
90
90
 
91
91
  ##
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.
93
93
  ##
94
94
  # [return:] _Boolean_ - True if the datapoint is out of date, false otherwise.
95
95
  def out_of_date?
@@ -46,11 +46,11 @@ module URBANopt
46
46
 
47
47
  ##
48
48
  # 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.
50
50
  # - instantiate openstudio runner to run .osw files.
51
51
  # - create simulation files for this scenario.
52
52
  # - 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+)
54
54
  # - add each osw file to its corresponding group id +simulation_dir+ is out_of_date
55
55
  # - Run osw file groups in order and store simulation failure in a array.
56
56
  ##
@@ -78,7 +78,7 @@ module URBANopt
78
78
  # end
79
79
  # end
80
80
 
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+)
82
82
  building_osws = []
83
83
  transformer_osws = []
84
84
  district_system_osws = []
@@ -30,7 +30,7 @@ module URBANopt
30
30
 
31
31
  ##
32
32
  # Return true if the simulation is out of date (input files newer than results), false otherwise.
33
- # Non-existant simulation input files are out of date.
33
+ # Non-existent simulation input files are out of date.
34
34
  ##
35
35
  def out_of_date?
36
36
  raise 'out_of_date? is not implemented for SimulationFileBase, override in your class'
@@ -110,7 +110,7 @@ module URBANopt
110
110
 
111
111
  ##
112
112
  # Return true if the simulation is out of date (input files newer than results), false otherwise.
113
- # Non-existant simulation input files are out of date.
113
+ # Non-existent simulation input files are out of date.
114
114
  ##
115
115
  def out_of_date?
116
116
  if !File.exist?(run_dir)
@@ -5,6 +5,6 @@
5
5
 
6
6
  module URBANopt
7
7
  module Scenario
8
- VERSION = '0.12.0'.freeze
8
+ VERSION = '1.0.0'.freeze
9
9
  end
10
10
  end
@@ -21,14 +21,14 @@ Gem::Specification.new do |spec|
21
21
  spec.bindir = 'exe'
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
- spec.required_ruby_version = '~> 2.7.0'
24
+ # We support exactly Ruby v3.2.2 because os-extension requires bundler==2.4.10 and that requires Ruby 3.2.2: https://stdgems.org/bundler/
25
+ # It would be nice to be able to use newer patches of Ruby 3.2, which would require os-extension to relax its dependency on bundler.
26
+ spec.required_ruby_version = '3.2.2'
25
27
 
26
- spec.add_development_dependency 'bundler', '~> 2.1'
27
- spec.add_development_dependency 'rake', '~> 13.1'
28
- spec.add_development_dependency 'rspec', '~> 3.12'
29
- spec.add_development_dependency 'simplecov', '~> 0.18.2'
30
- spec.add_development_dependency 'simplecov-lcov', '~> 0.8.0'
31
- spec.add_runtime_dependency 'sqlite3', '~> 1.6.0'
32
- spec.add_runtime_dependency 'urbanopt-core', '~> 0.11.0'
33
- spec.add_runtime_dependency 'urbanopt-reporting', '~> 0.10.0'
28
+ spec.add_development_dependency 'rspec', '~> 3.13'
29
+ spec.add_development_dependency 'simplecov', '0.22.0'
30
+ spec.add_development_dependency 'simplecov-lcov', '0.8.0'
31
+ spec.add_runtime_dependency 'sqlite3', '~> 2.0.0'
32
+ spec.add_runtime_dependency 'urbanopt-core', '~> 1.0.0'
33
+ spec.add_runtime_dependency 'urbanopt-reporting', '~> 1.0.0'
34
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbanopt-scenario
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rawad El Kontar
@@ -9,76 +9,48 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-05-06 00:00:00.000000000 Z
12
+ date: 2025-01-24 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: bundler
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: '2.1'
21
- type: :development
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "~>"
26
- - !ruby/object:Gem::Version
27
- version: '2.1'
28
- - !ruby/object:Gem::Dependency
29
- name: rake
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - "~>"
33
- - !ruby/object:Gem::Version
34
- version: '13.1'
35
- type: :development
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - "~>"
40
- - !ruby/object:Gem::Version
41
- version: '13.1'
42
14
  - !ruby/object:Gem::Dependency
43
15
  name: rspec
44
16
  requirement: !ruby/object:Gem::Requirement
45
17
  requirements:
46
18
  - - "~>"
47
19
  - !ruby/object:Gem::Version
48
- version: '3.12'
20
+ version: '3.13'
49
21
  type: :development
50
22
  prerelease: false
51
23
  version_requirements: !ruby/object:Gem::Requirement
52
24
  requirements:
53
25
  - - "~>"
54
26
  - !ruby/object:Gem::Version
55
- version: '3.12'
27
+ version: '3.13'
56
28
  - !ruby/object:Gem::Dependency
57
29
  name: simplecov
58
30
  requirement: !ruby/object:Gem::Requirement
59
31
  requirements:
60
- - - "~>"
32
+ - - '='
61
33
  - !ruby/object:Gem::Version
62
- version: 0.18.2
34
+ version: 0.22.0
63
35
  type: :development
64
36
  prerelease: false
65
37
  version_requirements: !ruby/object:Gem::Requirement
66
38
  requirements:
67
- - - "~>"
39
+ - - '='
68
40
  - !ruby/object:Gem::Version
69
- version: 0.18.2
41
+ version: 0.22.0
70
42
  - !ruby/object:Gem::Dependency
71
43
  name: simplecov-lcov
72
44
  requirement: !ruby/object:Gem::Requirement
73
45
  requirements:
74
- - - "~>"
46
+ - - '='
75
47
  - !ruby/object:Gem::Version
76
48
  version: 0.8.0
77
49
  type: :development
78
50
  prerelease: false
79
51
  version_requirements: !ruby/object:Gem::Requirement
80
52
  requirements:
81
- - - "~>"
53
+ - - '='
82
54
  - !ruby/object:Gem::Version
83
55
  version: 0.8.0
84
56
  - !ruby/object:Gem::Dependency
@@ -87,42 +59,42 @@ dependencies:
87
59
  requirements:
88
60
  - - "~>"
89
61
  - !ruby/object:Gem::Version
90
- version: 1.6.0
62
+ version: 2.0.0
91
63
  type: :runtime
92
64
  prerelease: false
93
65
  version_requirements: !ruby/object:Gem::Requirement
94
66
  requirements:
95
67
  - - "~>"
96
68
  - !ruby/object:Gem::Version
97
- version: 1.6.0
69
+ version: 2.0.0
98
70
  - !ruby/object:Gem::Dependency
99
71
  name: urbanopt-core
100
72
  requirement: !ruby/object:Gem::Requirement
101
73
  requirements:
102
74
  - - "~>"
103
75
  - !ruby/object:Gem::Version
104
- version: 0.11.0
76
+ version: 1.0.0
105
77
  type: :runtime
106
78
  prerelease: false
107
79
  version_requirements: !ruby/object:Gem::Requirement
108
80
  requirements:
109
81
  - - "~>"
110
82
  - !ruby/object:Gem::Version
111
- version: 0.11.0
83
+ version: 1.0.0
112
84
  - !ruby/object:Gem::Dependency
113
85
  name: urbanopt-reporting
114
86
  requirement: !ruby/object:Gem::Requirement
115
87
  requirements:
116
88
  - - "~>"
117
89
  - !ruby/object:Gem::Version
118
- version: 0.10.0
90
+ version: 1.0.0
119
91
  type: :runtime
120
92
  prerelease: false
121
93
  version_requirements: !ruby/object:Gem::Requirement
122
94
  requirements:
123
95
  - - "~>"
124
96
  - !ruby/object:Gem::Version
125
- version: 0.10.0
97
+ version: 1.0.0
126
98
  description: Library to export data point OSW files from URBANopt Scenario CSV
127
99
  email:
128
100
  - rawad.elkontar@nrel.gov
@@ -194,16 +166,16 @@ require_paths:
194
166
  - lib
195
167
  required_ruby_version: !ruby/object:Gem::Requirement
196
168
  requirements:
197
- - - "~>"
169
+ - - '='
198
170
  - !ruby/object:Gem::Version
199
- version: 2.7.0
171
+ version: 3.2.2
200
172
  required_rubygems_version: !ruby/object:Gem::Requirement
201
173
  requirements:
202
174
  - - ">="
203
175
  - !ruby/object:Gem::Version
204
176
  version: '0'
205
177
  requirements: []
206
- rubygems_version: 3.1.4
178
+ rubygems_version: 3.4.10
207
179
  signing_key:
208
180
  specification_version: 4
209
181
  summary: Library to export data point OSW files from URBANopt Scenario CSV