Skip to content

Commit

Permalink
Merge pull request #245 from urbanopt/develop
Browse files Browse the repository at this point in the history
version 0.6.1
  • Loading branch information
kflemin authored Jul 2, 2021
2 parents fed25a1 + ac854fd commit 2590bbf
Show file tree
Hide file tree
Showing 19 changed files with 172 additions and 71 deletions.
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ AllCops:
- init_templates/**/*
- lib/measures/**/resources/*
- lib/openstudio/extension/core/**/*

require: rubocop-performance
inherit_from:
- http://s3.amazonaws.com/openstudio-resources/styles/rubocop_v3.yml
- http://s3.amazonaws.com/openstudio-resources/styles/rubocop_v4.yml
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## Version 0.6.1

Date Range 5/1/21 - 7/1/21

- Fixed [#222]( https://github.com/urbanopt/urbanopt-cli/issues/222 ), Add a resilience flag to reopt processing
- Fixed [#224]( https://github.com/urbanopt/urbanopt-cli/issues/224 ), Createbar and Floorspace mappers are out of date
- Fixed [#227]( https://github.com/urbanopt/urbanopt-cli/issues/227 ), Runtime error when running urbanopt cli example project
- Fixed [#233]( https://github.com/urbanopt/urbanopt-cli/issues/233 ), update rubocop configs to v4
- Fixed [#235]( https://github.com/urbanopt/urbanopt-cli/issues/235 ), Re-add old residential types to the commercial hash
- Fixed [#238]( https://github.com/urbanopt/urbanopt-cli/issues/238 ), Fix BuildingResidentialModel feature_id argument - JSON parse bug
- Fixed [#240]( https://github.com/urbanopt/urbanopt-cli/issues/240 ), Update example mappers from urbanopt-example-geojson-project
- Fixed [#242]( https://github.com/urbanopt/urbanopt-cli/issues/242 ), Add load_flexibility require to baseline mapper

## Version 0.6.0

Date Range 3/31/21 - 4/30/21
Expand Down
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10.2)
cmake_policy(SET CMP0048 NEW)

project(UrbanOptCLI VERSION 0.5.1)
project(UrbanOptCLI VERSION 0.6.0)

include(FindOpenStudioSDK.cmake)

Expand Down Expand Up @@ -89,16 +89,16 @@ option(BUILD_PACKAGE "Build package" OFF)
# need to update the MD5sum for each platform and url below
if(UNIX)
if(APPLE)
set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20210315-darwin.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "5df336da22c90534c8940c41e6489b37")
set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20210608-darwin.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "c169a00c4b01e4a7e69321d0def3f72d")
else()
set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20210315-linux.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "6e92becdac2d67046340daf16faea8b2")
set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20210514-linux.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "5dd39375b9b5d3a947ef761f5dd2333a")
endif()
elseif(WIN32)
if(CMAKE_CL_64)
set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20210315-windows.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "be2cde77dde2891d8111454bb280bbdc")
set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20210514-windows.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "2f403a31d7192fdb457e6fcfd0d47156")
endif()
endif()

Expand All @@ -125,15 +125,15 @@ set(RUBY_DIR "${PROJECT_BINARY_DIR}/ruby")

if(UNIX)
if(APPLE)
set(RUBY_ZIP_FILENAME "ruby-2.5.5-darwin.tar.gz")
set(RUBY_ZIP_EXPECTED_MD5 "27e3e91bd19f4edf1c04d31c7345ce5d")
set(RUBY_ZIP_FILENAME "ruby-2.7.2-darwin.tar.gz")
set(RUBY_ZIP_EXPECTED_MD5 "1ee27d6381797a5af7398f8eee8edb07")
else()
set(RUBY_ZIP_FILENAME "ruby-2.5.5-linux.tar.gz")
set(RUBY_ZIP_EXPECTED_MD5 "5c9ab1aeb3366e6e579592cbb72ddbef")
set(RUBY_ZIP_FILENAME "ruby-2.7.2-linux.tar.gz")
set(RUBY_ZIP_EXPECTED_MD5 "853425b0c9878b064937f9e49688c6c6")
endif()
elseif(WIN32)
set(RUBY_ZIP_FILENAME "ruby-2.5.1-win32.tar.gz")
set(RUBY_ZIP_EXPECTED_MD5 "96495c32f5933250663df7561fdd6226")
set(RUBY_ZIP_FILENAME "ruby-2.7.2-win32.tar.gz")
set(RUBY_ZIP_EXPECTED_MD5 "414a24f3ebb074534d2186595683c5b4")
endif()

set(RUBY_ZIP_LOCAL_PATH "${PROJECT_BINARY_DIR}/${RUBY_ZIP_FILENAME}")
Expand Down
17 changes: 11 additions & 6 deletions FindOpenStudioSDK.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(OPENSTUDIO_VERSION_MAJOR 3)
set(OPENSTUDIO_VERSION_MINOR 1)
set(OPENSTUDIO_VERSION_MINOR 2)
set(OPENSTUDIO_VERSION_PATCH 0)
set(OPENSTUDIO_VERSION "${OPENSTUDIO_VERSION_MAJOR}.${OPENSTUDIO_VERSION_MINOR}.${OPENSTUDIO_VERSION_PATCH}")

Expand All @@ -16,18 +16,23 @@ else()
set(OPENSTUDIO_BASELINK "https://openstudio-builds.s3.amazonaws.com/${OPENSTUDIO_VERSION}"
CACHE STRING "Base link to where the openstudio archives are hosted" FORCE)

set(OPENSTUDIO_VERSION_SHA "+e165090621")
set(OPENSTUDIO_VERSION_SHA "+e11f0a08b2")

if(APPLE)
set(OPENSTUDIO_EXPECTED_HASH 20d74394f0889261ee1c382383461b0b)
set(OPENSTUDIO_EXPECTED_HASH 883c0f83ab7a09875e851726e32ba591)
set(OPENSTUDIO_PLATFORM "Darwin")
set(OPENSTUDIO_EXT "tar.gz")
elseif(UNIX)
set(OPENSTUDIO_EXPECTED_HASH 866cdac61ca955ce6d13ecf0fa5230a2)
set(OPENSTUDIO_PLATFORM "Linux")
if(LSB_RELEASE_VERSION_SHORT MATCHES "20.04")
set(OPENSTUDIO_EXPECTED_HASH 25c4cfe614676376581657440ba447ae)
set(OPENSTUDIO_PLATFORM "Ubuntu-20.04")
else() # Assumes 18.04
set(OPENSTUDIO_EXPECTED_HASH 623d3e10c17f1dc99bb869deb8a2550e)
set(OPENSTUDIO_PLATFORM "Ubuntu-18.04")
endif()
set(OPENSTUDIO_EXT "tar.gz")
elseif(WIN32)
set(OPENSTUDIO_EXPECTED_HASH aa04ed795c6d2b558df6175fad042f1f)
set(OPENSTUDIO_EXPECTED_HASH 740d5d8ba67ca914412e12c618d2cc28)
set(OPENSTUDIO_PLATFORM "Windows")
set(OPENSTUDIO_EXT "tar.gz")
endif()
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ allow_local = ENV['FAVOR_LOCAL_GEMS']
# end

# if allow_local && File.exist?('../urbanopt-reopt-gem')
# gem 'urbanopt-reopt', path: '../urbanopt-reopt-gem'
# gem 'urbanopt-reopt', path: '../urbanopt-reopt-gem'
# elsif allow_local
# gem 'urbanopt-reopt', github: 'URBANopt/urbanopt-reopt-gem', branch: 'develop'
gem 'urbanopt-reopt', github: 'URBANopt/urbanopt-reopt-gem', branch: 'develop'
# end

# if allow_local && File.exist?('../openstudio-load-flexibility-measures')
Expand Down
54 changes: 44 additions & 10 deletions example_files/mappers/Baseline.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
#*********************************************************************************
# URBANopt™, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
# *********************************************************************************
# URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
# contributors. All rights reserved.
#

# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#

# Redistributions of source code must retain the above copyright notice, this list
# of conditions and the following disclaimer.
#

# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or other
# materials provided with the distribution.
#

# Neither the name of the copyright holder nor the names of its contributors may be
# used to endorse or promote products derived from this software without specific
# prior written permission.
#

# Redistribution of this software, without modification, must refer to the software
# by the same designation. Redistribution of a modified version of this software
# (i) may not refer to the modified version by the same designation, or by any
# confusingly similar designation, and (ii) must refer to the underlying software
# originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
# the term “URBANopt”, or any confusingly similar designation may not be used to
# refer to any modified version of this software or any modified version of the
# underlying software originally provided by Alliance without the prior written
# consent of Alliance.

# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
Expand All @@ -26,13 +36,14 @@
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
#*********************************************************************************
# *********************************************************************************

require 'urbanopt/reporting'
require 'openstudio/common_measures'
require 'openstudio/model_articulation'
require 'openstudio/ee_measures'
require 'openstudio/calibration'
require 'openstudio/load_flexibility_measures'

require 'json'
require 'rexml/document'
Expand Down Expand Up @@ -278,7 +289,10 @@ def commercial_building_types
'Service',
'Uncovered Parking',
'Covered Parking',
'Mixed use'
'Mixed use',
'Multifamily (2 to 4 units)',
'Multifamily (5 or more units)',
'Single-Family'
]
end

