Skip to content

Commit

Permalink
v0.12.0 (#466)
Browse files Browse the repository at this point in the history
* udpates for 0.11.1 release

* updates to support linux arm

* adding rescue blocks to catch errors

* Update CLI sub-commands to be consistent across commands (#455)

* delete improper white space at beginning of cli line

* standardize sys-param parameter

* update tests to use new sys-param cli parameter

* Install exact python dependency versions, and bump ThermalNetwork version (#457)

* expect new version of ThermalNetwork

* install exact python dependency versions, not fuzzy

* update error handling for installing python and dependencies (#458)

* test out develop gem package for macos

* add in path for python miniconda if user installs python

* revert back to using 0.11.1 gem packages for macos

* update error handling for installing python and dependencies

* revert to ThermalNetwork 0.2.3 to reduce dependency conflicts

* check for python version in a better way in spec file

* hard-code paths for installing python on Windows

* install ThermalNetwork 0.2.4

* update paths for windows only

* match path for gitbash script from tims branch

---------

Co-authored-by: tijcolem <[email protected]>
Co-authored-by: ci-commercialbuildings <[email protected]>
Co-authored-by: Nathan Moore <[email protected]>

* Update python dependency versions (#460)

* bump TN to 0.2.5

* bump disco to resolve pandas version conflicts

* use the newest version of ditto-reader

* update gmt version

* update code to work with gmt v0.7.0

* update tests to work with gmt v0.7.0

* fix code mistakes for calling gmt v0.7.0 properly

* try zipping rspec results before uploading artifact

* Update commands, paths, and example files for Reopt v3 (#463)

* skip resilience test until we fix that aspect of reopt processing

* update test reopt assumptions files to work with reopt v3

* update reopt assumptions files to work with reopt v3

* remove boilerplate comments

* bump to version 0.12.0

* add warning that resilience is not currently supported

* point to reopt-v3 branches of dependent gems

* clarify todo comment

* close with graceful message if reopt-resilience is attempted

* update assumptions files to match reopt-gem for v3

* update test files to work with reopt v3

* remove duplicative commands from reopt post-processing tests

* smarter way to select reopt assumptions file

* better way of finding python version for test

* remove wind from reopt assumptions file

* remove lat/long from assumptions files

* add wind, remove lat/long from test assumption files

* clean up gemfile, gemspec, and project gemfile

* delete test ghe_dir before testing

* restore project gemfile properly this time, ugh

* uuuuuuuugh get the right reporting-gem version

* update reporting-gem version

* add post-process step to opendss test

* reorder process call in opendss test

* attempt at fixing github caching issue

* Revert "attempt at fixing github caching issue"

This reverts commit 30cbca0.

* attempt to change pip cache permissions on github

* attempt to fix syntax for pip cache permissions

* fix help text for district_type in des_params

* fix des_params test call in basic tests for new gmt v0.7.0

* slightly different command for zip Action

* remove owership change attempt

* reopt resilience-not-supported wording

* remove duplicate test to generate a sys-param file

* debug GHA to troubleshoot disco test failure on CI

* directly install OS on runner instead of using container

* more OS debugging

* another attempt at troubleshooting

* farther down the rabbit hole

* another attempt at using the right Ruby

* go back to working ci config

* ignore warnings when installing dependencies...do not treat them as errors

---------

Co-authored-by: kflemin <[email protected]>

* Prep 0.12.0 (#465)

* remove commented references to closed branch in Gemfile

* changelog entries for v0.12.0

* clean up CI config file

* rubocop

---------

Co-authored-by: tijcolem <[email protected]>
Co-authored-by: Ubuntu <[email protected]>
Co-authored-by: Katherine Fleming <[email protected]>
Co-authored-by: ci-commercialbuildings <[email protected]>
  • Loading branch information
5 people authored May 15, 2024
1 parent ab858d2 commit d975cac
Show file tree
Hide file tree
Showing 26 changed files with 798 additions and 786 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/nightly_ci_build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: CLI CI

on:
# Run on weeknights, and also whenever a push is made
push:
workflow_dispatch:
# Run on demand and weeknights
# push:
schedule:
# # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
# # 5:24 am UTC (11:24pm MDT the day before) every weekday night in MDT
Expand All @@ -16,6 +17,7 @@ env:
# If CI is then successful, we have a breaking change in a dependency somewhere.
FAVOR_LOCAL_GEMS: true
GEM_DEVELOPER_KEY: ${{ secrets.GEM_DEVELOPER_KEY }}
# RUBYLIB: /usr/local/openstudio-3.7.0/Ruby
UO_NUM_PARALLEL: 4
# GHA machines have 4 cores. Trying to run more concurrently will slow everything down.
# https://github.blog/2024-01-17-github-hosted-runners-double-the-power-for-open-source/
Expand All @@ -32,10 +34,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Change Owner of Container Working Directory
# working dir permissions workaround from https://github.com/actions/runner-images/issues/6775#issuecomment-1377299658
run: chown root:root .
# working dir permissions workaround from https://github.com/actions/runner-images/issues/6775s#issuecomment-1377299658
run: |
chown root:root .
- name: Install Ruby dependencies
run: |
which ruby
ruby --version
bundle update
bundle exec certified-update
Expand All @@ -60,6 +64,5 @@ jobs:
if: failure()
with:
name: rspec_results
path: |
spec/test_directory**/
path: artifact.zip
retention-days: 7 # save for 1 week then delete
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.12.0
Date Range: 02/08/2024 - 05/15/2024

### Exciting New Features 🎉
* Update CLI sub-commands to be consistent across commands by @vtnate in https://github.com/urbanopt/urbanopt-cli/pull/455
* Update commands, paths, and example files for Reopt v3 by @vtnate in https://github.com/urbanopt/urbanopt-cli/pull/463
### Other Changes
* Update installer 0.11.1 by @tijcolem in https://github.com/urbanopt/urbanopt-cli/pull/452
* adding rescue blocks to catch errors by @kflemin in https://github.com/urbanopt/urbanopt-cli/pull/454
* update error handling for installing python and dependencies by @kflemin in https://github.com/urbanopt/urbanopt-cli/pull/458

**Full Changelog**: https://github.com/urbanopt/urbanopt-cli/compare/v0.11.1...v0.12.0

## Version 0.11.1
Date Range: 01/26/2024 - 02/08/2024

Expand Down
19 changes: 12 additions & 7 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.11.0)
project(URBANoptCLI VERSION 0.11.1)

include(FindOpenStudioSDK.cmake)

Expand Down Expand Up @@ -89,16 +89,21 @@ 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-20240202-darwin.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "27dad609451f5b0e7835efbcb8e362b7")
set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240220-darwin.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "1f735d71eab98df9be7b72f9d5d8a940")
else()
set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240202-linux.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "2182c1ca7bcd85505db4700f4937d181")
if (ARCH MATCHES "arm64")
set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240220-linux-arm.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "ceb41bdd108a77bc43c6d260725a399f")
else()
set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240220-linux.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "715c40a3bf59d539a18a03ad3932ca67")
endif()
endif()
elseif(WIN32)
if(CMAKE_CL_64)
set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240202-windows.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "7a7cc4f928646363bd57b41e10caebca")
set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240220-windows.tar.gz")
set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "944c39e178651173a03efae1d99713e3")
endif()
endif()

