Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
kflemin committed Jul 21, 2023
2 parents 34385d8 + 49f24e3 commit 661a1d4
Show file tree
Hide file tree
Showing 723 changed files with 339,239 additions and 260,967 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "develop", "*LTS", master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "develop" ]
schedule:
- cron: '20 0 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'ruby' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
57 changes: 57 additions & 0 deletions .github/workflows/nightly_ci_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: nightly_build

on:
push:
branches: master
# 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: '* 5 * * 2-6'

env:
# This env var should enforce develop branch of all dependencies
FAVOR_LOCAL_GEMS: true
GEM_DEVELOPER_KEY: ${{ secrets.GEM_DEVELOPER_KEY }}

jobs:
weeknight-tests:
# ubuntu-latest works since https://github.com/rbenv/ruby-build/releases/tag/v20220710 (July 10, 2022)
# https://github.com/rbenv/ruby-build/discussions/1940
runs-on: ubuntu-latest
container:
image: docker://nrel/openstudio:3.6.1
steps:
- uses: actions/checkout@v3
- name: Update gems
run: |
bundle update
bundle exec certified-update
- name: Rake run baseline and mixed simulations
# Continue to upload step even if a test fails, so we can troubleshoot
continue-on-error: true
run: |
bundle exec rake run_baseline
bundle exec rake run_mixed
- name: rake post processing
continue-on-error: true
run: |
bundle exec rake post_process_baseline
bundle exec rake post_process_mixed
- name: Rake visualization
continue-on-error: true
run: bundle exec rake visualize_scenarios
- name: Upload artifacts
# Save results for examination - useful for debugging
uses: actions/upload-artifact@v3
# Only upload if rspec fails
if: failure()
with:
name: rspec_results
path: example_project/run/*scenario/
retention-days: 7 # save for 1 week before deleting
- name: Coveralls
# coveralls action docs: https://github.com/marketplace/actions/coveralls-github-action
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./coverage/lcov/urbanopt-example-geojson-project.lcov"
47 changes: 47 additions & 0 deletions .github/workflows/weekly_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: weekly_build

on:
# 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: '* 5 * * 0'

env:
# This env var should enforce develop branch of all dependencies
FAVOR_LOCAL_GEMS: true
GEM_DEVELOPER_KEY: ${{ secrets.GEM_DEVELOPER_KEY }}

jobs:
simulate-and-post-process:
# ubuntu-latest works since https://github.com/rbenv/ruby-build/releases/tag/v20220710 (July 10, 2022)
# https://github.com/rbenv/ruby-build/discussions/1940
strategy:
matrix:
scenario: [baseline, chilled_water_storage, flexible_hot_water, high_efficiency, mixed,
peak_hours_mels_shedding, peak_hours_thermostat_adjust, reopt, thermal_storage]
runs-on: ubuntu-latest
container:
image: docker://nrel/openstudio:3.6.1
steps:
- uses: actions/checkout@v3
- name: Update gems
run: |
bundle update
bundle exec certified-update
- name: Simulate
# Continue to upload step even if a test fails, so we can troubleshoot
# continue-on-error: true
run: bundle exec rake run_${{ matrix.scenario }}
- name: Post process
# continue-on-error: true
run: bundle exec rake post_process_${{ matrix.scenario }}
- name: Upload artifacts
# Save results for examination - useful for debugging
uses: actions/upload-artifact@v3
# Only upload if rspec fails
if: failure()
with:
name: rspec_results
path: example_project/run/*scenario/
retention-days: 7 # save for 1 week before deleting
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ out.txt

# running config
runner.conf
# coveralls
.coveralls.yml
93 changes: 53 additions & 40 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
source 'http://rubygems.org'
source 'https://rubygems.org'

ruby '~> 2.7.0'
gem 'rspec', '~> 3.9'
gem 'rubocop', '~> 1.15.0', require: false
gem 'rubocop-checkstyle_formatter', '~> 0.4.0'
gem 'rubocop-performance', '~> 1.11.3'
gem 'simplecov', '~> 0.18.2', require: false, group: :test
gem 'simplecov-lcov', '~> 0.8.0'

# 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'

# Local gems are useful when developing and integrating the various dependencies.
# To favor the use of local gems, set the following environment variable:
Expand All @@ -22,83 +30,88 @@ allow_local = ENV['FAVOR_LOCAL_GEMS']
# gem 'openstudio-extension', github: 'NREL/openstudio-extension-gem', branch: 'develop'
# end

if allow_local && File.exist?('../openstudio-geb-gem')
gem 'openstudio-geb', path: '../openstudio-geb-gem'
elsif allow_local
gem 'openstudio-geb', github: 'LBNL-ETA/Openstudio-GEB-gem', branch: 'master'
else
gem 'openstudio-geb', '~> 0.3.2'
end

if allow_local && File.exist?('../openstudio-common-measures-gem')
gem 'openstudio-common-measures', path: '../openstudio-common-measures-gem'
gem 'openstudio-common-measures', path: '../openstudio-common-measures-gem'
elsif allow_local
gem 'openstudio-common-measures', github: 'NREL/openstudio-common-measures-gem', branch: 'develop'
gem 'openstudio-common-measures', github: 'NREL/openstudio-common-measures-gem', branch: 'develop'
else
gem 'openstudio-common-measures', '~> 0.6.0'
gem 'openstudio-common-measures', '~> 0.8.0'
end

if allow_local && File.exist?('../openstudio-model-articulation-gem')
gem 'openstudio-model-articulation', path: '../openstudio-model-articulation-gem'
elsif allow_local
gem 'openstudio-model-articulation', github: 'NREL/openstudio-model-articulation-gem', branch: 'develop'
else
gem 'openstudio-model-articulation', '~> 0.6.1'
gem 'openstudio-model-articulation', '~> 0.8.0'
end

if allow_local && File.exist?('../openstudio-load-flexibility-measures-gem')
gem 'openstudio-load-flexibility-measures', path: '../openstudio-load-flexibility-measures-gem'
elsif allow_local
gem 'openstudio-load-flexibility-measures', github: 'NREL/openstudio-load-flexibility-measures-gem', branch: 'master'
else
gem 'openstudio-load-flexibility-measures', '~> 0.5.0'
gem 'openstudio-load-flexibility-measures', '~> 0.7.0'
end

if allow_local && File.exist?('../openstudio-ee-gem')
gem 'openstudio-ee', path: '../opesntudio-ee-gem'
elsif allow_local
gem 'openstudio-ee', github: 'NREL/openstudio-ee-gem', branch: 'develop'
else
gem 'openstudio-ee', '~> 0.6.0'
gem 'openstudio-ee', '~> 0.8.0'
end

if allow_local && File.exist?('../openstudio-calibration-gem')
gem 'openstudio-calibration', path: '../openstudio-calibration-gem'
elsif allow_local
gem 'openstudio-calibration', github: 'NREL/openstudio-calibration-gem', branch: 'develop'
else
gem 'openstudio-calibration', '~> 0.6.0'
gem 'openstudio-calibration', '~> 0.8.0'
end

# if allow_local && File.exist?('../urbanopt-core-gem')
# gem 'urbanopt-core', path: '../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-scenario-gem')
# gem 'urbanopt-scenario', path: '../urbanopt-scenario-gem'
# elsif allow_local
gem 'urbanopt-scenario', github: 'URBANopt/urbanopt-scenario-gem', branch: 'OS-3.4.0'
# else
# gem 'urbanopt-scenario', '~> 0.7.0'
# end

# if allow_local && File.exist?('../urbanopt-reporting-gem')
# gem 'urbanopt-reporting', path: '../urbanopt-reporting-gem'
# elsif allow_local
gem 'urbanopt-reporting', github: 'URBANopt/urbanopt-reporting-gem', branch: 'OS-3.4.0'
# else
# gem 'urbanopt-reporting', '~> 0.5.0'
# end

# TODO: Uncomment and revert changes once gem is released
# if allow_local && File.exist?('../urbanopt-geojson-gem')
# gem 'urbanopt-geojson', path: '../urbanopt-geojson-gem'
# elsif allow_local
gem 'urbanopt-geojson', github: 'URBANopt/urbanopt-geojson-gem', branch: 'OS-3.4.0'
# else
# gem 'urbanopt-geojson', '~> 0.7.0'
# end
if allow_local && File.exist?('../urbanopt-scenario-gem')
gem 'urbanopt-scenario', path: '../urbanopt-scenario-gem'
elsif allow_local
gem 'urbanopt-scenario', github: 'URBANopt/urbanopt-scenario-gem', branch: 'develop'
else
gem 'urbanopt-scenario', '~> 0.10.0'
end

# if allow_local && File.exist?('../urbanopt-reopt-gem')
# gem 'urbanopt-reopt', path: '../urbanopt-reopt-gem'
# elsif allow_local
gem 'urbanopt-reopt', github: 'URBANopt/urbanopt-reopt-gem', branch: 'OS-3.4.0'
# else
# gem 'urbanopt-reopt', '0.7.0'
# end
if allow_local && File.exist?('../urbanopt-reporting-gem')
gem 'urbanopt-reporting', path: '../urbanopt-reporting-gem'
elsif allow_local
gem 'urbanopt-reporting', github: 'URBANopt/urbanopt-reporting-gem', branch: 'develop'
else
gem 'urbanopt-reporting', '~> 0.8.0'
end

if allow_local && File.exist?('../urbanopt-geojson-gem')
gem 'urbanopt-geojson', path: '../urbanopt-geojson-gem'
elsif allow_local
gem 'urbanopt-geojson', github: 'URBANopt/urbanopt-geojson-gem', branch: 'develop'
else
gem 'urbanopt-geojson', '~> 0.10.0'
end

if allow_local && File.exist?('../urbanopt-reopt-gem')
gem 'urbanopt-reopt', path: '../urbanopt-reopt-gem'
elsif allow_local
gem 'urbanopt-reopt', github: 'URBANopt/urbanopt-reopt-gem', branch: 'develop'
else
gem 'urbanopt-reopt', '0.10.0'
end
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# URBANopt Example GeoJSON Project

[![Coverage Status](https://coveralls.io/repos/github/urbanopt/urbanopt-example-geojson-project/badge.svg?branch=develop)](https://coveralls.io/github/urbanopt/urbanopt-example-geojson-project?branch=develop)

## Overview

This repository contains an URBANopt™ Example GeoJSON Project to demonstrate its basic principles.
Expand All @@ -24,17 +26,17 @@ include:
part of the OpenStudio SDK.

The
example project has different projects based on the geometry method used to create
example project has different projects based on the geometry method used to create
buildings, such as the
`default project`, `createbar project` and the `floorspace project`.
There are commands to run, post process and delete these project described as
rake tasks within the
[Rakefile](https://github.com/urbanopt/urbanopt-example-geojson-project/blob/master/Rakefile).
[Rakefile](https://github.com/urbanopt/urbanopt-example-geojson-project/blob/master/Rakefile).

More details on these projects and their implementation is described in the [Developer Documentation](https://urbanopt.github.io).


An overview of the commands:
An overview of the commands:

*To view all rake tasks*

Expand Down Expand Up @@ -138,22 +140,22 @@ bundle exec rake clear_all[json,csv]
*To clear a specific scenario for a project*

```ruby
bundle exec rake clear_baseline[json,csv]
bundle exec rake clear_baseline[json,csv]
```

```ruby
bundle exec rake clear_high_efficiency[json,csv]
bundle exec rake clear_high_efficiency[json,csv]
```

```ruby
bundle exec rake clear_mixed[json,csv]
bundle exec rake clear_mixed[json,csv]
```

Where, `json` is the is the name of the FeatureFile and `csv` is the name of the scenario file
corresponding to the feature file, that you would like to clear.

```ruby
bundle exec rake clear_thermal_storage[json,csv]
bundle exec rake clear_thermal_storage[json,csv]
```

Where, `json` is the `example_project.json` FeatureFile and `csv` is the name of a scenario file for this feature file.
Loading

0 comments on commit 661a1d4

Please sign in to comment.