urbanopt-cli 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3365bbb79ce6bc9eea243c868e7e4234f15d437993245f4fdb70650236964fb
4
- data.tar.gz: 52ace47ebf647cbd861f1cfb7fc2a7ec460edb870803147330e6265638de8b74
3
+ metadata.gz: 9bf78e9e5b7c3424cdf4e36daec9fc7161b9ea0cf508ee654fa800143f795653
4
+ data.tar.gz: 8d8c1c19ffcc17093d23e970208ba9d2cf8d84bc7b449d1471ea53a896e0e91b
5
5
  SHA512:
6
- metadata.gz: 2498eac875e6852671f6b8a757520aed6911d097097382b2bd45039ae8c524f95583ae92a4f7e9f9238e3ff55a2f2cfc57b024c38455562da1d2100312c7f479
7
- data.tar.gz: 74eb05da265daec7b6bd5d0b1b1bb83ccbcd1af4841aa82a1ff2f57f86863f8ba331dfbcf71ee314f2ea6e9f979acd92a0f1cb4cabb4f4abf76123e5d118b703
6
+ metadata.gz: 7d64d73afa14ec5f324764c68ca2975dc8f1d2dc468796dedebdbc019ce36dfe5a5860f023f3caf9585078464607965f4a609e9c81c60f37b67930408aa45ce6
7
+ data.tar.gz: 4232bee55cc8e82c0c25a3084e0778ca74136bdd1e0cbd04514eac97bcf9bacf81dab2bbc3d56045a2a5570f3f893ed50d713f272b9d77a07b0a014db55008c8
@@ -3,13 +3,11 @@ name: CLI CI
3
3
  on:
4
4
  workflow_dispatch:
5
5
  # Run on demand and weeknights
6
- # push:
6
+ push:
7
7
  schedule:
8
8
  # # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
9
9
  # # 5:24 am UTC (11:24pm MDT the day before) every weekday night in MDT
10
10
  - cron: '24 5 * * 2-6'
11
- pull_request:
12
- types: [review_requested]
13
11
 
14
12
  env:
15
13
  # Favor_Local_Gems enforces develop branch of all Ruby dependencies
@@ -24,6 +22,7 @@ env:
24
22
  jobs:
25
23
  weeknight-tests:
26
24
  strategy:
25
+ fail-fast: false
27
26
  matrix:
28
27
  # os: container operations in GHA only work on Ubuntu
29
28
  # https://docs.github.com/en/actions/using-containerized-services/about-service-containers
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 0.14.0
4
+ Date Range: 06/27/2024 - 11/15/2024
5
+
6
+ ## What's Changed
7
+ ### Exciting New Features 🎉
8
+ * Upgrade version of ThermalNetwork Python dependency by @vtnate in https://github.com/urbanopt/urbanopt-cli/pull/493
9
+ * Upgrade miniconda by @vtnate in https://github.com/urbanopt/urbanopt-cli/pull/492
10
+ * Use new version of GMT by @vtnate in https://github.com/urbanopt/urbanopt-cli/pull/489
11
+ ### Other Changes
12
+ * Update installer patch by @tijcolem in https://github.com/urbanopt/urbanopt-cli/pull/476
13
+ * Fix installer path bug by @vtnate in https://github.com/urbanopt/urbanopt-cli/pull/485
14
+ * Remove unnecessary default user-entry for DES commands by @vtnate in https://github.com/urbanopt/urbanopt-cli/pull/486
15
+
16
+
17
+ **Full Changelog**: https://github.com/urbanopt/urbanopt-cli/compare/v0.13.0...v0.14.0
18
+
3
19
  ## Version 0.13.0
4
20
  Date Range: 05/15/2024 - 06/27/2024
5
21
 
data/CMakeLists.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  cmake_minimum_required(VERSION 3.10.2)
2
2
  cmake_policy(SET CMP0048 NEW)
3
3
 
4
- project(URBANoptCLI VERSION 0.12.0)
4
+ project(URBANoptCLI VERSION 0.13.0)
5
5
 
6
6
  include(FindOpenStudioSDK.cmake)
7
7
 
@@ -89,21 +89,21 @@ option(BUILD_PACKAGE "Build package" OFF)
89
89
  # need to update the MD5sum for each platform and url below
90
90
  if(UNIX)