Expand Down
5 changes: 5 additions & 0 deletions FindOpenStudioSDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ else()
set(OPENSTUDIO_EXT "tar.gz")
elseif(UNIX)
if(LSB_RELEASE_VERSION_SHORT MATCHES "20.04")
if (ARCH MATCHES "arm64")
set(OPENSTUDIO_EXPECTED_HASH d98b3d3d133a7c5bc1b9581553d23811)
else()
set(OPENSTUDIO_EXPECTED_HASH 1e48f36417d3d118d6a10f1a7d61f46e)
endif()
set(OPENSTUDIO_EXPECTED_HASH 5c006e5e66e5e859206a63626ea2966f)
set(OPENSTUDIO_PLATFORM "Ubuntu-20.04-x86_64")
else() # Assumes 20.04
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ gem 'parser', '3.2.2.2'
# 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'
# gem 'urbanopt-reopt', github: 'URBANopt/urbanopt-reopt-gem', branch: 'develop'
# 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'
# gem 'urbanopt-reporting', github: 'URBANopt/urbanopt-reporting-gem', branch: 'develop'
# end

#if allow_local && File.exist?('../urbanopt-rnm-us-gem')
# if allow_local && File.exist?('../urbanopt-rnm-us-gem')
# gem 'urbanopt-rnm-us', path: '../urbanopt-rnm-us-gem'
# elsif allow_local
# gem 'urbanopt-rnm-us', github: 'URBANopt/urbanopt-rnm-us-gem', branch: 'develop'
Expand Down
7 changes: 0 additions & 7 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,5 @@
require 'bundler/setup'
require 'uo_cli'

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start

