Skip to content

Commit

Permalink
Update commands, paths, and example files for Reopt v3 (#463)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
vtnate and kflemin authored May 14, 2024
1 parent 95a3701 commit 1277359
Show file tree
Hide file tree
Showing 12 changed files with 654 additions and 691 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/nightly_ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,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,11 +33,30 @@ jobs:
image: docker://nrel/openstudio:3.7.0
steps:
- uses: actions/checkout@v4
# - name: Download and Install OpenStudio
# run: |
# wget -q https://github.com/NREL/OpenStudio/releases/download/v3.7.0/OpenStudio-3.7.0+d5269793f1-Ubuntu-22.04-x86_64.deb
# sudo apt install -y ./OpenStudio-3.7.0+d5269793f1-Ubuntu-22.04-x86_64.deb
# openstudio openstudio_version
# which openstudio
# echo "export RUBYLIB='/usr/local/openstudio-3.7.0/Ruby'" >> ~/.bashrc
# source ~/.bashrc
- 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: Setup upterm session
# uses: lhotari/action-upterm@v1
# with:
## limits ssh access and adds the ssh public key for the user which triggered the workflow
# limit-access-to-actor: true
## limits ssh access and adds the ssh public keys of the listed GitHub users
# limit-access-to-users: vtnate, kflemin
# ## If no one connects after 5 minutes, shut down server.
# wait-timeout-minutes: 5
- name: Install Ruby dependencies
run: |
which ruby
ruby --version
bundle update
bundle exec certified-update
Expand All @@ -53,10 +73,6 @@ jobs:
bundle exec rspec -e 'Update project directory'
- name: Test simulations
run: bundle exec rspec -e 'Run and work with a small ${{ matrix.simulation-type }} simulation'
- uses: montudor/action-zip@v1
if: failure()
with:
args: zip -qq -r artifact.zip spec/test_directory**/
- name: Upload artifacts
# Save results for examination - useful for debugging
uses: actions/upload-artifact@v3
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ gem 'parser', '3.2.2.2'
# if allow_local && File.exist?('../urbanopt-scenario-gem')
# gem 'urbanopt-scenario', path: '../urbanopt-scenario-gem'
# elsif allow_local
# gem 'urbanopt-scenario', github: 'URBANopt/urbanopt-scenario-gem', branch: 'develop'
# gem 'urbanopt-scenario', github: 'URBANopt/urbanopt-scenario-gem', branch: 'reopt-v3'
# end

# if allow_local && File.exist?('../urbanopt-geojson-gem')
Expand All @@ -40,13 +40,13 @@ 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: 'reopt-v3'
# 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: 'reopt-v3'
# end

#if allow_local && File.exist?('../urbanopt-rnm-us-gem')
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__)
2 changes: 1 addition & 1 deletion example_files/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
265 changes: 121 additions & 144 deletions example_files/reopt/base_assumptions.json
Original file line number Diff line number Diff line change
@@ -1,148 +1,125 @@
{
"Scenario": {
"off_grid_flag": false,
"Site": {
"renewable_electricity_min_pct": 0,
"renewable_electricity_max_pct": 1,
"Financial": {
"om_cost_escalation_pct": 0.025,
"escalation_pct": 0.023,
"offtaker_tax_pct": 0.26,
"offtaker_discount_pct": 0.083,
"analysis_years": 25,
"value_of_lost_load_us_dollars_per_kwh": 100,
"microgrid_upgrade_cost_pct": 0.3
},
"LoadProfile": {
"year": 2018,
"loads_kw_is_net": true,
"critical_loads_kw_is_net": false,
"critical_load_pct": 0.5,
"outage_is_major_event": true
},
"ElectricTariff": {
"add_blended_rates_to_urdb_rate": false,
"net_metering_limit_kw": 0,
"interconnection_limit_kw": 100000000.0,
"blended_monthly_demand_charges_us_dollars_per_kw": [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10],
"blended_monthly_rates_us_dollars_per_kwh": [0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
},
"Wind": {
"min_kw": 0,
"max_kw": 0,
"installed_cost_us_dollars_per_kw": 3013,
"om_cost_us_dollars_per_kw": 40,
"macrs_option_years": 5,
"macrs_bonus_pct": 1,
"macrs_itc_reduction": 0.5,
"federal_itc_pct": 0.26,
"state_ibi_pct": 0,
"state_ibi_max_us_dollars": 10000000000.0,
"utility_ibi_pct": 0,
"utility_ibi_max_us_dollars": 10000000000.0,
"federal_rebate_us_dollars_per_kw": 0,
"state_rebate_us_dollars_per_kw": 0,
"state_rebate_max_us_dollars": 10000000000.0,
"utility_rebate_us_dollars_per_kw": 0,
"utility_rebate_max_us_dollars": 10000000000.0,
"pbi_us_dollars_per_kwh": 0,
"pbi_max_us_dollars": 1000000000.0,
"pbi_years": 1,
"pbi_system_max_kw": 1000000000.0
},
"PV": {
"pv_name": "Roof - South Face",
"location":"roof",
"existing_kw": 0,
"min_kw": 0,
"max_kw": 1000000000.0,
"installed_cost_us_dollars_per_kw": 1600,
"om_cost_us_dollars_per_kw": 16,
"macrs_option_years": 5,
"macrs_bonus_pct": 1,
"macrs_itc_reduction": 0.5,
"federal_itc_pct": 0.26,
"state_ibi_pct": 0,
"state_ibi_max_us_dollars": 10000000000.0,
"utility_ibi_pct": 0,
"utility_ibi_max_us_dollars": 10000000000.0,
"federal_rebate_us_dollars_per_kw": 0,
"state_rebate_us_dollars_per_kw": 0,
"state_rebate_max_us_dollars": 10000000000.0,
"utility_rebate_us_dollars_per_kw": 0,
"utility_rebate_max_us_dollars": 10000000000.0,
"pbi_us_dollars_per_kwh": 0,
"pbi_max_us_dollars": 1000000000.0,
"pbi_years": 1,
"pbi_system_max_kw": 1000000000.0,
"degradation_pct": 0.005,
"azimuth": 180,
"losses": 0.14,
"array_type": 1,
"module_type": 0,
"gcr": 0.99,
"dc_ac_ratio": 1.2,
"inv_eff": 0.96,
"radius": 0,
"tilt": 0.537
},
"Storage": {
"min_kw": 0,
"max_kw": 1000000,
"min_kwh": 0,
"max_kwh": 1000000,
"internal_efficiency_pct": 0.975,
"inverter_efficiency_pct": 0.96,
"rectifier_efficiency_pct": 0.96,
"soc_min_pct": 0.2,
"soc_init_pct": 0.5,
"canGridCharge": true,
"installed_cost_us_dollars_per_kw": 840,
"installed_cost_us_dollars_per_kwh": 420,
"replace_cost_us_dollars_per_kw": 410,
"replace_cost_us_dollars_per_kwh": 200,
"inverter_replacement_year": 10,
"battery_replacement_year": 10,
"macrs_option_years": 7,
"macrs_bonus_pct": 1,
"macrs_itc_reduction": 0.5,
"total_itc_pct": 0.0,
"total_rebate_us_dollars_per_kw": 0
},
"Generator": {
"existing_kw": 0,
"min_kw": 0,
"max_kw": 1000000000.0,
"installed_cost_us_dollars_per_kw": 500,
"om_cost_us_dollars_per_kw": 10,
"om_cost_us_dollars_per_kwh": 0.0,
"diesel_fuel_cost_us_dollars_per_gallon": 3,
"fuel_slope_gal_per_kwh": 0.076,
"fuel_intercept_gal_per_hr": 0,
"fuel_avail_gal": 660,
"min_turn_down_pct": 0,
"generator_only_runs_during_grid_outage": true,
"generator_sells_energy_back_to_grid": false,
"macrs_option_years": 0,
"macrs_bonus_pct": 1,
"macrs_itc_reduction": 0,
"federal_itc_pct": 0,
"state_ibi_pct": 0,
"state_ibi_max_us_dollars": 0,
"utility_ibi_pct": 0,
"utility_ibi_max_us_dollars": 0,
"federal_rebate_us_dollars_per_kw": 0,
"state_rebate_us_dollars_per_kw": 0,
"state_rebate_max_us_dollars": 0,
"utility_rebate_us_dollars_per_kw": 0,
"utility_rebate_max_us_dollars": 0,
"pbi_us_dollars_per_kwh": 0,
"pbi_max_us_dollars": 0,
"pbi_years": 0,
"pbi_system_max_kw": 0
}
},
"Settings": {
"timeout_seconds": 295,
"time_steps_per_hour": 1
"time_steps_per_hour": 1,
"off_grid_flag": false
},
"Site": {
"roof_squarefeet": null,
"renewable_electricity_min_fraction": 0,
"renewable_electricity_max_fraction": 1
},
"Financial": {
"elec_cost_escalation_rate_fraction": 0.026,
"offtaker_discount_rate_fraction": 0.081,
"value_of_lost_load_per_kwh": 100.0,
"analysis_years": 20,
"microgrid_upgrade_cost_fraction": 0.3,
"offtaker_tax_rate_fraction": 0.26,
"om_cost_escalation_rate_fraction": 0.025
},
"ElectricTariff": {
"add_monthly_rates_to_urdb_rate": false,
"urdb_label": "63d2f36655296095a0092a6e"
},
"ElectricUtility": {
"interconnection_limit_kw": 100000000.0,
"net_metering_limit_kw": 0.0
},
"ElectricLoad": {
"critical_loads_kw_is_net": false,
"critical_load_fraction": 0,
"loads_kw_is_net": true
},
"PV": {
"name": "Roof - South Face",
"production_incentive_years": 1.0,
"location":"roof",
"macrs_bonus_fraction": 0.0,
"max_kw": 1000000000.0,
"production_incentive_max_benefit": 1000000000.0,
"radius": 0.0,
"state_ibi_fraction": 0.0,
"utility_rebate_max": 10000000000.0,
"installed_cost_per_kw": 2000.0,
"utility_ibi_max": 10000000000.0,
"tilt": 10.0,
"federal_rebate_per_kw": 0.0,
"gcr": 0.4,
"production_incentive_max_kw": 1000000000.0,
"utility_ibi_fraction": 0.0,
"state_ibi_max": 10000000000.0,
"state_rebate_per_kw": 0.0,
"macrs_option_years": 5,
"state_rebate_max": 10000000000.0,
"dc_ac_ratio": 1.1,
"federal_itc_fraction": 0.3,
"production_incentive_per_kwh": 0.0,
"module_type": 0,
"array_type": 1,
"existing_kw": 0.0,
"om_cost_per_kw": 16.0,
"utility_rebate_per_kw": 0.0,
"min_kw": 0.0,
"losses": 0.14,
"macrs_itc_reduction": 0.5,
"degradation_fraction": 0.005,
"inv_eff": 0.96,
"azimuth": 180.0
},
"Generator": {
"production_incentive_years": 0.0,
"macrs_bonus_fraction": 0.0,
"om_cost_per_kwh": 20.0,
"max_kw": 1000000000.0,
"production_incentive_max_benefit": 0.0,
"state_ibi_fraction": 0.0,
"fuel_intercept_gal_per_hr": 0.0125,
"generator_only_runs_during_grid_outage": true,
"state_rebate_per_kw": 0.0,
"installed_cost_per_kw": 2500.0,
"utility_ibi_max": 0.0,
"fuel_avail_gal": 0.0,
"min_turn_down_fraction": 0.3,
"production_incentive_max_kw": 0.0,
"utility_ibi_fraction": 0.0,
"state_ibi_max": 0.0,
"fuel_cost_per_gallon": 20.0,
"fuel_slope_gal_per_kwh": 0.068,
"utility_rebate_max": 0.0,
"macrs_option_years": 0,
"state_rebate_max": 0.0,
"federal_itc_fraction": 0.0,
"existing_kw": 0.0,
"production_incentive_per_kwh": 0.0,
"om_cost_per_kw": 50.0,
"utility_rebate_per_kw": 0.0,
"min_kw": 0.0,
"macrs_itc_reduction": 0.0,
"federal_rebate_per_kw": 0.0,
"generator_sells_energy_back_to_grid": false
},
"Storage": {
"max_kwh": 1000000.0,
"rectifier_efficiency_fraction": 0.96,
"total_itc_fraction": 0.0,
"min_kw": 0.0,
"max_kw": 1000000.0,
"replace_cost_per_kw": 460.0,
"replace_cost_per_kwh": 230.0,
"min_kwh": 0.0,
"installed_cost_per_kw": 1000.0,
"total_rebate_per_kw": 0,
"installed_cost_per_kwh": 500.0,
"inverter_efficiency_fraction": 0.96,
"macrs_itc_reduction": 0.5,
"canGridCharge": true,
"macrs_bonus_fraction": 0.0,
"battery_replacement_year": 10,
"macrs_option_years": 7,
"internal_efficiency_fraction": 0.975,
"soc_min_fraction": 0.2,
"soc_init_fraction": 0.5,
"inverter_replacement_year": 10
}
}
Loading

0 comments on commit 1277359

Please sign in to comment.