91
91
  if(APPLE)
92
- set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240521-darwin.tar.gz")
93
- set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "b68de4be53118f58e245aa8bd17f8992")
92
+ set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240709-darwin.tar.gz")
93
+ set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "b683bb30457904041567079ca4ff0fef")
94
94
  else()
95
95
  if (ARCH MATCHES "arm64")
96
96
  set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240524-linux-arm.tar.gz")
97
97
  set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "18915b55621ee755bf92c506b5cdba2a")
98
98
  else()
99
- set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240521-linux.tar.gz")
100
- set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "3f5bf6bc692b0bcc5f50a5b45c2698b3")
99
+ set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240719-linux.tar.gz")
100
+ set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "54f27859ff66915f6b343b0b9731a39c")
101
101
  endif()
102
102
  endif()
103
103
  elseif(WIN32)
104
104
  if(CMAKE_CL_64)
105
- set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240521-windows.tar.gz")
106
- set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "c01415b7b91a0db7ad97ad0493286598")
105
+ set(URBANOPT_CLI_GEMS_ZIP_FILENAME "urbanopt-cli-gems-20240709-windows.tar.gz")
106
+ set(URBANOPT_CLI_GEMS_ZIP_EXPECTED_MD5 "d34b30aae5677f20738b4be6ad31862e")
107
107
  endif()
108
108
  endif()
109
109
 
@@ -35,6 +35,7 @@ else()
35
35
  else() # Assumes 20.04
36
36
  set(OPENSTUDIO_EXPECTED_HASH 5c006e5e66e5e859206a63626ea2966f)
37
37
  set(OPENSTUDIO_PLATFORM "Ubuntu-20.04-x86_64")
38
+ endif()
38
39
  if(LSB_RELEASE_VERSION_SHORT MATCHES "20.04")
39
40
  if (ARCH MATCHES "arm64")
40
41
  set(OPENSTUDIO_EXPECTED_HASH d98b3d3d133a7c5bc1b9581553d23811)
data/README.md CHANGED
@@ -55,12 +55,12 @@ sudo apt install ./UrbanOptCLI-0.3.1.b6f118d506-Linux.deb
55
55
 
56
56
  This will install to `/usr/local/` directory.
57
57
  e.g.
58
- `/usr/local/urbanopt-cli-0.3.1/`
58
+ `/usr/local/urbanopt-cli-0.13.0/`
59
59
 
60
60
  To run the UrbanOpt CLI, first run the `setup-env.sh` script that generates environmental variables and stores these in `env_uo.sh` in your home directory.
61
61
 
62
62
  ```terminal
63
- /usr/local/urbanopt-cli-0.3.1/setup-env.sh
63
+ /usr/local/urbanopt-cli-0.13.0/setup-env.sh
64
64
  . ~/.env_uo.sh
65
65
  ```
66
66
 
@@ -74,7 +74,7 @@ Use the GUI installer and choose a directory to install. Once installed, open a
74
74
  The `setup-env.sh` generates env variables and stores them in a file `.env_uo.sh` in your home directory.
75
75
 
76
76
  ```terminal
77
- /Applications/UrbanOptCLI_0.3.1/setup-env.sh
77
+ /Applications/UrbanOptCLI_0.13.0/setup-env.sh
78
78
  . ~/.env_uo.sh
79
79
  ```
80
80
 
@@ -89,19 +89,19 @@ Use the GUI installer and choose a directory to install. Once installed, open a
89
89
 
90
90
  #### Bash (or GitBash for Windows)
91
91
  ```terminal
92
- c:/urbanopt-cli-0.3.1/setup-env.sh
92
+ c:/urbanopt-cli-0.13.0/setup-env.sh
93
93
  . ~/.env_uo.sh
94
94
  ```
95
95
 
96
- #### Powershell
96
+ #### Powershell or Command Prompt
97
97
  ```terminal
98
- c:\urbanopt-cli-0.3.1\setup-env.ps1
98
+ c:\urbanopt-cli-0.13.0\setup-env.ps1
99
99
  . ~\.env_uo.ps1
100
100
  ```
101
101
  #### Windows Command Prompt