require 'irb'
IRB.start(__FILE__)
6 changes: 3 additions & 3 deletions example_files/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if allow_local && File.exist?('../openstudio-load-flexibility-measures-gem')
elsif allow_local
gem 'openstudio-load-flexibility-measures', github: 'NREL/openstudio-load-flexibility-measures-gem', branch: 'develop'
else
gem 'openstudio-load-flexibility-measures', '~> 0.8.0'
gem 'openstudio-load-flexibility-measures', '~> 0.8.0'
end

if allow_local && File.exist?('../openstudio-ee-gem')
Expand All @@ -78,7 +78,7 @@ else
gem 'openstudio-geb', '~> 0.4.0'
end

if allow_local && File.exists?('../urbanopt-geojson-gem')
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'
Expand All @@ -94,5 +94,5 @@ if allow_local && File.exist?('../urbanopt-reporting-gem')
elsif allow_local
gem 'urbanopt-reporting', github: 'URBANopt/urbanopt-reporting-gem', branch: 'develop'
else
gem 'urbanopt-reporting', '~> 0.9.1'
gem 'urbanopt-reporting', '~> 0.10.0'
end
2 changes: 1 addition & 1 deletion example_files/mappers/Baseline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,6 @@ def time_mapping(time)

return osw
end
end # end class
end
end
end
2 changes: 0 additions & 2 deletions example_files/mappers/residential/template/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# See also https://github.com/urbanopt/urbanopt-cli/blob/develop/LICENSE.md
# *********************************************************************************


def residential_template(args, template, climate_zone)
'''Assign arguments from tsv files.'''

Expand Down Expand Up @@ -44,7 +43,6 @@ def residential_template(args, template, climate_zone)
{ args[:heating_system_type] => 'iecc/heating_system.tsv',
args[:cooling_system_type] => 'iecc/cooling_system.tsv',
args[:heat_pump_type] => 'iecc/heat_pump.tsv' }.each do |type, path|

if type != 'none'
filepath = File.join(File.dirname(__FILE__), path)
lookup_tsv = get_lookup_tsv(args, filepath)
Expand Down
1 change: 0 additions & 1 deletion example_files/mappers/residential/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# See also https://github.com/urbanopt/urbanopt-cli/blob/develop/LICENSE.md
# *********************************************************************************


def residential(scenario, feature, args, building_type)
'''Assign arguments from geojson file.'''

Expand Down
7 changes: 3 additions & 4 deletions example_files/measures/BuildResidentialModel/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def run(model, runner, user_arguments)

standards_number_of_living_units = units.size
else
xml_building_folder = "xml_building"
xml_building_folder = 'xml_building'
hpxml_dir = File.join(File.dirname(__FILE__), "../../#{xml_building_folder}/#{args[:hpxml_dir]}")

if !File.exist?(hpxml_dir)
Expand Down Expand Up @@ -158,7 +158,6 @@ def run(model, runner, user_arguments)

hpxml_path = File.expand_path(args[:hpxml_path])
units.each_with_index do |unit, unit_num|

measures = {}
if !unit.key?('hpxml_path') # create a single new HPXML file describing all dwelling units of the feature

Expand All @@ -167,7 +166,7 @@ def run(model, runner, user_arguments)
full_measure_path = File.join(measures_dir, measure_subdir, 'measure.rb')
check_file_exists(full_measure_path, runner)

measure_args = args.clone.collect { |k, v| [k.to_s, v] }.to_h
measure_args = args.clone.transform_keys(&:to_s)
measure_args['hpxml_path'] = hpxml_path
if unit_num > 0
measure_args['existing_hpxml_path'] = hpxml_path
Expand Down Expand Up @@ -208,7 +207,7 @@ def run(model, runner, user_arguments)
FileUtils.cp(File.expand_path(unit['hpxml_path']), hpxml_path)

end
end # end units.each_with_index do |unit, unit_num|
end

# call BuildResidentialScheduleFile / HPXMLtoOpenStudio after HPXML file is created
measures = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
require_relative '../../../mappers/residential/template//util'
require 'openstudio'
require 'openstudio/measure/ShowRunnerOutput'
require_relative '../measure.rb'
require_relative '../measure'
require 'csv'

