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.9 and Ruby 3.2.2 #279

Merged
merged 18 commits into from
Jan 22, 2025
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
12 changes: 7 additions & 5 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Geojson-gem CI

on:
# push:
workflow_dispatch:
push:
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
- cron: '21 5 * * 2-6'
pull_request:
types: [review_requested]

env:
# This env var should enforce develop branch of all dependencies
Expand All @@ -18,7 +17,7 @@ jobs:
weeknight-tests:
runs-on: ubuntu-latest
container:
image: docker://nrel/openstudio:3.7.0
image: docker://nrel/openstudio:3.9.0
steps:
- uses: actions/checkout@v4
- name: set git config options
Expand All @@ -28,11 +27,14 @@ jobs:
- name: Update gems
run: |
ruby --version
bundle install
bundle update
- 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 @@ -5,6 +5,7 @@
/gems
/_yardoc/
/coverage/
.coverage
/doc/
/pkg/
/spec/reports/
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>
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
# URBANopt GeoJSON Gem

## Version 1.0.0

## Exciting new features 🎉

* Upgrade to OpenStudio 3.9 and Ruby 3.2.2 by @vtnate in https://github.com/urbanopt/urbanopt-geojson-gem/pull/279

**Full Changelog**: https://github.com/urbanopt/urbanopt-geojson-gem/compare/v0.11.2...v1.0.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


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

## Version 0.11.1

Date Range: 01/09/24

* downgrade json-schema to 2.7 by @vtnate in https://github.com/urbanopt/urbanopt-geojson-gem/pull/267

**Full Changelog**: https://github.com/urbanopt/urbanopt-geojson-gem/compare/v0.11.0...v0.11.1

## Version 0.11.0

Date Range: 7/19/23 - 01/09/24

* Remove jenkins by @vtnate in https://github.com/urbanopt/urbanopt-geojson-gem/pull/260
Expand Down
16 changes: 6 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,15 @@ gemspec
# checkout the latest version (develop) from github.
allow_local = ENV['FAVOR_LOCAL_GEMS']

# 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 'openstudio-extension', '~> 0.8.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'
# 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: 'master'
# end
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
URBANopt (tm), Copyright (c) 2019-2024, Alliance for Sustainable Energy, LLC, and other
URBANopt (tm), Copyright (c) 2019-2025, Alliance for Sustainable Energy, LLC, and other
contributors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
2 changes: 1 addition & 1 deletion doc_templates/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
URBANopt (tm), Copyright (c) 2019-2024, Alliance for Sustainable Energy, LLC, and other
URBANopt (tm), Copyright (c) 2019-2025, Alliance for Sustainable Energy, LLC, and other
contributors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
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>048231f4-ba53-4506-b922-35f13d8b806e</version_id>
<version_modified>2024-11-13T17:45:33Z</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
28 changes: 3 additions & 25 deletions lib/measures/urban_geometry_creation_zoning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

###### (Automatically generated documentation)

# UrbanGeometryCreationZoning
#

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


## Modeler Description

Expand All @@ -19,30 +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


This measure does not have any user arguments


11 changes: 6 additions & 5 deletions lib/measures/urban_geometry_creation_zoning/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_zoning/measure.rb'</error>
<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>f4e83153-b29e-4154-9ed0-7062896e7448</version_id>
<version_modified>2024-11-14T16:53:21Z</version_modified>
<xml_checksum>D254E772</xml_checksum>
<class_name>UrbanGeometryCreationZoning</class_name>
<display_name>UrbanGeometryCreationZoning</display_name>
Expand Down Expand Up @@ -95,7 +96,7 @@
<filename>README.md</filename>
<filetype>md</filetype>
<usage_type>readme</usage_type>
<checksum>0458EE16</checksum>
<checksum>0B68E96D</checksum>
</file>
<file>
<filename>README.md.erb</filename>
Expand All @@ -112,7 +113,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 +137,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 = '1.0.0'.freeze
end
end
16 changes: 8 additions & 8 deletions urbanopt-geojson-gem.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.required_ruby_version = '~> 2.7.0'
# 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.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_development_dependency 'rspec', '~> 3.13'
spec.add_development_dependency 'simplecov', '0.22.0'
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', '~> 1.0.0'
end
Loading