Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 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
c5238ca
Update http.jl
adfarth Oct 23, 2025
1393f17
add the input
adfarth Oct 23, 2025
b77bdcb
add to test posts
adfarth Oct 23, 2025
12a359c
Create 0110_electricloadinputs_monthly_peaks_kw_and_more.py
adfarth Oct 23, 2025
5a42add
Update http.jl
adfarth 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
6611829
Updates to anccr tables config and helpers
Bill-Becker Oct 24, 2025
df4f358
Squash migrations for new ElectricTariff Inputs/Outputs
Bill-Becker Oct 24, 2025
0b766c8
Update REopt#peak-scaling branch for sim_load output names
Bill-Becker Oct 24, 2025
8243d34
Type conversions for simulated_load to be more specific, from Real to…
Bill-Becker Oct 24, 2025
54696b2
Add time_steps_per_hour input to simulated_load for non-hourly scaling
Bill-Becker Oct 24, 2025
ab29dec
Merge branch 'scale-peak-loads' into anccr
Bill-Becker Oct 24, 2025
fcab6dc
Merge migrations after merging scale-peak-loads
Bill-Becker Oct 24, 2025
127401b
Remove excessive outputs for ElectricTariff export rates/costs, squas…
Bill-Becker Oct 24, 2025
4fe1938
Change REopt.jl back to #anccr
Bill-Becker Oct 24, 2025
08285f9
Update REopt#anccr branch with 15-min scaling fix
Bill-Becker Oct 26, 2025
18cadd7
ElectricTariffOuputs Updates
Bill-Becker Oct 28, 2025
52f9d75
Update squashed migration after ElectricTariffOutputs refactor
Bill-Becker Oct 28, 2025
34528ce
Update REopt#anccr after ElectricTariff results refactor
Bill-Becker Oct 28, 2025
cf4e1e9
Update REopt#anccr after get_load_metrics() finalize and export
Bill-Becker Oct 29, 2025
5065172
Add new /get_load_metrics endpoint
Bill-Becker Oct 29, 2025
bd4907c
Update CHANGELOG under the anccr branch heading
Bill-Becker Oct 29, 2025
c54f8b8
Update ANCCR spreadsheet config to fix demand charges
Bill-Becker Oct 29, 2025
d3365c0
Enable POST for doe_reference_name input to /simulated_load
Bill-Becker Oct 31, 2025
169eedf
Fix rounding for non-electric load_type
Bill-Becker Oct 31, 2025
713a6a7
Update REopt.jl to develop branch
Bill-Becker Nov 6, 2025
b79beeb
Merge branch 'develop' into anccr
Bill-Becker Nov 6, 2025
d7a79e6
Update ANCCR table config and add new calculations
gellwood Nov 7, 2025
93deef9
Update ANCCR table logic and Excel export headers
gellwood Nov 7, 2025
e566415
Update REopt to v0.56.0
Bill-Becker Nov 12, 2025
556de36
Update monthly_fixed_cost name and re-squash migrations
Bill-Becker Nov 12, 2025
d154074
Replace 'anccr' with 'rates' to be more generic
Bill-Becker Nov 12, 2025
d20186c
Update reoptjl/views.py for syntax
Bill-Becker Nov 12, 2025
88f695c
Update reoptjl/views.py for Error syntax
Bill-Becker Nov 12, 2025
dfb0b3d
Update reoptjl/views.py for Error syntax 3
Bill-Becker Nov 12, 2025
6b0435a
Make comment accurate with functionality
Bill-Becker Nov 12, 2025
2192f7c
Remove comment about asking Bhavesh
Bill-Becker Nov 12, 2025
9952837
Update rounding comments
Bill-Becker Nov 12, 2025
2c89f29
Remove BAU columns from custom_table_rates
Bill-Becker Nov 12, 2025
2875a7e
Wrap text for all cells; do not include instructions tab for custom_t…
Bill-Becker Nov 12, 2025
1466582
Updated comments for BAU columns for rate table
gellwood Nov 13, 2025
bcfd5c2
Convert type of monthly_peaks_load to avoid Any[] parse
Bill-Becker Nov 18, 2025
812e15f
Update REopt.jl to v0.56.1
Bill-Becker Nov 18, 2025
2e8a043
Revert "Convert type of monthly_peaks_load to avoid Any[] parse"
Bill-Becker Nov 18, 2025
ee1d57b
Reapply "Convert type of monthly_peaks_load to avoid Any[] parse"
Bill-Becker Nov 18, 2025
76a114c
Bump REopt.jl version to 0.56.2
Bill-Becker Nov 19, 2025
c8ec874
Finalize CHANGELOG for new version
Bill-Becker Nov 19, 2025
85e37f6
Revert "Reapply "Convert type of monthly_peaks_load to avoid Any[] pa…
Bill-Becker Nov 19, 2025
30a9538
Merge pull request #681 from NREL/anccr
Bill-Becker Nov 19, 2025
a851919
Apply suggestions from code review
Bill-Becker Nov 19, 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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ Classify the change according to the following categories:
##### Removed
### Patches