102
+ After the `setup-env.ps1` script has been run:
102
103
  ```terminal
103
- c:\urbanopt-cli-0.3.1\setup-env.bat
104
- %HOMEPATH%\.env_uo.bat
104
+ "%HOMEPATH%/.env_uo.bat"
105
105
  ```
106
106
 
107
107
  When launching new shell terminals run the correct environment config to setup the environment. 
@@ -188,10 +188,10 @@ Python dependencies are currently versioned as follows:
188
188
 
189
189
  | Python Package | Version |
190
190
  | --------------------------- | ------- |
191
- | urbanopt-ditto-reader | 0.6.3 |
192
- | NREL-disco | 0.5.0 |
193
- | geojson-modelica-translator | 0.6.0 |
194
- | ThermalNetwork | 0.2.3 |
191
+ | urbanopt-ditto-reader | 0.6.4 |
192
+ | NREL-disco | 0.5.1 |
193
+ | geojson-modelica-translator | 0.8.0 |
194
+ | ThermalNetwork | 0.3.0 |
195
195
 
196
196
  ## Development
197
197
 
@@ -1,6 +1,6 @@
1
1
  [
2
- { "name": "ThermalNetwork", "version": "0.2.5"},
2
+ { "name": "ThermalNetwork", "version": "0.3.0"},
3
3
  { "name": "urbanopt-ditto-reader", "version": "0.6.4"},
4
4
  { "name": "NREL-disco", "version": "0.5.1"},
5
- { "name": "geojson-modelica-translator", "version": "0.7.0"}
5
+ { "name": "geojson-modelica-translator", "version": "0.8.0"}
6
6
  ]
@@ -77,13 +77,29 @@ if [ ! -d $INSTALL_BASE ]; then
77
77
  exit 1
78
78
  fi
79
79
 
80
- if [[ "$OSTYPE" == "linux-gnu" ]]; then
81
- PLATFORM=Linux-x86_64
82
- elif [[ "$OSTYPE" == "darwin"* ]]; then
83
- PLATFORM=MacOSX-x86_64
84
- else
85
- error "unknown OS type $OSTYPE"
86
- exit 1
80
+ architecture=$(uname -m)
81
+
82
+ echo "$architecture"
83
+
84
+ # Handle multiple chip architectures (ARM & x86) as well as OS types (Linux & MacOS)
85
+ if [[ $architecture == "x86"* || $architecture == "i686" || $architecture == "i386" ]]; then
86
+ if [[ "$OSTYPE" == "linux-gnu" ]]; then
87
+ PLATFORM=Linux-x86_64
88
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
89
+ PLATFORM=MacOSX-x86_64
90
+ else
91
+ error "unknown OS type $OSTYPE"
92
+ exit 1
93
+ fi
94
+ elif [[ $architecture == "arm"* || $architecture == "aarch"* ]]; then
95
+ if [[ "$OSTYPE" == "linux-gnu" ]]; then
96
+ PLATFORM=Linux-aarch64
97
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
98
+ PLATFORM=MacOSX-arm64
99
+ else
100
+ error "unknown OS type $OSTYPE"
101
+ exit 1
102
+ fi
87
103
  fi
88
104
 
89
105
  CONDA_PACKAGE_NAME=Miniconda3-py${PYTHON_MAJOR_MINOR}_${CONDA_VERSION}-${PLATFORM}.sh
@@ -5,6 +5,6 @@
5
5
 
6
6
  module URBANopt
7
7
  module CLI
8
- VERSION = '0.13.0'.freeze
8
+ VERSION = '0.14.0'.freeze
9
9
  end
10
10
  end
data/lib/uo_cli.rb CHANGED
@@ -74,7 +74,7 @@ module URBANopt
74
74
  # Define creation commands
75
75
  def opt_create
76
76
  @subopts = Optimist.options do
77
- banner "\nURBANopt #{@command}:\n \n"
77
+ banner "\nURBANopt create:\n \n"
78
78
 
79
79
  opt :project_folder, "\nCreate project directory in your current folder. Name the directory\n" \
80
80
  "Add additional tags to specify the method for creating geometry, or use the default urban geometry creation method to create building geometry from geojson coordinates with core and perimeter zoning\n" \
@@ -148,7 +148,8 @@ module URBANopt
148
148
  # Define commands to install python
149
149
  def opt_install_python
150
150
  @subopts = Optimist.options do
