Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
518d950
Updated model with outputs for testing
rathod-b Sep 29, 2025
ea88d75
Update julia version and make migrations
rathod-b Sep 30, 2025
08a9ccf
Remove migration 0093 and add billed energy rate field
rathod-b Oct 2, 2025
f5b352c
Merge remote-tracking branch 'origin/develop' into add-elec-tariff-costs
rathod-b Oct 2, 2025
39c7b2b
Add new electric load and tariff output fields
rathod-b Oct 8, 2025
a8dcb7b
Added custom ANCCR table draft
gellwood Oct 10, 2025
8495639
Add URDB fields to ElectricTariffOutputs model
rathod-b Oct 16, 2025
4b3078a
Created custom table for ANCCR results
gellwood Oct 21, 2025
ca18389
Merge branch 'develop' into add-elec-tariff-costs
Bill-Becker Oct 22, 2025
aebd41f
Update REopt#elec_util_usage after develop merge
Bill-Becker Oct 22, 2025
a7fdea9
Migration --merge after merging develop
Bill-Becker Oct 22, 2025
19d2bb2
Move urdb_metadata into ElectricTariffInputs and group into single js…
Bill-Becker Oct 22, 2025
b2a3b6b
Rename export types to whole words
Bill-Becker Oct 22, 2025
1a3e4fd
Update ElectricTariffInputs urdb_metadata from Julia in process_results
Bill-Becker Oct 22, 2025
242dede
Avoid error handling breakdown if ElectricTariff is not present, and …
Bill-Becker Oct 23, 2025
8260d01
Update to latest REopt#elec_util_usage
Bill-Becker Oct 23, 2025
60d90fe
Reduce complexity of long-solving sector defaults test
Bill-Becker Oct 23, 2025
6b5099b
Update ANCCR table config to use outputs.* keys and add new fields
gellwood Oct 23, 2025
6cadf5b
Make output.ElectricLoad.monthly_peak_kw consistent with upcoming new…
Bill-Becker Oct 23, 2025
08f8e1e
Update REopt#elec_util_usage for updated monthly_peaks_kw name
Bill-Becker Oct 24, 2025
7ae4e34
Merge branch 'add-elec-tariff-costs' into anccr-tables
Bill-Becker Oct 24, 2025
dd1ea7b
Merge branch 'anccr-tables' of https://github.com/NREL/REopt_API into…
Bill-Becker Oct 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion julia_src/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,9 @@ version = "1.11.0"

[[deps.REopt]]
deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"]
git-tree-sha1 = "103761fa0f7447377726347af656cde6ab1160cc"
git-tree-sha1 = "277df4545cd30a5fc227bf982897ef65d5ea3520"
repo-rev = "elec_util_usage"
repo-url = "https://github.com/NREL/REopt.jl.git"
uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6"
version = "0.55.1"

Expand Down
18 changes: 17 additions & 1 deletion julia_src/http.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ function reopt(req::HTTP.Request)
# Catch handled/unhandled exceptions in data pre-processing, JuMP setup
try
model_inputs = reoptjl.REoptInputs(d)
@info "Successfully processed REopt inputs."
catch e
@error "Something went wrong during REopt inputs processing!" exception=(e, catch_backtrace())
error_response["error"] = sprint(showerror, e)
Expand All @@ -102,6 +103,7 @@ function reopt(req::HTTP.Request)
# Catch handled/unhandled exceptions in optimization
try
results = reoptjl.run_reopt(ms, model_inputs)
@info "Successfully ran REopt optimization."
inputs_with_defaults_from_julia_financial = [
:NOx_grid_cost_per_tonne, :SO2_grid_cost_per_tonne, :PM25_grid_cost_per_tonne,
:NOx_onsite_fuelburn_cost_per_tonne, :SO2_onsite_fuelburn_cost_per_tonne, :PM25_onsite_fuelburn_cost_per_tonne,
Expand Down Expand Up @@ -235,6 +237,14 @@ function reopt(req::HTTP.Request)
high_temp_storage_dict = Dict(key=>getfield(model_inputs.s.storage.attr["HighTempThermalStorage"], key) for key in inputs_with_defaults_from_julia_high_temp_storage)
else
high_temp_storage_dict = Dict()
end
if haskey(d, "ElectricTariff") && !isempty(model_inputs.s.electric_tariff.urdb_metadata)
inputs_from_julia_electric_tariff = [
:urdb_metadata
]
electric_tariff_dict = Dict(key=>getfield(model_inputs.s.electric_tariff, key) for key in inputs_from_julia_electric_tariff)
else
electric_tariff_dict = Dict()
end
inputs_with_defaults_set_in_julia = Dict(
"Financial" => Dict(key=>getfield(model_inputs.s.financial, key) for key in inputs_with_defaults_from_julia_financial),
Expand All @@ -251,7 +261,8 @@ function reopt(req::HTTP.Request)
"ElectricStorage" => electric_storage_dict,
"ColdThermalStorage" => cold_storage_dict,
"HotThermalStorage" => hot_storage_dict,
"HighTempThermalStorage" => high_temp_storage_dict
"HighTempThermalStorage" => high_temp_storage_dict,
"ElectricTariff" => electric_tariff_dict
)
catch e
@error "Something went wrong in REopt optimization!" exception=(e, catch_backtrace())
Expand All @@ -272,6 +283,11 @@ function reopt(req::HTTP.Request)

if isempty(error_response)
@info "REopt model solved with status $(results["status"])."
# These are matrices that need to be vector.
if haskey(results, "ElectricTariff")
results["ElectricTariff"]["year_one_electric_to_load_energy_cost_series_before_tax"] = results["ElectricTariff"]["year_one_electric_to_load_energy_cost_series_before_tax"][:,1]
results["ElectricTariff"]["monthly_facility_demand_cost_series_before_tax"] = results["ElectricTariff"]["monthly_facility_demand_cost_series_before_tax"][:,1]
end
response = Dict(
"results" => results,
"reopt_version" => string(pkgversion(reoptjl))
Expand Down
Loading