Skip to content

Commit 605c820

Browse files
committed
first commit
0 parents  commit 605c820

File tree

180 files changed

+183424
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+183424
-0
lines changed

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/.bundle/
2+
/.yardoc
3+
/.ruby-version
4+
/Gemfile.lock
5+
/gems
6+
/_yardoc/
7+
/coverage/
8+
/doc/
9+
/pkg/
10+
/spec/reports/
11+
/spec/test/
12+
/tmp/
13+
/test/
14+
/lib/measures/test_results
15+
/lib/measures/.rubocop*
16+
/lib/measures/staged
17+
/lib/measures/staged/*
18+
19+
# rspec failure tracking
20+
.rspec_status
21+
22+
# Ignore IDE files
23+
/.idea
24+
*.rubocop-http*
25+
26+
# measures tests
27+
lib/measures/.rubocop.yml
28+
lib/measures/test_results/*
29+
30+
# runner conf
31+
runner.conf
32+
33+
.DS_Store

Gemfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
source 'http://rubygems.org'
2+
3+
gemspec
4+
5+
# Local gems are useful when developing and integrating the various dependencies.
6+
# To favor the use of local gems, set the following environment variable:
7+
# Mac: export FAVOR_LOCAL_GEMS=1
8+
# Windows: set FAVOR_LOCAL_GEMS=1
9+
# Note that if allow_local is true, but the gem is not found locally, then it will
10+
# checkout the latest version (develop) from github.
11+
allow_local = ENV['FAVOR_LOCAL_GEMS']
12+
13+
if allow_local && File.exist?('../OpenStudio-extension-gem')
14+
gem 'openstudio-extension', path: '../OpenStudio-extension-gem'
15+
elsif allow_local
16+
gem 'openstudio-extension', github: 'NREL/OpenStudio-extension-gem', branch: 'develop'
17+
end
18+
19+
gem 'openstudio_measure_tester', '~> 0.2.3' # This includes the dependencies for running unit tests, coverage, and rubocop

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# BCL Test Measures Gem
2+
3+
This measure repo is used to test the new BCL codebase and to demonstrate the appropriate structure of measure repos to be added to the BCL. Measures should be placed in the `lib` directory.
4+
5+
Measure repositories should be structured as an [OpenStudio extension gem](https://github.com/NREL/openstudio-extension-gem). Follow the directions to [initialize a new extension gem](https://github.com/NREL/openstudio-extension-gem#initializing-a-new-extension-gem) for your measures and use the rake task to test your measures.
6+
7+
## Installation
8+
9+
Add this line to your application's Gemfile:
10+
11+
```ruby
12+
gem 'bcl-test-measures'
13+
```
14+
15+
And then execute:
16+
17+
$ bundle
18+
19+
Or install it yourself as:
20+
21+
$ gem install 'bcl-test-measures'
22+
23+
## Usage
24+
25+
This is used for testing purposes only
26+
27+
# Releasing
28+
29+
* Update change log
30+
* Update version in `/lib/openstudio/bcl-test-measures/version.rb`
31+
* Merge down to master
32+
* Release via github
33+
* run `rake release` from master

Rakefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'bundler/gem_tasks'
2+
require 'rspec/core/rake_task'
3+
4+
RSpec::Core::RakeTask.new(:spec)
5+
6+
require 'rubocop/rake_task'
7+
RuboCop::RakeTask.new
8+
9+
# Load in the rake tasks from the base openstudio-extension gem
10+
require 'openstudio/extension/rake_task'
11+
require 'openstudio/bcl_test_measures'
12+
os_extension = OpenStudio::Extension::RakeTask.new
13+
os_extension.set_extension_class(OpenStudio::BclTestMeasures::BclTestMeasures)
14+
15+
task default: :spec

bcl-test-measures.gemspec

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
lib = File.expand_path('lib', __dir__)
3+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4+
require 'openstudio/bcl_test_measures/version'
5+
6+
Gem::Specification.new do |spec|
7+
spec.name = 'bcl-test-measures'
8+
spec.version = OpenStudio::BclTestMeasures::VERSION
9+
spec.authors = ['']
10+
spec.email = ['']
11+
12+
spec.summary = 'library and measures for OpenStudio'
13+
spec.description = 'library and measures for OpenStudio'
14+
spec.homepage = 'https://openstudio.net'
15+
16+
# Specify which files should be added to the gem when it is released.
17+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
19+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20+
end
21+
spec.bindir = 'exe'
22+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23+
spec.require_paths = ['lib']
24+
25+
spec.required_ruby_version = '~> 2.5.0'
26+
27+
spec.add_development_dependency 'bundler', '~> 2.1'
28+
spec.add_development_dependency 'rake', '~> 13.0'
29+
spec.add_development_dependency 'rspec', '~> 3.9'
30+
spec.add_development_dependency 'rubocop', '~> 0.54.0'
31+
32+
spec.add_dependency 'openstudio-extension', '~> 0.3.1'
33+
spec.add_dependency 'openstudio-standards', '~> 0.2.12'
34+
end

doc_templates/LICENSE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted
4+
provided that the following conditions are met:
5+
6+
(1) Redistributions of source code must retain the above copyright notice, this list of conditions
7+
and the following disclaimer.
8+
9+
(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions
10+
and the following disclaimer in the documentation and/or other materials provided with the distribution.
11+
12+
(3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse
13+
or promote products derived from this software without specific prior written permission from the
14+
respective party.
15+
16+
(4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other
17+
derivative works may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar
18+
designation without specific prior written permission from Alliance for Sustainable Energy, LLC.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
21+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT,
23+
OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
25+
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

doc_templates/README.md.erb

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<%#= README.md.erb is used to auto-generate README.md. %>
2+
<%#= To manually maintain README.md throw away README.md.erb and manually edit README.md %>
3+
###### (Automatically generated documentation)
4+
5+
# <%= name %>
6+
7+
## Description
8+
<%= description %>
9+
10+
## Modeler Description
11+
<%= modelerDescription %>
12+
13+
## Measure Type
14+
<%= measureType %>
15+
16+
## Taxonomy
17+
<%= taxonomy %>
18+
19+
## Arguments
20+
21+
<% arguments.each do |argument| %>
22+
### <%= argument[:display_name] %>
23+
<%= argument[:description] %>
24+
**Name:** <%= argument[:name] %>,
25+
**Type:** <%= argument[:type] %>,
26+
**Units:** <%= argument[:units] %>,
27+
**Required:** <%= argument[:required] %>,
28+
**Model Dependent:** <%= argument[:model_dependent] %>
29+
<% end %>
30+
31+
<% if arguments.size == 0 %>
32+
<%= "This measure does not have any user arguments" %>
33+
<% end %>
34+
35+
<% if outputs.size > 0 %>
36+
## Outputs
37+
<% output_names = [] %>
38+
<% outputs.each do |output| %>
39+
<% output_names << output[:display_name] %>
40+
<% end %>
41+
<%= output_names.join(", ") %>
42+
<% end %>

doc_templates/copyright_erb.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<%
2+
# *******************************************************************************
3+
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
4+
# All rights reserved.
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions are met:
7+
#
8+
# (1) Redistributions of source code must retain the above copyright notice,
9+
# this list of conditions and the following disclaimer.
10+
#
11+
# (2) Redistributions in binary form must reproduce the above copyright notice,
12+
# this list of conditions and the following disclaimer in the documentation
13+
# and/or other materials provided with the distribution.
14+
#
15+
# (3) Neither the name of the copyright holder nor the names of any contributors
16+
# may be used to endorse or promote products derived from this software without
17+
# specific prior written permission from the respective party.
18+
#
19+
# (4) Other than as required in clauses (1) and (2), distributions in any form
20+
# of modifications or other derivative works may not use the "OpenStudio"
21+
# trademark, "OS", "os", or any other confusingly similar designation without
22+
# specific prior written permission from Alliance for Sustainable Energy, LLC.
23+
#
24+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
25+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
28+
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
29+
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
31+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
33+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34+
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35+
# *******************************************************************************
36+
%>

doc_templates/copyright_js.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* @preserve
2+
* OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be found at openstudio.net/license.
4+
*/

doc_templates/copyright_ruby.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# *******************************************************************************
2+
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3+
# All rights reserved.
4+
# Redistribution and use in source and binary forms, with or without
5+
# modification, are permitted provided that the following conditions are met:
6+
#
7+
# (1) Redistributions of source code must retain the above copyright notice,
8+
# this list of conditions and the following disclaimer.
9+
#
10+
# (2) Redistributions in binary form must reproduce the above copyright notice,
11+
# this list of conditions and the following disclaimer in the documentation
12+
# and/or other materials provided with the distribution.
13+
#
14+
# (3) Neither the name of the copyright holder nor the names of any contributors
15+
# may be used to endorse or promote products derived from this software without
16+
# specific prior written permission from the respective party.
17+
#
18+
# (4) Other than as required in clauses (1) and (2), distributions in any form
19+
# of modifications or other derivative works may not use the "OpenStudio"
20+
# trademark, "OS", "os", or any other confusingly similar designation without
21+
# specific prior written permission from Alliance for Sustainable Energy, LLC.
22+
#
23+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
24+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
25+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
27+
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
28+
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
30+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33+
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34+
# *******************************************************************************

0 commit comments

Comments
 (0)