151
- banner "\nURBANopt #{@command}:\n \n"
151
+ banner "\nURBANopt install_python:\n \n"
152
+
152
153
  opt :verbose, "\Verbose output \n" \
153
154
  'Example: uo install_python --verbose'
154
155
  end
@@ -157,7 +158,7 @@ module URBANopt
157
158
  # Update project
158
159
  def opt_update
159
160
  @subopts = Optimist.options do
160
- banner "\nURBANopt #{@command}:\n \n"
161
+ banner "\nURBANopt update:\n \n"
161
162
 
162
163
  opt :existing_project_folder, "\Specify existing project folder name to update files \n" \
163
164
  'Example: uo update --existing-project-folder urbanopt_example_project --new-project-directory path/to/new_urbanopt_example_project', type: String, short: :e
@@ -170,7 +171,7 @@ module URBANopt
170
171
  # Define running commands
171
172
  def opt_run
172
173
  @subopts = Optimist.options do
173
- banner "\nURBANopt #{@command}:\n \n"
174
+ banner "\nURBANopt run:\n \n"
174
175
 
175
176
  opt :scenario, "\nRun URBANopt simulations for <scenario>\n" \
176
177
  "Requires --feature also be specified\n" \
@@ -189,7 +190,7 @@ module URBANopt
189
190
  # Define opendss commands
190
191
  def opt_opendss
191
192
  @subopts = Optimist.options do
192
- banner "\nURBANopt #{@command}:\n\n"
193
+ banner "\nURBANopt opendss:\n\n"
193
194
 
194
195
  opt :scenario, "\nRun OpenDSS simulations for <scenario>\n" \
195
196
  "Requires --feature also be specified\n" \
@@ -240,7 +241,7 @@ module URBANopt
240
241
  # Define DISCO commands
241
242
  def opt_disco
242
243
  @subopts = Optimist.options do
243
- banner "\nURBANopt #{@command}:\n\n"
244
+ banner "\nURBANopt disco:\n\n"
244
245
 
245
246
  opt :scenario, "\nRun DISCO simulations for <scenario>\n" \
246
247
  "Requires --feature also be specified\n" \
@@ -261,7 +262,7 @@ module URBANopt
261
262
  # Define RNM commands
262
263
  def opt_rnm
263
264
  @subopts = Optimist.options do
264
- banner "\nURBANopt #{@command}:\n\n"
265
+ banner "\nURBANopt rnm:\n\n"
265
266
 
266
267
  opt :scenario, "\nRun RNM simulation for <scenario>. Scenario must be run and post-processed prior to calling the rnm command.\n" \
267
268
  "Requires --feature also be specified\n" \
@@ -288,7 +289,7 @@ module URBANopt
288
289
  # Define post-processing commands
289
290
  def opt_process
290
291
  @subopts = Optimist.options do
291
- banner "\nURBANopt #{@command}:\n \n"
292
+ banner "\nURBANopt process:\n \n"
292
293
 
293
294
  opt :default, "\nStandard post-processing for your scenario", short: :d
294
295
 
@@ -323,7 +324,7 @@ module URBANopt
323
324
  # Define visualization commands
324
325
  def opt_visualize
325
326
  @subopts = Optimist.options do
326
- banner "\nURBANopt #{@command}:\n \n"
327
+ banner "\nURBANopt visualize:\n \n"
327
328
 
328
329
  opt :feature, "\nVisualize results for all scenarios for a feature file\n" \
329
330
  "Provide the FeatureFile to visualize each associated scenario\n" \
@@ -338,7 +339,7 @@ module URBANopt
338
339
  # Define validation commands
339
340
  def opt_validate
340
341
  @subopts = Optimist.options do
341
- banner "\nURBANopt #{@command}:\n \n"
342
+ banner "\nURBANopt validate:\n \n"
342
343
 
343
344
  opt :eui, "\nCompare eui results in feature reports to limits in validation_schema.yaml\n" \
344
345
  "Provide path to the validation_schema.yaml file in your project directory\n" \
@@ -354,7 +355,7 @@ module URBANopt
354
355
 
355
356
  def opt_delete
356
357
  @subopts = Optimist.options do
357
- banner "\nURBANopt #{@command}:\n \n"
358
+ banner "\nURBANopt delete:\n \n"
358
359
 
