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

Version 1.4.0 #86

Merged
merged 17 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 26 additions & 1 deletion .github/workflows/openstudio-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
shell: bash
run: "sudo apt install -y ruby && ruby -v" # ruby anye tests here when ready
ubuntu-2004: # ruby 2.7 workflow
if: github.event.pull_request.base.ref != '1.1.X-LTS' # check target branch of pr
if: github.event.pull_request.base.ref == '1.3.X-LTS' # check target branch of pr
runs-on: ubuntu-20.04
steps:
-
Expand All @@ -38,3 +38,28 @@ jobs:
-v $(pwd):/var/simdata/openstudio \
nrel/openstudio:3.7.0 \
/bin/bash -c "bundle install && bundle exec rake"
ubuntu-2204: # ruby 3.2 workflow in 22.04
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
- name: Display system info
run: |
ruby --version
docker --version
docker-compose --version
- name: Start OpenStudio for testing Server API
run: |
echo "Not yet implemented"
- name: Run tests in Docker
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
docker run -e COVERALLS_REPO_TOKEN=${COVERALLS_REPO_TOKEN} \
-v $(pwd):/var/simdata/openstudio \
nrel/openstudio:develop \
/bin/bash -c "bundle install && bundle exec rake"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
OpenStudio(R) Analysis Gem Change Log
==================================

Version 1.4.0
-------------
* Ruby 3.2 and OpenStudio 3.8.0

Version 1.3.7
-------------
* Add move_measure_after()
Expand Down
8 changes: 4 additions & 4 deletions lib/openstudio/analysis/formulation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def add_directory_to_zip_osa(zipfile, local_directory, relative_zip_directory)
# check if weather file exists. use abs path. remove leading ./ from @weather_file path if there.
# check if path is already absolute
if @weather_file[:file]
if File.exists?(@weather_file[:file])
if File.exist?(@weather_file[:file])
puts " Adding #{@weather_file[:file]}"
#zf.add("weather/#{File.basename(@weather_file[:file])}", @weather_file[:file])
base_name = File.basename(@weather_file[:file], ".*")
Expand All @@ -622,7 +622,7 @@ def add_directory_to_zip_osa(zipfile, local_directory, relative_zip_directory)
zf.add("weather/#{File.basename(file_path)}", file_path)
end
# make absolute path and check for file
elsif File.exists?(File.join(osw_full_path,@weather_file[:file].sub(/^\.\//, '')))
elsif File.exist?(File.join(osw_full_path,@weather_file[:file].sub(/^\.\//, '')))
puts " Adding: #{File.join(osw_full_path,@weather_file[:file].sub(/^\.\//, ''))}"
#zf.add("weather/#{File.basename(@weather_file[:file])}", File.join(osw_full_path,@weather_file[:file].sub(/^\.\//, '')))
base_name = File.basename(@weather_file[:file].sub(/^\.\//, ''), ".*")
Expand All @@ -647,7 +647,7 @@ def add_directory_to_zip_osa(zipfile, local_directory, relative_zip_directory)
#check if seed file exists. use abs path. remove leading ./ from @seed_model path if there.
#check if path is already absolute
if @seed_model[:file]
if File.exists?(@seed_model[:file])
if File.exist?(@seed_model[:file])
puts " Adding #{@seed_model[:file]}"
zf.add("seeds/#{File.basename(@seed_model[:file])}", @seed_model[:file])
if all_seed_files
Expand All @@ -661,7 +661,7 @@ def add_directory_to_zip_osa(zipfile, local_directory, relative_zip_directory)
end
end
#make absolute path and check for file
elsif File.exists?(File.join(osw_full_path,@seed_model[:file].sub(/^\.\//, '')))
elsif File.exist?(File.join(osw_full_path,@seed_model[:file].sub(/^\.\//, '')))
puts " Adding #{File.join(osw_full_path,@seed_model[:file].sub(/^\.\//, ''))}"
zf.add("seeds/#{File.basename(@seed_model[:file])}", File.join(osw_full_path,@seed_model[:file].sub(/^\.\//, '')))
if all_seed_files
Expand Down
2 changes: 1 addition & 1 deletion lib/openstudio/analysis/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module OpenStudio
module Analysis
# format should be ^.*\-{1}[a-z]+[0-9]+
# for example: -rc1, -beta6, -customusecase0
VERSION = '1.3.7'.freeze
VERSION = '1.4.0'.freeze
end
end
12 changes: 6 additions & 6 deletions openstudio-analysis.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ Gem::Specification.new do |s|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
s.require_paths = ['lib']

s.required_ruby_version = '~> 2.7.0'
s.required_ruby_version = '~> 3.2.2'

s.add_dependency 'bcl', '~> 0.7.1'
s.add_dependency 'bcl', '~> 0.8.0'
s.add_dependency 'dencity', '~> 0.1.0'
s.add_dependency 'faraday', '~> 1.0.1'
s.add_dependency 'roo', '~> 2.8.3'
s.add_dependency 'rubyzip', '~> 2.3.0'
s.add_dependency 'semantic', '~> 1.4'

s.add_development_dependency 'json-schema', '~> 2.8.0'
s.add_development_dependency 'json-schema', '~> 2.8.1'
s.add_development_dependency 'rake', '~> 13.0'
s.add_development_dependency 'rspec', '~> 3.9'
s.add_development_dependency 'rubocop', '~> 1.15.0'
s.add_development_dependency 'rubocop-checkstyle_formatter', '~> 0.4.0'
s.add_development_dependency 'rspec', '~> 3.10'
s.add_development_dependency 'rubocop', '1.50'
s.add_development_dependency 'rubocop-checkstyle_formatter', '0.6.0'
end
2 changes: 1 addition & 1 deletion spec/openstudio/server_scripts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
expect(@s.add(f, ['one', 'two'])).to be true

expect(@s.size).to eq 1
expect(File.exists?(@s.files.first[:file])).to be true
expect(File.exist?(@s.files.first[:file])).to be true

expect(@s[0][:init_or_final]).to eq 'initialization'
expect(@s[0][:server_or_data_point]).to eq 'data_point'
Expand Down