Expand Down Expand Up @@ -411,6 +425,11 @@ def create_osw(scenario, features, feature_names)

building_type = feature.building_type

if building_type.nil?
# need building type
raise "Building type is not set"
end

if residential_building_types.include? building_type
debug = false

Expand Down Expand Up @@ -520,8 +539,13 @@ def create_osw(scenario, features, feature_names)

# SCHEDULES

feature_ids = []
scenario.feature_file.features.each do |feature|
feature_ids << feature.id
end

args[:schedules_type] = 'stochastic'
args[:feature_id] = feature_id.hex
args[:feature_id] = feature_ids.index(feature_id)
args[:schedules_variation] = 'building' # building or unit

# HVAC
Expand Down Expand Up @@ -723,10 +747,13 @@ def create_osw(scenario, features, feature_names)

OpenStudio::Extension.set_measure_argument(osw, 'set_run_period', '__SKIP__', false)
# set_run_period

begin
timesteps_per_hour = feature.timesteps_per_hour
if timesteps_per_hour
OpenStudio::Extension.set_measure_argument(osw, 'set_run_period', 'timesteps_per_hour', timesteps_per_hour)
else
puts "No timesteps_per_hours set in the feature file...using default"
end
rescue StandardError
end
Expand All @@ -738,6 +765,8 @@ def create_osw(scenario, features, feature_names)
begin_date = begin_date[0, 10]
end
OpenStudio::Extension.set_measure_argument(osw, 'set_run_period', 'begin_date', begin_date)
else
puts "no simulation begin_date set in the feature file...using default"
end
rescue StandardError
end
Expand All @@ -749,6 +778,8 @@ def create_osw(scenario, features, feature_names)
end_date = end_date[0, 10]
end
OpenStudio::Extension.set_measure_argument(osw, 'set_run_period', 'end_date', end_date)
else
puts "no simulation end_date set in the feature file...using default"
end
rescue StandardError
end
Expand Down Expand Up @@ -780,6 +811,9 @@ def create_osw(scenario, features, feature_names)
number_of_stories_below_ground = 0
end
template = building_hash.key?(:template) ? building_hash[:template] : nil
if template.nil?
raise "Template is not defined in the feature file"
end
footprint_area = building_hash[:footprint_area]