359
360
  opt :scenario, "\nDelete simulation files for this scenario", default: 'baseline_scenario.csv', required: true
360
361
  end
@@ -362,7 +363,7 @@ module URBANopt
362
363
 
363
364
  def opt_des_params
364
365
  @subopts = Optimist.options do
365
- banner "\nURBANopt #{@command}:\n \n"
366
+ banner "\nURBANopt des_params:\n \n"
366
367
 
367
368
  opt :sys_param, "\nBuild a system parameters JSON config file for Modelica District Energy System or Ground Heat Exchanger simulation using URBANopt SDK outputs\n" \
368
369
  "Provide path/name of json file to be created\n" \
@@ -375,11 +376,13 @@ module URBANopt
375
376
  "Example: uo des_params --sys-param path/to/sys_params.json --feature path/to/example_project.json\n", type: String, required: true, short: :f
376
377
 
377
378
  opt :model_type, "\nSelection for which kind of DES simulation to perform\n" \
378
- "Valid choices: 'time_series'", type: String, default: 'time_series'
379
+ "Valid choices: 'time_series']\n" \
380
+ 'If not specified, the default time_series simulation type will be used', type: String, short: :m
379
381
 
380
382
  opt :district_type, "\nSelection for which kind of district system parameters to generate\n" \
381
383
  "Example: uo des_params --sys-param path/to/sys_params.json --feature path/to/example_project.json --district-type 5G_ghe\n" \
382
- 'If not specified, the default 4G district type will be used', type: String, required: false, short: :t
384
+ "Available options are: ['4G', '5G_ghe']\n" \
385
+ 'If not specified, the default 4G district type will be used', type: String, short: :t
383
386
 
384
387
  opt :overwrite, "\nDelete and rebuild existing sys-param file\n", short: :o
385
388
  'Example: uo des_params --sys-param path/to/sys_params.json --feature path/to/example_project.json --overwrite'
@@ -388,7 +391,7 @@ module URBANopt
388
391
 
389
392
  def opt_des_create
390
393
  @subopts = Optimist.options do
391
- banner "\nURBANopt #{@command}:\n"
394
+ banner "\nURBANopt des_create:\n"
392
395
 
393
396
  opt :sys_param, "\nPath to system parameters config file, possibly created with 'des_params' command in this CLI\n" \
394
397
  "Example: uo des_create --sys-param system_parameters.json\n", type: String, required: true, short: :y
@@ -397,7 +400,7 @@ module URBANopt
397
400
  'Example: uo des_create --feature path/to/example_project.json', type: String, required: true, short: :f
398
401
 
399
402
  opt :des_name, "\nPath to Modelica project dir to be created\n" \
400
- 'Example: uo des_create --des-name path/to/example_modelica_project', type: String, required: true, short: :n
403
+ 'Example: uo des_create --des-name path/to/example_modelica_project', type: String, short: :n
401
404
 
402
405
  opt :overwrite, "\nDelete and rebuild existing model directory\n", short: :o
403
406
  'Example: uo des_create --des-name path/to/example_modelica_project --overwrite'
@@ -406,7 +409,7 @@ module URBANopt
406
409
 
407
410
  def opt_des_run
408
411
  @subopts = Optimist.options do
409
- banner "\nURBANopt #{@command}:\n \n"
412
+ banner "\nURBANopt des_run:\n \n"
410
413
 
411
414
  opt :model, "\nPath to Modelica model dir, possibly created with 'des_create' command in this CLI\n" \
412
415
  'Example: uo des_run --model path/to/model/dir', type: String, required: true
@@ -415,7 +418,7 @@ module URBANopt
415
418
 
416
419
  def opt_ghe_size
417
420
  @subopts = Optimist.options do
418
- banner "\nURBANopt #{@command}:\n \n"
421
+ banner "\nURBANopt ghe_size:\n \n"
419
422
 
420
423
  opt :sys_param, "Path to system parameters config file, possibly created with 'des_params' command in this CLI\n" \
421
424
  "Example: uo ghe_size --sys-param path/to/sys_params.json --scenario path/to/baseline_scenario.csv --feature path/to/example_project.json\n", type: String, required: true, short: :y
@@ -545,7 +548,7 @@ module URBANopt
545
548
  end
546
549
  # Rescue if json isn't a geojson feature_file
