Class: URBANopt::CLI::UrbanOptCLI
- Inherits:
-
Object
- Object
- URBANopt::CLI::UrbanOptCLI
- Defined in:
- lib/uo_cli.rb
Defined Under Namespace
Classes: DefaultContextLoader
Constant Summary collapse
- COMMAND_MAP =
{ 'create' => 'Make new things - project directory or files', 'install_python' => 'Pre-install Python tool environments from pyproject.toml dependency-groups (requires uv)', 'update' => 'Update files in an existing URBANopt project', 'run' => 'Use files in your directory to simulate district energy use', 'process' => 'Post-process URBANopt simulations for additional insights', 'visualize' => 'Visualize and compare results for features and scenarios', 'validate' => 'Validate results with custom rules', 'opendss' => 'Run OpenDSS simulation', 'disco' => 'Run DISCO analysis', 'rnm' => 'Run RNM simulation', 'delete' => 'Delete simulations for a specified scenario', 'des_params' => 'Make a DES system parameters config file', 'des_create' => 'Create a Modelica model', 'des_run' => 'Run a Modelica DES model', 'des_process' => 'Post-process a Modelica DES model', 'ghe_size' => 'Run a Ground Heat Exchanger model for sizing', 'usg_preprocess' => 'Generate Urban Systems Generator input CSV from GeoJSON feature file', 'usg_complete' => 'Fill in missing fields in Urban Systems Generator CSV file using USG model', }.freeze
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#mainopts ⇒ Object
readonly
Returns the value of attribute mainopts.
-
#subopts ⇒ Object
readonly
Returns the value of attribute subopts.
Instance Method Summary collapse
-
#initialize ⇒ UrbanOptCLI
constructor
A new instance of UrbanOptCLI.
-
#opt_create ⇒ Object
Define creation commands.
- #opt_delete ⇒ Object
- #opt_des_create ⇒ Object
- #opt_des_params ⇒ Object
- #opt_des_process ⇒ Object
- #opt_des_run ⇒ Object
-
#opt_disco ⇒ Object
Define DISCO commands.
- #opt_ghe_size ⇒ Object
-
#opt_install_python ⇒ Object
Define commands to install python.
-
#opt_opendss ⇒ Object
Define opendss commands.
-
#opt_process ⇒ Object
Define post-processing commands.
-
#opt_rnm ⇒ Object
Define RNM commands.
-
#opt_run ⇒ Object
Define running commands.
-
#opt_update ⇒ Object
Update project.
- #opt_usg_complete ⇒ Object
- #opt_usg_preprocess ⇒ Object
-
#opt_validate ⇒ Object
Define validation commands.
-
#opt_visualize ⇒ Object
Define visualization commands.
Constructor Details
#initialize ⇒ UrbanOptCLI
Returns a new instance of UrbanOptCLI.
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/uo_cli.rb', line 167 def initialize @subopts = nil @command = nil @mainopts = Optimist. do version VERSION "\nURBANopt CLI version: #{version}" "\nUsage:" " uo [options] [<command> [suboptions]]\n \n" 'Options:' opt :version, 'Print version and exit' ## add this here or it goes to bottom of help opt :help, 'Show this help message' ## add this here or it goes to bottom of help # opt :no_pager, "Disable paging" stop_on COMMAND_MAP.keys "\nCommands:" COMMAND_MAP.each { |cmd, desc| format(' %-14<cmd>s %<desc>s', cmd: cmd, desc: desc) } "\nFor help with a specific command: uo <command> --help" "\nAdditional config options can be set with the 'runner.conf' file inside your project folder" 'Fewer warnings are presented when using full paths and the user is not inside the project folder' end return if ARGV.empty? @command = ARGV.shift begin send("opt_#{@command}") ## dispatch to command handling method rescue NoMethodError abort('Invalid command, please run uo --help for a list of available commands') rescue StandardError => e puts "\nERROR: #{e.}" end end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
614 615 616 |
# File 'lib/uo_cli.rb', line 614 def command @command end |
#mainopts ⇒ Object (readonly)
Returns the value of attribute mainopts.
614 615 616 |
# File 'lib/uo_cli.rb', line 614 def mainopts @mainopts end |
#subopts ⇒ Object (readonly)
Returns the value of attribute subopts.
614 615 616 |
# File 'lib/uo_cli.rb', line 614 def subopts @subopts end |
Instance Method Details
#opt_create ⇒ Object
Define creation commands
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/uo_cli.rb', line 199 def opt_create @subopts = Optimist. do "\nURBANopt create:\n \n" opt :project_folder, "\nCreate project directory in your current folder. Name the directory\n" \ "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" \ 'Example: uo create --project-folder urbanopt_example_project', type: String, short: :p opt :create_bar, "\nCreate building geometry and add space types using the create bar from building type ratios measure\n" \ "Refer to https://docs.urbanopt.net/ for more details about the workflow\n" \ "Used with --project-folder\n" \ "Example: uo create --project-folder urbanopt_example_project --create-bar\n", short: :c opt :floorspace, "\nCreate building geometry and add space types from a floorspace.js file\n" \ "Refer to https://docs.urbanopt.net/ for more details about the workflow\n" \ "Used with --project-folder\n" \ "Example: uo create --project-folder urbanopt_example_project --floorspace\n", short: :f opt :combined, "\nCreate project directory that supports running combined residential and commercial workflows\n" \ "This functionality has not been exhaustively tested and currently supports the Single-Family Detached building type and the Baseline Scenario only\n" \ "Used with --project-folder\n" \ "Example: uo create --project-folder urbanopt_example_project --combined\n", short: :d opt :electric, "\nCreate default project with FeatureFile containing electrical network, used for OpenDSS analysis\n" \ 'Example: uo create --project-folder urbanopt_example_project --electric', short: :l opt :disco, "\nCreate default project with FeatureFile containing electrical network, and scenarios for DISCO cost upgrade analysis\n"\ 'Example: uo create --project-folder urbanopt_example_project --disco', short: :a opt :streets, "\nCreate default project with FeatureFile containing streets, used for RNM analysis\n" \ 'Example: uo create --project-folder urbanopt_example_project --streets', short: :t opt :photovoltaic, "\nCreate default project with FeatureFile containing community photovoltaic for the district and ground-mount photovoltaic associated with buildings, used for REopt analysis \n" \ 'Example: uo create --project-folder urbanopt_example_project --photovoltaic', short: :v opt :ghe, "\nCreate default project with FeatureFile containing Ground Heat Exchanger Network\n" \ 'Example: uo create --project-folder urbanopt_example_project --ghe', short: :g opt :class_coincident, "\nCreate default class project with buildings that have coincident schedules \n" \ "Refer to https://docs.urbanopt.net/ for more details about the class project \n" \ "Used with --project-folder\n" \ "Example: uo create --project-folder urbanopt_example_project --class-coincident\n", short: :C opt :class_diverse, "\nCreate default class project with buildings that have diverse schedules \n" \ "Refer to https://docs.urbanopt.net/ for more details about the class project \n" \ "Used with --project-folder\n" \ "Example: uo create --project-folder urbanopt_example_project --class-diverse\n", short: :D opt :empty, "\nUse with --project-folder argument to create an empty project folder\n" \ "Then add your own Feature file in the project directory you created,\n" \ "add Weather files in the weather folder and add OpenStudio models of Features\n" \ "in the Feature File, if any, in the osm_building folder\n" \ "Example: uo create --empty --project-folder urbanopt_example_project\n", short: :e opt :overwrite, "\nUse with --project-folder argument to overwrite existing project folder and replace with new project folder.\n" \ "May be combined with --empty as well to overwrite existing project folder and replace with new empty project folder.\n" \ "Example: uo create --overwrite --empty --project-folder urbanopt_project_folder_I_want_destroyed\n", short: :o opt :scenario_file, "\nAutomatically create a ScenarioFile containing the features in FeatureFile for each scenario\n" \ "Provide the FeatureFile used to create the ScenarioFile\n" \ "Example: uo create --scenario-file example_project.json\n", type: String, short: :s opt :single_feature, "\nCreate a ScenarioFile with only a single feature\n" \ "Use the FeatureID from your FeatureFile\n" \ "Requires 'scenario-file' also be specified, to say which FeatureFile will create the ScenarioFile\n" \ "Example: uo create --single-feature 2 --scenario-file example_project.json\n", type: String, short: :i opt :reopt_scenario_file, "\nCreate a ScenarioFile that includes a column defining the REopt assumptions file\n" \ "Specify the existing ScenarioFile that you want to extend with REopt functionality\n" \ "Example: uo create --reopt-scenario-file baseline_scenario.csv\n", type: String, short: :r opt :reopt_erp_scenario_file, "\nCreate a ScenarioFile that includes a column defining the REopt ERP assumptions file to include outage planning as part of REopt Sizing.\n" \ "Specify the existing ScenarioFile that you want to extend with REopt functionality\n" \ "Example: uo create --reopt-erp-scenario-file baseline_scenario.csv\n", type: String, short: :x opt :reopt_scenario_cost_file, "\nCreate a ScenarioFile that includes a column defining the REopt assumptions file and columns with capital costs\n" \ "Specify the existing ScenarioFile that you want to extend with REopt cost analysis functionality\n" \ "Example: uo create --reopt-scenario-cost-file baseline_scenario.csv\n", type: String, short: :R end end |
#opt_delete ⇒ Object
503 504 505 506 507 508 509 |
# File 'lib/uo_cli.rb', line 503 def opt_delete @subopts = Optimist. do "\nURBANopt delete:\n \n" opt :scenario, "\nDelete simulation files for this scenario", default: 'baseline_scenario.csv', required: true end end |
#opt_des_create ⇒ Object
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 |
# File 'lib/uo_cli.rb', line 556 def opt_des_create @subopts = Optimist. do "\nURBANopt des_create:\n" opt :sys_param, "\nPath to system parameters config file, possibly created with 'des_params' command in this CLI\n" \ "Example: uo des_create --sys-param system_parameters.json\n", type: String, required: true, short: :y opt :feature, "\nPath to the feature JSON file\n" \ 'Example: uo des_create --feature path/to/example_project.json', type: String, required: true, short: :f opt :des_name, "\nPath to Modelica project dir to be created\n" \ 'Example: uo des_create --des-name path/to/example_modelica_project', type: String, short: :n opt :overwrite, "\nDelete and rebuild existing model directory\n", short: :o 'Example: uo des_create --des-name path/to/example_modelica_project --overwrite' end end |
#opt_des_params ⇒ Object
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/uo_cli.rb', line 528 def opt_des_params @subopts = Optimist. do "\nURBANopt des_params:\n \n" 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" \ "Provide path/name of json file to be created\n" \ 'Example: uo des_params --sys-param path/to/sys_params.json', type: String, required: true, short: :y opt :scenario, "\nPath to the scenario CSV file\n" \ "Example: uo des_params --sys-param path/to/sys_params.json --scenario path/to/baseline_scenario.csv\n", type: String, required: true, short: :s opt :feature, "\nPath to the feature JSON file\n" \ "Example: uo des_params --sys-param path/to/sys_params.json --feature path/to/example_project.json\n", type: String, required: true, short: :f opt :model_type, "\nSelection for which kind of DES simulation to perform\n" \ "Valid choice: 'time_series'\n" \ 'If not specified, the default time_series simulation type will be used', type: String, short: :m opt :district_type, "\nSelection for which kind of district system parameters to generate\n" \ "Example: uo des_params --sys-param path/to/sys_params.json --feature path/to/example_project.json --district-type 5G_ghe\n" \ "Available options are: ['steam', '4G', '5G', '5G_ghe']. Defaults to '4G'.\n" \ 'If not specified, the default 4G district type will be used', type: String, short: :t opt :overwrite, "\nDelete and rebuild existing sys-param file\n", short: :o 'Example: uo des_params --sys-param path/to/sys_params.json --feature path/to/example_project.json --overwrite' end end |
#opt_des_process ⇒ Object
591 592 593 594 595 596 597 598 |
# File 'lib/uo_cli.rb', line 591 def opt_des_process @subopts = Optimist. do "\nURBANopt #{@command}:\n \n" opt :model, "\nPath to Modelica model dir, possibly created with 'des_create' command in this CLI\n" \ 'Example: uo des_process --model path/to/model/dir', type: String, required: true end end |
#opt_des_run ⇒ Object
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 |
# File 'lib/uo_cli.rb', line 574 def opt_des_run @subopts = Optimist. do "\nURBANopt des_run:\n \n" opt :model, "\nPath to Modelica model dir, possibly created with 'des_create' command in this CLI\n" \ 'Example: uo des_run --model path/to/model/dir', type: String, required: true opt :start_time, "\nStart time of the simulation (seconds of a year)\n", type: Integer, required: false, short: :a\ opt :stop_time, "\nStop time of the simulation (seconds of a year)\n", type: Integer, required: false, short: :z\ opt :step_size, "\nStep size of the simulation (seconds)\n", type: Integer, required: false, short: :x\ opt :interval, "\nNumber of intervals to divide the simulation into (alternative to step_size)\n", type: Integer, required: false, short: :i\ end end |
#opt_disco ⇒ Object
Define DISCO commands
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/uo_cli.rb', line 376 def opt_disco @subopts = Optimist. do "\nURBANopt disco:\n\n" opt :scenario, "\nRun DISCO simulations for <scenario>\n" \ "Requires --feature also be specified\n" \ 'Example: uo disco --scenario baseline_scenario-2.csv --feature example_project.json', default: 'baseline_scenario.csv', short: :s opt :feature, "\nRun DISCO simulations according to <featurefile>\n" \ "Requires --scenario also be specified\n" \ 'Example: uo disco --scenario baseline_scenario.csv --feature example_project.json', default: 'example_project_with_electric_network.json', short: :f opt :cost_database, "\nSpecify cost database for electric equipment upgrade\n" \ 'Example: uo disco --scenario baseline_scenario.csv --feature example_project.json --cost_database cost_database.xlsx', default: 'cost_database.xlsx', short: :c opt :technical_catalog, "\nSpecify technical catalog for thermal upgrade\n" \ 'Example: uo disco --scenario baseline_scenario.csv --feature example_project.json --technical_catalog technical_catalog.json', short: :t end end |
#opt_ghe_size ⇒ Object
600 601 602 603 604 605 606 607 608 609 610 611 612 613 |
# File 'lib/uo_cli.rb', line 600 def opt_ghe_size @subopts = Optimist. do "\nURBANopt ghe_size:\n \n" opt :sys_param, "Path to system parameters config file, possibly created with 'des_params' command in this CLI\n" \ "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 opt :scenario, "\nPath to the scenario CSV file\n" \ "Example: uo ghe_size --sys-param-file path/to/sys_params.json --scenario path/to/baseline_scenario.csv --feature path/to/example_project.json\n", type: String, required: true, short: :s opt :feature, "\nPath to the feature JSON file\n" \ "Example: uo ghe_size --sys-param-file path/to/sys_params.json --feature path/to/example_project.json\n", type: String, required: true, short: :f end end |
#opt_install_python ⇒ Object
Define commands to install python
281 282 283 284 285 286 287 288 289 290 |
# File 'lib/uo_cli.rb', line 281 def opt_install_python @subopts = Optimist. do "\nURBANopt install_python:\n \n" "Pre-installs and caches uv tool environments for dependency-groups in pyproject.toml\n" "Runtime commands (opendss/disco/des/ghe/usg) use uv tool run and may still resolve on demand\n" opt :verbose, "\nVerbose output\n" \ 'Example: uo install_python --verbose' end end |
#opt_opendss ⇒ Object
Define opendss commands
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
# File 'lib/uo_cli.rb', line 325 def opt_opendss @subopts = Optimist. do "\nURBANopt opendss:\n\n" opt :scenario, "\nRun OpenDSS simulations for <scenario>\n" \ "Requires --feature also be specified\n" \ 'Example: uo opendss --scenario baseline_scenario-2.csv --feature example_project.json', default: 'baseline_scenario.csv', short: :s opt :feature, "\nRun OpenDSS simulations according to <featurefile>\n" \ "Requires --scenario also be specified\n" \ 'Example: uo opendss --scenario baseline_scenario.csv --feature example_project.json', default: 'example_project_with_electric_network.json', short: :f opt :equipment, "\nRun OpenDSS simulations using <equipmentfile>. If not specified, the extended_catalog.json from urbanopt-ditto-reader will be used.\n" \ 'Example: uo opendss --scenario baseline_scenario.csv --feature example_project.json', type: String, short: :e opt :timestep, "\nNumber of minutes per timestep in the OpenDSS simulation.\n" \ "Optional, defaults to analog of simulation timestep set in the FeatureFile\n" \ 'Example: uo opendss --scenario baseline_scenario.csv --feature example_project.json --timestep 15', type: Integer, short: :t opt :start_date, "\nBeginning date for OpenDSS analysis specified in YYYY\\MM\\DD format. \n" \ "Optional, defaults to beginning of simulation date\n" \ 'Example: uo opendss --scenario baseline_scenario.csv --feature example_project.json --start-date 2017/01/15', type: String, short: :a opt :start_time, "\nBeginning time for OpenDSS analysis specified in hh:mm:ss format. \n" \ "Optional, defaults to 00:00:00 of start_date if specified, otherwise beginning of simulation time\n" \ "Example: uo opendss --scenario baseline_scenario.csv --feature example_project.json --start-time 01:00:00\n", type: String, short: :b opt :end_date, "\nEnd date for OpenDSS analysis specified in YYYY\\MM\\DD format.\n" \ "Optional, defaults to end of simulation date\n" \ 'Example: uo opendss --scenario baseline_scenario.csv --feature example_project.json --end-date 2017/01/16', type: String, short: :z opt :end_time, "\nEnd time for OpenDSS analysis specified in hh:mm:ss format. \n" \ "Optional, defaults to 23:00:00 of end_date if specified, otherwise end of simulation time is used. \n" \ "Example: uo opendss --scenario baseline_scenario.csv --feature example_project.json --end-time 01:00:00\n", type: String, short: :y opt :upgrade, "\nUpgrade undersized transformers\n" \ "Optional, defaults to false if not provided\n" \ 'Example: uo opendss --scenario baseline_scenario.csv --feature example_project.json --upgrade', short: :u opt :reopt, "\nRun with additional REopt functionality.\n" \ 'Example: uo opendss --scenario baseline_scenario.csv --feature example_project.json --reopt', short: :r opt :rnm, "\nUse RNM-generated DSS files in this analysis\n" \ 'Example: uo opendss --scenario baseline_scenario.csv --feature example_project.json --rnm', short: :m opt :config, "\nRun OpenDSS using a json config file to specify the above settings.\n" \ 'Example: uo opendss --config path/to/config.json', type: String, short: :c end end |
#opt_process ⇒ Object
Define post-processing commands
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'lib/uo_cli.rb', line 424 def opt_process @subopts = Optimist. do "\nURBANopt process:\n \n" opt :default, "\nStandard post-processing for your scenario", short: :d opt :opendss, "\nPost-process with OpenDSS", short: :o opt :disco, "\nPost-process with DISCO", short: :i opt :reopt_scenario, "\nOptimize for entire scenario with REopt. Used with the --reopt-scenario-assumptions-file to specify the assumptions to use.\n" \ 'Example: uo process --reopt-scenario', short: :r opt :reopt_feature, "\nOptimize for each building individually with REopt\n" \ 'Example: uo process --reopt-feature', short: :e opt :reopt_backup_power, "\nInclude output survivability reporting in REopt optimization\n" \ 'Example: uo process --reopt-scenario --reopt-backup-power or --reopt-feature --reopt-backup-power', short: :p opt :reopt_keep_existing, "\nKeep existing reopt feature optimizations instead of rerunning them to avoid rate limit issues.\n" \ 'Example: uo process --reopt-feature --reopt-keep-existing', short: :k opt :with_database, "\nInclude a sql database output of post-processed results\n" \ 'Example: uo process --default --with-database', short: :w opt :reopt_scenario_assumptions_file, "\nPath to the scenario REopt assumptions JSON file you want to use. Use with the --reopt-scenario post-processor.\n" \ 'If not specified, the reopt/multiPV_assumptions.json file will be used', type: String, short: :a opt :reopt_ghp, "\nAnalyze LCCA for GHP. This command is run with --reopt_ghp_assumptions_file (optional), --system_parameter (required), --modelica_model (required).", short: :t opt :reopt_ghp_assumptions_file, "\nPath to the GHP REopt assumptions JSON file you want to use. Use with the --reopt-ghp post-processor.\n" \ 'If not specified, the reopt_ghp/ghp_assumptions.json file will be used', type: String, short: :g opt :system_parameter, "\nSystem Parameter file used for GHP sizing analysis. This is a required argument for the REopt GHP LCCA Analysis.", default: 'system_parameter.json', short: :y opt :modelica_model, "\Path to GHP Modelica project dir created and run previously. This is a required argument for the REopt GHP LCCA Analysis.", default: 'modelica', short: :m opt :reopt_erp_assumptions_file, "\nPath to the scenario REopt ERP assumptions JSON file you want to use.\n" \ "This includes DER sizing and outage duration for REopt ERP capability.\n" \ "Use with the --reopt-scenario --reopt-backup-power --reopt-erp-assumptions-file post-processor or --reopt-feature --reopt-backup-power --reopt-erp-assumptions-file post-processor\n" \ 'If not specified, the reopt/erp_assumptions.json file will be used', type: String, short: :b opt :scenario, "\nSelect which scenario to optimize", default: 'baseline_scenario.csv', required: true, short: :s opt :feature, "\nSelect which FeatureFile to use", default: 'example_project.json', required: true, short: :f end end |
#opt_rnm ⇒ Object
Define RNM commands
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
# File 'lib/uo_cli.rb', line 397 def opt_rnm @subopts = Optimist. do "\nURBANopt rnm:\n\n" opt :scenario, "\nRun RNM simulation for <scenario>. Scenario must be run and post-processed prior to calling the rnm command.\n" \ "Requires --feature also be specified\n" \ 'Example: uo rnm --scenario baseline_scenario-2.csv --feature example_project.json', default: 'baseline_scenario.csv', required: true, short: :s opt :feature, "\nRun RNM simulation according to <featurefile>\n" \ "Requires --scenario also be specified\n" \ 'Example: uo rnm --scenario baseline_scenario.csv --feature example_project.json', default: 'example_project_with_streets.json', required: true, short: :f opt :reopt, "\nInclude processed REopt optimization results in the simulation.\n" \ 'Example: uo rnm --scenario baseline_scenario.csv --feature example_project.json --reopt', short: :r opt :extended_catalog, "\nUse this option to specify the extended electrical catalog path.\n" \ 'If this option is not included, the default catalog will be used', type: String, short: :c opt :average_peak_catalog, "\nUse this option to specify the average peak catalog path.\n" \ 'If this option is not included, the default catalog will be used', type: String, short: :a opt :opendss, "\n If this option is specified, an OpenDSS-compatible electrical database will be created \n" \ 'Example: uo rnm --scenario baseline_scenario.csv --feature example_project_with_streets.json --opendss', short: :o end end |
#opt_run ⇒ Object
Define running commands
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/uo_cli.rb', line 306 def opt_run @subopts = Optimist. do "\nURBANopt run:\n \n" opt :scenario, "\nRun URBANopt simulations for <scenario>\n" \ "Requires --feature also be specified\n" \ 'Example: uo run --scenario baseline_scenario-2.csv --feature example_project.json', default: 'baseline_scenario.csv', required: true, short: :s opt :feature, "\nRun URBANopt simulations according to <featurefile>\n" \ "Requires --scenario also be specified\n" \ 'Example: uo run --scenario baseline_scenario.csv --feature example_project.json', default: 'example_project.json', required: true, short: :f opt :num_parallel, "\nOPTIONAL: Run URBANopt simulations in parallel using <num_parallel> cores\n" \ "Adjusts value of 'num_parallel' in the 'runner.conf' file\n" \ "Example: uo run --num-parallel 2\n", type: Integer, short: :n end end |
#opt_update ⇒ Object
Update project
293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/uo_cli.rb', line 293 def opt_update @subopts = Optimist. do "\nURBANopt update:\n \n" opt :existing_project_folder, "\Specify existing project folder name to update files \n" \ 'Example: uo update --existing-project-folder urbanopt_example_project --new-project-directory path/to/new_urbanopt_example_project', type: String, short: :e opt :new_project_directory, "\Specify location for updated URBANopt project. \n" \ 'Example: uo update --existing-project-folder urbanopt_example_project --new-project-directory path/to/new_urbanopt_example_project', type: String, short: :n end end |
#opt_usg_complete ⇒ Object
518 519 520 521 522 523 524 525 526 |
# File 'lib/uo_cli.rb', line 518 def opt_usg_complete @subopts = Optimist. do "\nURBANopt usg_complete:\n \n" opt :feature, "\nProvide the Feature JSON file to include info about each feature\n", type: String, required: true, short: :f opt :input, "\nProvide the USG partial file CSV generated by the usg_preprocess step\n", type: String, required: true, short: :i opt :output, "\nProvide the desired path for the completed USG input CSV file. If this is not provided, the output file will match \ the input file with '_complete' appended to the end\n", type: String, required: false, short: :o end end |
#opt_usg_preprocess ⇒ Object
511 512 513 514 515 516 |
# File 'lib/uo_cli.rb', line 511 def opt_usg_preprocess @subopts = Optimist. do "\nURBANopt usg_preprocess:\n \n" opt :feature, "\nProvide the Feature JSON file to include info about each feature\n", type: String, required: true, short: :f end end |
#opt_validate ⇒ Object
Define validation commands
487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 |
# File 'lib/uo_cli.rb', line 487 def opt_validate @subopts = Optimist. do "\nURBANopt validate:\n \n" opt :eui, "\nCompare eui results in feature reports to limits in validation_schema.yaml\n" \ "Provide path to the validation_schema.yaml file in your project directory\n" \ 'Example: uo validate --eui validation_schema.yaml', type: String opt :scenario, "\nProvide the scenario CSV file to validate features from that scenario\n", type: String, required: true, short: :s opt :feature, "\nProvide the Feature JSON file to include info about each feature\n", type: String, required: true, short: :f opt :units, "\nSI (kWh/m2/yr) or IP (kBtu/ft2/yr)", type: String, default: 'IP' end end |
#opt_visualize ⇒ Object
Define visualization commands
472 473 474 475 476 477 478 479 480 481 482 483 484 |
# File 'lib/uo_cli.rb', line 472 def opt_visualize @subopts = Optimist. do "\nURBANopt visualize:\n \n" opt :feature, "\nVisualize results for all scenarios for a feature file\n" \ "Provide the FeatureFile to visualize each associated scenario\n" \ "Example: uo visualize --feature example_project.json\n", type: String, short: :f opt :scenario, "\nVisualize results for all features in a scenario\n" \ "Provide the scenario CSV file to visualize each feature in the scenario\n" \ "Example: uo visualize --scenario baseline_scenario.csv\n", type: String, short: :s end end |