mapped_building_type_1 = lookup_building_type(building_type_1, template, footprint_area, number_of_stories)
Expand Down
2 changes: 1 addition & 1 deletion example_files/mappers/CreateBar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# OF THE POSSIBILITY OF SUCH DAMAGE.
# *********************************************************************************

require 'urbanopt/scenario'
require 'urbanopt/reporting'
require 'openstudio/common_measures'
require 'openstudio/model_articulation'
require 'openstudio/ee_measures'
Expand Down
2 changes: 1 addition & 1 deletion example_files/mappers/Floorspace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# OF THE POSSIBILITY OF SUCH DAMAGE.
# *********************************************************************************

require 'urbanopt/scenario'
require 'urbanopt/reporting'
require 'openstudio/common_measures'
require 'openstudio/model_articulation'
require 'openstudio/ee_measures'
Expand Down
28 changes: 20 additions & 8 deletions example_files/mappers/HighEfficiency.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
#*********************************************************************************
# URBANopt™, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
# *********************************************************************************
# URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
# contributors. All rights reserved.
#

# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#

# Redistributions of source code must retain the above copyright notice, this list
# of conditions and the following disclaimer.
#

# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or other
# materials provided with the distribution.
#

# Neither the name of the copyright holder nor the names of its contributors may be
# used to endorse or promote products derived from this software without specific
# prior written permission.
#

# Redistribution of this software, without modification, must refer to the software
# by the same designation. Redistribution of a modified version of this software
# (i) may not refer to the modified version by the same designation, or by any
# confusingly similar designation, and (ii) must refer to the underlying software
# originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
# the term “URBANopt”, or any confusingly similar designation may not be used to
# refer to any modified version of this software or any modified version of the
# underlying software originally provided by Alliance without the prior written
# consent of Alliance.

# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
Expand All @@ -26,11 +36,13 @@
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
#*********************************************************************************
# *********************************************************************************

require 'urbanopt/reporting'
require 'openstudio/common_measures'
require 'openstudio/model_articulation'
require 'openstudio/ee_measures'
require 'openstudio/calibration'

require_relative 'Baseline'

Expand Down
5 changes: 3 additions & 2 deletions example_files/mappers/HighEfficiencyCreateBar.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# *********************************************************************************
# URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
# contributors. All rights reserved.
Expand Down Expand Up @@ -39,9 +38,11 @@
# OF THE POSSIBILITY OF SUCH DAMAGE.
# *********************************************************************************

require 'urbanopt/scenario'
require 'urbanopt/reporting'
require 'openstudio/common_measures'
require 'openstudio/model_articulation'
require 'openstudio/ee_measures'
require 'openstudio/calibration'

require_relative 'CreateBar'

Expand Down
5 changes: 3 additions & 2 deletions example_files/mappers/HighEfficiencyFloorspace.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# *********************************************************************************
# URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
# contributors. All rights reserved.
Expand Down Expand Up @@ -39,9 +38,11 @@
# OF THE POSSIBILITY OF SUCH DAMAGE.
# *********************************************************************************

require 'urbanopt/scenario'
require 'urbanopt/reporting'
require 'openstudio/common_measures'
require 'openstudio/model_articulation'
require 'openstudio/ee_measures'
require 'openstudio/calibration'

require_relative 'Floorspace'

Expand Down
Loading

0 comments on commit 2590bbf

Please sign in to comment.