547
550
  rescue NoMethodError
548
- abort("\nOops! You didn't provde a valid feature_file. Please provide path to the geojson feature_file")
551
+ abort("\nOops! You didn't provide a valid feature_file. Please provide path to the geojson feature_file")
549
552
  rescue StandardError => e
550
553
  puts "\nERROR: #{e.message}"
551
554
  end
@@ -902,7 +905,7 @@ module URBANopt
902
905
  def self.setup_python_variables
903
906
  pvars = {
904
907
  python_version: '3.10',
905
- miniconda_version: '4.12.0',
908
+ miniconda_version: '24.9.2-0',
906
909
  python_install_path: nil,
907
910
  python_path: nil,
908
911
  pip_path: nil,
@@ -1844,7 +1847,7 @@ module URBANopt
1844
1847
  des_cli_addition += ' --overwrite'
1845
1848
  end
1846
1849
  else
1847
- abort("\nCommand must include system parameter file name, FeatureFile, and model name. Please try again")
1850
+ abort("\nCommand must include system parameter file name and FeatureFile. Please try again")
1848
1851
  end
1849
1852
  begin
1850
1853
  system(des_cli_root + des_cli_addition)
@@ -1917,7 +1920,7 @@ module URBANopt
1917
1920
  # if @opthash.subopts[:verbose]
1918
1921
  # puts "ghe_cli_root: #{ghe_cli_root}"
1919
1922
  # puts "ghe_cli_addition: #{ghe_cli_addition}"
1920
- # puts "comand: #{ghe_cli_root + ghe_cli_addition}"
1923
+ # puts "command: #{ghe_cli_root + ghe_cli_addition}"
1921
1924
  # end
1922
1925
  begin
1923
1926
  system(ghe_cli_root + ghe_cli_addition)
@@ -1,16 +1,17 @@
1
1
  #!/bin/bash
2
- # This is a simple setup script that generates an enviroment file that
3
- # is used to setup the ruby enviroment to run the urbanopt-cli tool.
2
+ # This is a simple setup script that generates an environment file that
3
+ # is used to setup the ruby environment to run the urbanopt-cli tool.
4
4
  # To use, just run this script in bash (e.g. ./setup-env.sh)
5
- # Then you can use this env.sh to setup the enviroment.
5
+ # Then you can use this env.sh to setup the environment.
6
6
  # (e.g. source ~/.env_uo.sh)
7
7
 
8
8
 
9
9
  BASE_DIR_NAME=$(dirname `which $0`)
10
+ UO_DIR_NAME=$(basename "$BASE_DIR_NAME")
10
11
 
11
12
  GEM_HOME=${BASE_DIR_NAME}/gems/ruby/2.7.0
12
13
  GEM_PATH=${BASE_DIR_NAME}/gems/ruby/2.7.0
13
- PATH=${BASE_DIR_NAME}/ruby/bin:${BASE_DIR_NAME}/gems/ruby/2.7.0/bin:${BASE_DIR_NAME}/gems/ruby/2.7.0/gems/urbanopt-cli-0.11.1/example_files/python_deps/Miniconda-4.12.0/bin:$PATH
14
+ PATH=${BASE_DIR_NAME}/ruby/bin:${BASE_DIR_NAME}/gems/ruby/2.7.0/bin:${BASE_DIR_NAME}/gems/ruby/2.7.0/gems/${UO_DIR_NAME}/example_files/python_deps/Miniconda-4.12.0/bin:$PATH
14
15
  RUBYLIB=${BASE_DIR_NAME}/OpenStudio/Ruby
15
16
  RUBY_DLL_PATH=${BASE_DIR_NAME}/OpenStudio/Ruby
16
17
 
@@ -1,17 +1,18 @@
1
1
  #!/bin/bash
2
- # This is a simple setup script that generates an enviroment file that
3
- # is used to setup the ruby enviroment to run the urbanopt-cli tool.
2
+ # This is a simple setup script that generates an environment file that
3
+ # is used to setup the ruby environment to run the urbanopt-cli tool.
4
4
  # To use, just run this script in bash (e.g. ./setup-env.sh)
5
- # Then you can use this env.sh to setup the enviroment.
5
+ # Then you can use this env.sh to setup the environment.
6
6
  # (e.g. . env.sh)
7
7
 
8
- BASE_DIR_NAME="$(cd "$(dirname "$0")" && pwd)"
8
+ UO_DIR=$(dirname "$(realpath "$0")")
9
+ UO_DIR_NAME=$(basename "$UO_DIR")
9
10
 
10
- GEM_HOME=${BASE_DIR_NAME}/gems/ruby/2.7.0
11
- GEM_PATH=${BASE_DIR_NAME}/gems/ruby/2.7.0
12
- PATH=${BASE_DIR_NAME}/ruby/bin:${BASE_DIR_NAME}/gems/ruby/2.7.0/bin:${BASE_DIR_NAME}/gems/ruby/2.7.0/gems/urbanopt-cli-0.11.1/example_files/python_deps/Miniconda-4.12.0/bin:$PATH
13
- RUBYLIB=${BASE_DIR_NAME}/OpenStudio/Ruby
14
- RUBY_DLL_PATH=${BASE_DIR_NAME}/OpenStudio/Ruby
11
+ GEM_HOME=${UO_DIR}/gems/ruby/2.7.0
12
+ GEM_PATH=${UO_DIR}/gems/ruby/2.7.0
13
+ PATH=${UO_DIR}/ruby/bin:${UO_DIR}/gems/ruby/2.7.0/bin:${UO_DIR}/gems/ruby/2.7.0/gems/${UO_DIR_NAME}/example_files/python_deps/Miniconda-4.12.0/bin:$PATH
14
+ RUBYLIB=${UO_DIR}/OpenStudio/Ruby
15
+ RUBY_DLL_PATH=${UO_DIR}/OpenStudio/Ruby
15
16
 
16
17
  # Remove if exists
17
18
  if [ -f ~/.env_uo.sh ]; then
@@ -23,5 +24,3 @@ echo "export GEM_PATH=\"${GEM_PATH}\"" >> ~/.env_uo.sh
23
24
  echo "export PATH=\"${PATH}\"" >> ~/.env_uo.sh
24
25
  echo "export RUBYLIB=\"${RUBYLIB}\"" >> ~/.env_uo.sh
25
26
  echo "export RUBY_DLL_PATH=\"${RUBY_DLL_PATH}\"" >> ~/.env_uo.sh
26
-
27
-
@@ -1,25 +1,45 @@
1
- # This is a simple setup script that generates an enviroment file that
2
- # is used to setup the ruby enviroment to run the urbanopt-cli tool.
1
+ # This is a simple setup script that generates an environment file that
2
+ # is used to setup the ruby environment to run the urbanopt-cli tool.
3
3
  # To use just run this script in powershell (e.g. ./setup-env.ps1)
4
- # Then you can use this env.ps1 to setup the enviroment.
4
+ # Then you can use this env.ps1 to setup the environment.
5
5
  # (e.g. . env.ps1)
6
+ $PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
6
7
 
7
8
  if (-not (Test-Path $HOME)) { echo "env HOME needs to be set before running this script" }
8
9
  if (-not (Test-Path $HOME)) { exit }
9
10
 
11
+ # uo install_python will install its own python within the gem directories so we need to find the python path and add it to $env.PATH
12
+ $output = Get-ChildItem -ErrorAction SilentlyContinue -Directory "C:\URBANopt*" -Recurse -Filter "python-3.10" | Select-Object FullName
13
+
14
+ if ($output.FullName) {
15
+ $RUBY_PYTHON_PATH = $output.FullName
16
+ }
17
+ else {
18
+ $RUBY_PYTHON_PATH = ""
19
+ }
20
+
21
+
10
22
  $BASE_DIR_NAME = $PSScriptRoot
11
23
 
12
24
  $env:GEM_HOME = "$BASE_DIR_NAME\gems\ruby\2.7.0"
13
25
  $env:GEM_PATH = "$BASE_DIR_NAME\gems\ruby\2.7.0"
14
- $env:PATH += ";$BASE_DIR_NAME\ruby\bin;$BASE_DIR_NAME\gems\ruby\2.7.0\bin;$BASE_DIR_NAME\gems\ruby\2.7.0\gems\urbanopt-cli-0.11.1\example_files\python_deps\python-3.10"
26
+ $env:PATH += ";$BASE_DIR_NAME\ruby\bin;$BASE_DIR_NAME\gems\ruby\2.7.0\bin;$RUBY_PYTHON_PATH"
15
27
  $env:RUBYLIB = "$BASE_DIR_NAME\OpenStudio\Ruby"
16
28
  $env:RUBY_DLL_PATH = "$BASE_DIR_NAME\OpenStudio\Ruby"
17
29
 
18
30
  # Remove if exists
19
31
  Remove-Item $HOME/.env_uo.ps1 -ErrorAction Ignore
32
+ Remove-Item $HOME/.env_uo.bat -ErrorAction Ignore
20
33
 
21
34
  '$env:GEM_HOME = "' + $env:GEM_HOME + '"' >> $HOME/.env_uo.ps1
22
35
  '$env:GEM_PATH = "' + $env:GEM_PATH + '"' >> $HOME/.env_uo.ps1
23
36
  '$env:PATH = "' + $env:PATH + '"' >> $HOME/.env_uo.ps1
24
37
  '$env:RUBYLIB = "' + $env:RUBYLIB + '"' >> $HOME/.env_uo.ps1
25
38
  '$env:RUBY_DLL_PATH = "' + $env:RUBY_DLL_PATH + '"' >> $HOME/.env_uo.ps1
39
+
40
+ '' >> $HOME/.env_uo.bat
41
+ 'SET "GEM_HOME=' + $env:GEM_HOME + '"' >> $HOME/.env_uo.bat
42
+ 'SET "GEM_PATH=' + $env:GEM_PATH + '"' >> $HOME/.env_uo.bat
43
+ 'SET "PATH=' + $env:PATH + '"' >> $HOME/.env_uo.bat
44
+ 'SET "RUBYLIB=' + $env:RUBYLIB + '"' >> $HOME/.env_uo.bat
45
+ 'SET "RUBY_DLL_PATH=' + $env:RUBY_DLL_PATH + '"' >> $HOME/.env_uo.bat
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbanopt-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - NREL URBANopt team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-27 00:00:00.000000000 Z
11
+ date: 2024-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: optimist
@@ -1458,7 +1458,6 @@ files:
1458
1458
  - lib/uo_cli/version.rb
1459
1459
  - scripts/setup-env-gitbash.sh
1460
1460
  - scripts/setup-env-unix.sh
1461
- - scripts/setup-env.bat
1462
1461
  - scripts/setup-env.ps1
1463
1462
  - uo_cli.gemspec
1464
1463
  homepage: https://docs.urbanopt.net/
@@ -1,20 +0,0 @@
1
- IF "%HOMEPATH%"=="" ECHO HOMEPATH is NOT defined. Please set this env value to your home directory before running this script.
2
- IF "%HOMEPATH%"=="" exit /B
3
-
4
- SET BASE_DIR_NAME=%~d0%~p0
5
-
6
- SET GEM_HOME=%BASE_DIR_NAME%\gems\ruby\2.7.0
7
- SET GEM_PATH=%BASE_DIR_NAME%\gems\ruby\2.7.0
8
- SET PATH=%BASE_DIR_NAME%\ruby\bin;%BASE_DIR_NAME%\gems\ruby\2.7.0\bin;%BASE_DIR_NAME%\gems\ruby\2.7.0\gems\urbanopt-cli-0.11.1\example_files\python_deps\python-3.10;%PATH%
9
- SET RUBYLIB=%BASE_DIR_NAME%\OpenStudio\Ruby
10
- SET RUBY_DLL_PATH=%BASE_DIR_NAME%\OpenStudio\Ruby
11
-
12
- IF EXIST %HOMEPATH%\.env_uo.bat (
13
- del "%HOMEPATH%\.env_uo.bat"
14
- )
15
-
16
- echo SET "GEM_HOME=%GEM_HOME%">> "%HOMEPATH%\.env_uo.bat"
17
- echo SET "GEM_PATH=%GEM_PATH%">> "%HOMEPATH%\.env_uo.bat"
18
- echo SET "PATH=%PATH%">> "%HOMEPATH%\.env_uo.bat"
19
- echo SET "RUBYLIB=%RUBYLIB%">> "%HOMEPATH%\.env_uo.bat"
20
- echo SET "RUBY_DLL_PATH=%RUBY_DLL_PATH%">> "%HOMEPATH%\.env_uo.bat"