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

Upgrade to OpenStudio 3.8 & Ruby 3.2 #275

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
9 changes: 6 additions & 3 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Geojson-gem CI

on:
# push:
workflow_dispatch:
schedule:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
# 5 am UTC (11pm MDT the day before) every weekday night in MDT
Expand All @@ -18,7 +19,7 @@ jobs:
weeknight-tests:
runs-on: ubuntu-latest
container:
image: docker://nrel/openstudio:3.7.0
image: docker://nrel/openstudio:3.8.0
steps:
- uses: actions/checkout@v4
- name: set git config options
Expand All @@ -28,11 +29,13 @@ jobs:
- name: Update gems
run: |
ruby --version
bundle update
bundle install
- name: List OpenStudio measures
run: bundle exec rake openstudio:list_measures
- name: Update OpenStudio measures
run: bundle exec rake openstudio:update_measures
run: |
bundle install
bundle exec rake openstudio:update_measures
- name: Test OpenStudio measures
run: bundle exec rake openstudio:test_with_openstudio
- name: Run Rspec
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/lib/measures/*/tests/output
out.txt
.rubocop*s3*
.coverage

# rspec failure tracking
.rspec_status
Expand Down
4 changes: 2 additions & 2 deletions .rakeTasks
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Settings><!--This file was automatically generated by Ruby plugin.
You are allowed to:
You are allowed to:
1. Remove rake task
2. Add existing rake tasks
To add existing rake tasks automatically delete this file and reload the project.
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
--><RakeGroup description="" fullCmd="" taskId="rake" /></Settings>
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# URBANopt GeoJSON Gem

## Version 0.12.0
* Upgrade to OpenStudio 3.8 & Ruby 3.2 by @vtnate in https://github.com/urbanopt/urbanopt-geojson-gem/pull/275


**Full Changelog**: https://github.com/urbanopt/urbanopt-geojson-gem/compare/v0.11.2...v0.12.0

## Version 0.11.2
* Allow null for some optional fields by @vtnate in https://github.com/urbanopt/urbanopt-geojson-gem/pull/273
* Added UO-ResStock connection variable to the site properties schema by @rawadelkontar in https://github.com/urbanopt/urbanopt-geojson-gem/pull/270
Expand Down
19 changes: 12 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,24 @@ gemspec
# checkout the latest version (develop) from github.
allow_local = ENV['FAVOR_LOCAL_GEMS']

gem 'regexp_parser', '2.9.0'
# 2.9.1 breaks test_with_openstudio, for more information: https://github.com/NREL/OpenStudio/issues/5203

# pin this dependency to avoid unicode_normalize error
gem 'addressable', '2.8.1'
# pin this dependency to avoid using racc dependency (which has native extensions)
gem 'parser', '3.2.2.2'
# gem 'parser', '3.2.2.2'

# 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'
# gem 'openstudio-extension', github: 'NREL/openstudio-extension-gem', branch: 'develop'
# else
gem 'openstudio-extension', '~> 0.8.1'
# end

if allow_local && File.exist?('../urbanopt-core-gem')
gem 'urbanopt-core', path: '../urbanopt-core-gem'
elsif allow_local
gem 'urbanopt-core', github: 'URBANopt/urbanopt-core-gem', branch: 'develop'
end
# if allow_local && File.exist?('../urbanopt-core-gem')
# gem 'urbanopt-core', path: '../urbanopt-core-gem'
# elsif allow_local
gem 'urbanopt-core', github: 'urbanopt/urbanopt-core-gem', branch: 'os38'
# end
38 changes: 4 additions & 34 deletions lib/measures/urban_geometry_creation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

###### (Automatically generated documentation)

# UrbanGeometryCreation
#

## Description
This measure reads an URBANopt GeoJSON and creates geometry for a particular building. Surrounding buildings are included as shading structures.


## Modeler Description
This measure takes in the GeoJSON file, the feature_id of the building and the surrounding buildings as arguments and add has methods to create space types and add default construction sets.


## Measure Type
ModelMeasure
Expand All @@ -19,38 +19,8 @@ ModelMeasure
## Arguments


### GeoJSON File
GeoJSON File.
**Name:** geojson_file,
**Type:** String,
**Units:** ,
**Required:** true,
**Model Dependent:** false

### Feature ID
Feature ID.
**Name:** feature_id,
**Type:** String,
**Units:** ,
**Required:** true,
**Model Dependent:** false

### Surrounding Buildings
Select which surrounding buildings to include.
**Name:** surrounding_buildings,
**Type:** Choice,
**Units:** ,
**Required:** true,
**Model Dependent:** false

### Scale Footprint Area by the Floor Area
If true, the footprint area from GeoJSON will be scaled by the floor_area provided by the user in URBANopt.
**Name:** scale_footprint_area_by_floor_area,
**Type:** Boolean,
**Units:** ,
**Required:** false,
**Model Dependent:** false


This measure does not have any user arguments


9 changes: 5 additions & 4 deletions lib/measures/urban_geometry_creation/measure.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0"?>
<measure>
<schema_version>3.1</schema_version>
<error>Failed to infer measure name from '/Users/nmoore/github/urbanopt-geojson-gem/lib/measures/urban_geometry_creation/measure.rb'</error>
<name>urban_geometry_creation</name>
<uid>5ab85d6b-c9af-4361-8ab9-613ee99a5666</uid>
<version_id>114e5a3f-0e66-47f2-aa96-299f71b4ef0f</version_id>
<version_modified>2024-06-25T21:15:26Z</version_modified>
<version_id>765a49b8-085e-4e17-b4e8-9d91e108a207</version_id>
<version_modified>2024-07-16T17:32:48Z</version_modified>
<xml_checksum>D254E772</xml_checksum>
<class_name>UrbanGeometryCreation</class_name>
<display_name>UrbanGeometryCreation</display_name>
Expand Down Expand Up @@ -114,7 +115,7 @@
<filename>README.md</filename>
<filetype>md</filetype>
<usage_type>readme</usage_type>
<checksum>AA2D38B0</checksum>
<checksum>0B68E96D</checksum>
</file>
<file>
<filename>README.md.erb</filename>
Expand All @@ -131,7 +132,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>5D490083</checksum>
<checksum>D58B8040</checksum>
</file>
<file>
<filename>nrel_stm_footprints.geojson</filename>
Expand Down
42 changes: 0 additions & 42 deletions lib/measures/urban_geometry_creation_zoning/README.md.erb

This file was deleted.

14 changes: 4 additions & 10 deletions lib/measures/urban_geometry_creation_zoning/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>urban_geometry_creation_zoning</name>
<uid>96ea1317-76ac-4670-b51d-71ee3f4fdd65</uid>
<version_id>8b2f1d05-725a-4f06-bcac-1fb685f12f89</version_id>
<version_modified>2024-06-25T21:15:28Z</version_modified>
<version_id>18b7bd33-5ab2-470a-96df-1b994a388c0e</version_id>
<version_modified>2024-09-05T14:06:38Z</version_modified>
<xml_checksum>D254E772</xml_checksum>
<class_name>UrbanGeometryCreationZoning</class_name>
<display_name>UrbanGeometryCreationZoning</display_name>
Expand Down Expand Up @@ -97,12 +97,6 @@
<usage_type>readme</usage_type>
<checksum>0458EE16</checksum>
</file>
<file>
<filename>README.md.erb</filename>
<filetype>erb</filetype>
<usage_type>readmeerb</usage_type>
<checksum>703C9964</checksum>
</file>
<file>
<version>
<software_program>OpenStudio</software_program>
Expand All @@ -112,7 +106,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>5827BCFA</checksum>
<checksum>1EA1A74B</checksum>
</file>
<file>
<filename>OV_Buildings_Update_090420_res_eui_test.json</filename>
Expand All @@ -136,7 +130,7 @@
<filename>urban_geometry_creation_zoning_test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>FC65E7CE</checksum>
<checksum>3B495B27</checksum>
</file>
</files>
</measure>
2 changes: 1 addition & 1 deletion lib/urbanopt/geojson/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

module URBANopt
module GeoJSON
VERSION = '0.11.2'.freeze
VERSION = '0.12.0'.freeze
end
end
17 changes: 8 additions & 9 deletions urbanopt-geojson-gem.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ Gem::Specification.new do |spec|
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']
# 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/
# 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.
spec.required_ruby_version = '3.2.2'

spec.required_ruby_version = '~> 2.7.0'
spec.add_development_dependency 'rspec', '~> 3.13'
spec.add_development_dependency 'simplecov', '0.22.0'
spec.add_development_dependency 'simplecov-lcov', '0.8.0'

spec.add_development_dependency 'bundler', '>= 2.1.0'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3.9'
spec.add_development_dependency 'simplecov', '~> 0.18.2'
spec.add_development_dependency 'simplecov-lcov', '~> 0.8.0'

spec.add_runtime_dependency 'json-schema', '~> 2.7'
spec.add_runtime_dependency 'urbanopt-core', '~> 0.11.0'
spec.add_runtime_dependency 'json-schema', '~> 4.3.1'
# spec.add_runtime_dependency 'urbanopt-core', '~> 0.12.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should clean this up (and the Gemfile) before merging

end