class BuildResidentialModelTest < Minitest::Test
Expand All @@ -21,14 +21,14 @@ def setup
FileUtils.mkdir_p(@run_path)

@args = {}
_initialize_arguments()
_initialize_arguments
end

def teardown
FileUtils.rm_rf(@run_path)
end

def _initialize_arguments()
def _initialize_arguments
# BuildResidentialModel arguments
@args[:hpxml_path] = @hpxml_path
@args[:output_dir] = @run_path
Expand Down Expand Up @@ -77,7 +77,7 @@ def test_hpxml_dir

@args[:geometry_building_num_units] = 4

_test_measure()
_test_measure
end

def test_schedules_type
Expand All @@ -88,8 +88,8 @@ def test_schedules_type
schedules_types.each do |schedules_type|
@args[:schedules_type] = schedules_type

_apply_residential()
_test_measure()
_apply_residential
_test_measure
end
end

Expand Down Expand Up @@ -118,7 +118,7 @@ def test_feature_building_types_num_units_and_stories
end
end

_apply_residential()
_apply_residential
_test_measure(expected_errors: expected_errors)
end
end
Expand Down Expand Up @@ -157,7 +157,7 @@ def test_feature_building_foundation_and_attic_types_and_num_stories
end
end

_apply_residential()
_apply_residential
_test_measure(expected_errors: expected_errors)
end
end
Expand All @@ -182,8 +182,8 @@ def test_feature_building_types_num_units_and_bedrooms
@args[:geometry_building_num_units] = feature_number_of_residential_units
@number_of_bedrooms = feature_number_of_bedrooms

_apply_residential()
_test_measure()
_apply_residential
_test_measure
end
end
end
Expand All @@ -210,8 +210,8 @@ def test_feature_building_occ_calc_types_num_occupants_and_units
@args[:geometry_building_num_units] = feature_number_of_residential_units
@number_of_occupants = feature_number_of_occupants

_apply_residential()
_test_measure()
_apply_residential
_test_measure
end
end
end
Expand Down Expand Up @@ -244,7 +244,7 @@ def test_feature_building_foundation_types_and_garages
expected_errors = ['Conditioned basement/crawlspace foundation type for apartment units is not currently supported.']
end

_apply_residential()
_apply_residential
_test_measure(expected_errors: expected_errors)
end
end
Expand All @@ -264,8 +264,8 @@ def test_hvac_system_and_fuel_types
@system_type = feature_system_type
@heating_system_fuel_type = feature_heating_system_fuel_type

_apply_residential()
_test_measure()
_apply_residential
_test_measure
end
end
end
Expand All @@ -278,17 +278,17 @@ def test_residential_template_types

feature_templates.each do |feature_template|
@args = {}
_initialize_arguments()
_initialize_arguments

@template = feature_template

_apply_residential()
_apply_residential_template()
_test_measure()
_apply_residential
_apply_residential_template
_test_measure
end
end

def _apply_residential()
def _apply_residential
residential_simulation(@args, @timestep, @run_period, @calendar_year, @weather_filename)
residential_geometry_unit(@args, @building_type, @floor_area, @number_of_bedrooms, @geometry_unit_orientation, @geometry_unit_aspect_ratio, @occupancy_calculation_type, @number_of_occupants, @maximum_roof_height)
residential_geometry_foundation(@args, @foundation_type)
Expand All @@ -299,7 +299,7 @@ def _apply_residential()
residential_appliances(@args)
end

def _apply_residential_template()
def _apply_residential_template
residential_template(@args, @template, @climate_zone)
end

Expand All @@ -317,7 +317,7 @@ def _test_measure(expected_errors: [])
# populate argument with specified hash value if specified
arguments.each do |arg|
temp_arg_var = arg.clone
if @args.has_key?(arg.name.to_sym)
if @args.key?(arg.name.to_sym)
assert(temp_arg_var.setValue(@args[arg.name.to_sym]))
end
argument_map[arg.name] = temp_arg_var
Expand All @@ -332,7 +332,7 @@ def _test_measure(expected_errors: [])
# show_output(result) unless result.value.valueName == 'Fail'
assert_equal('Fail', result.value.valueName)

error_msgs = result.errors.map { |x| x.logMessage }
error_msgs = result.errors.map(&:logMessage)
expected_errors.each do |expected_error|
assert_includes(error_msgs, expected_error)
end
Expand Down
Loading

0 comments on commit d975cac

Please sign in to comment.