## v3.17.0
### Minor Updates
##### Added
- `ElectricLoad` input `monthly_peaks_kw`. Can be used to scale loads_kw or doe_reference loads to monthly peaks while maintaining monthly energy.
- `ElectricTariff` outputs: `demand_rate_average_series`, `energy_cost_series_before_tax`, `energy_cost_series_before_tax_bau`, `energy_rate_average_series`, `energy_rate_series`, `energy_rate_tier_limits`, `facility_demand_monthly_rate_series`, `facility_demand_monthly_rate_tier_limits`, `monthly_demand_cost_series_before_tax`, `monthly_demand_cost_series_before_tax_bau`, `monthly_energy_cost_series_before_tax`, `monthly_energy_cost_series_before_tax_bau`, `monthly_facility_demand_cost_series_before_tax`, `monthly_facility_demand_cost_series_before_tax_bau`, `monthly_fixed_cost_series_before_tax`, `monthly_fixed_cost_series_before_tax_bau`, `monthly_tou_demand_cost_series_before_tax`, `monthly_tou_demand_cost_series_before_tax_bau`, `tou_demand_metrics`, `tou_demand_rate_series`, `tou_demand_rate_tier_limits`.
- New endpoint `/get_load_metrics` for sending a timeseries `load_profile` and getting monthly and annual energy and peak loads.
- New custom table option `custom_table_rates` for endpoint `/job/generate_results_table`.
##### Fixed
- Avoid `CST` bypassing non-servable heating loads by going through the `HighTempThermalStorage`.


## v3.16.2
### Patches
- Added `CST` and `HighTempThermalStorage` to all/superset inputs test.
Expand Down
4 changes: 2 additions & 2 deletions julia_src/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -948,9 +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 = "00bb39c8f932a3320960f01adc139229c24e12b7"
uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6"
version = "0.55.1"
version = "0.56.2"

[[deps.Random]]
deps = ["SHA"]
Expand Down
51 changes: 46 additions & 5 deletions 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 Down Expand Up @@ -544,18 +555,18 @@ function simulated_load(req::HTTP.Request)
end

# Convert vectors which come in as Vector{Any} to Vector{Float} (within Vector{<:Real})
vector_types = ["percent_share", "cooling_pct_share", "monthly_totals_kwh", "monthly_mmbtu",
vector_types = ["percent_share", "cooling_pct_share", "monthly_totals_kwh", "monthly_peaks_kw", "monthly_mmbtu",
"monthly_tonhour", "monthly_fraction", "addressable_load_fraction", "load_profile"]
for key in vector_types
if key in keys(d) && typeof(d[key]) <: Vector{}
d[key] = convert(Vector{Real}, d[key])
d[key] = convert(Vector{Float64}, d[key])
elseif key in keys(d) && key == "addressable_load_fraction"
# Scalar version of input, convert Any to Real
d[key] = convert(Real, d[key])
d[key] = convert(Float64, d[key])
end
end

@info "Getting CRB Loads..."
@info "Getting Loads..."
data = Dict()
error_response = Dict()
try
Expand All @@ -574,6 +585,35 @@ function simulated_load(req::HTTP.Request)
end
end

function get_load_metrics(req::HTTP.Request)
d = JSON.parse(String(req.body))

# Convert load_profile from Vector{Any} to Vector{Float64}
if "load_profile" in keys(d) && typeof(d["load_profile"]) <: Vector{}
d["load_profile"] = convert(Vector{Float64}, d["load_profile"])
end

@info "Getting load metrics..."
data = Dict()
error_response = Dict()
try
load_profile = pop!(d, "load_profile")
other_kwargs = reoptjl.dictkeys_tosymbols(d)
data = reoptjl.get_load_metrics(load_profile; other_kwargs...)
catch e
@error "Something went wrong in the get_load_metrics" exception=(e, catch_backtrace())
error_response["error"] = sprint(showerror, e)
end
if isempty(error_response)
@info "Load metrics determined."
response = data
return HTTP.Response(200, JSON.json(response))
else
@info "An error occured in the get_load_metrics endpoint"
return HTTP.Response(500, JSON.json(error_response))
end
end

function ghp_efficiency_thermal_factors(req::HTTP.Request)
d = JSON.parse(String(req.body))

Expand Down Expand Up @@ -779,4 +819,5 @@ HTTP.register!(ROUTER, "GET", "/health", health)
HTTP.register!(ROUTER, "GET", "/get_existing_chiller_default_cop", get_existing_chiller_default_cop)
HTTP.register!(ROUTER, "GET", "/get_ashp_defaults", get_ashp_defaults)
HTTP.register!(ROUTER, "GET", "/pv_cost_defaults", pv_cost_defaults)
HTTP.register!(ROUTER, "GET", "/get_load_metrics", get_load_metrics)
HTTP.serve(ROUTER, "0.0.0.0", 8081, reuseaddr=true)
Loading