Skip to content

Commit e86b0af

Browse files
author
adfarth
authored
Merge pull request #629 from NREL/develop
REopt_API v3.12.0 using REopt.jl v0.51.0
2 parents c22470a + ed8cbeb commit e86b0af

18 files changed

Lines changed: 452 additions & 102 deletions

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,32 @@ Classify the change according to the following categories:
2626
##### Removed
2727
### Patches
2828

29+
## v3.12.0
30+
### Major Updates
31+
### Added
32+
- Add inputs:
33+
- **ElectricUtility.cambium_cef_metric** to utilize clean energy data from NREL's Cambium database
34+
- **ElectricUtility.renewable_energy_fraction_series** to supply a custom grid clean or renewable energy scalar or series
35+
- **Site.include_grid_renewable_fraction_in_RE_constraints** - to allow user to choose whether to include grid RE in min max constraints
36+
- **ElectricStorage.optimize_soc_init_fraction** (defaults to false), which makes the optimization choose the inital SOC (equal to final SOC) instead of using soc_init_fraction. The initial SOC is also constrained to equal the final SOC, which eliminates the "free energy" issue. We currently do not fix SOC when soc_init_fraction is used because this has caused infeasibility.
37+
- **ElectricStorage.min_duration_hours** and **ElectricStorage.max_duration_hours** for limitting electric storage's energy capacity relative to its power capacity
38+
- Add the following outputs:
39+
- **ElectricUtility.annual_renewable_electricity_supplied_kwh**
40+
- **Site.onsite_and_grid_renewable_electricity_fraction_of_elec_load**
41+
- **Site.onsite_and_grid_renewable_energy_fraction_of_total_load**
42+
- **ElectricLoad.annual_electric_load_with_thermal_conversions_kwh**
43+
### Changed
44+
- Change name of the following inputs:
45+
- **ElectricUtility.cambium_metric_col** changed to **ElectricUtility.cambium_co2_metric**, to distinguish between the CO2 and clean energy fraction metrics
46+
- Change name of the following outputs:
47+
- **ElectricUtility.cambium_emissions_region** changed to **ElectricUtility.cambium_region**
48+
- **Site.annual_renewable_electricity_kwh** changed to **Site.annual_onsite_renewable_electricity_kwh**
49+
- **Site.renewable_electricity_fraction** changed to **Site.onsite_renewable_electricity_fraction_of_elec_load**
50+
- **Site.total_renewable_energy_fraction** changed to **Site.onsite_renewable_energy_fraction_of_total_load**
51+
- Change v3 endpoint `cambium_emissions_profile` to `cambium_profile`
52+
- Change to using REopt.jl v0.51.0, which includes updates to the Cambium, AVERT, and eGRID data used
53+
54+
2955
## v3.11.0
3056
### Minor Updates
3157
##### Changed

julia_src/Manifest.toml

Lines changed: 46 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,24 @@ version = "1.5.0"
2525
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2626

2727
[[deps.Accessors]]
28-
deps = ["CompositionsBase", "ConstructionBase", "InverseFunctions", "LinearAlgebra", "MacroTools", "Markdown"]
29-
git-tree-sha1 = "96bed9b1b57cf750cca50c311a197e306816a1cc"
28+
deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "MacroTools"]
29+
git-tree-sha1 = "3b86719127f50670efe356bc11073d84b4ed7a5d"
3030
uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
31-
version = "0.1.39"
31+
version = "0.1.42"
3232

3333
[deps.Accessors.extensions]
34-
AccessorsAxisKeysExt = "AxisKeys"
35-
AccessorsDatesExt = "Dates"
36-
AccessorsIntervalSetsExt = "IntervalSets"
37-
AccessorsStaticArraysExt = "StaticArrays"
38-
AccessorsStructArraysExt = "StructArrays"
39-
AccessorsTestExt = "Test"
40-
AccessorsUnitfulExt = "Unitful"
34+
AxisKeysExt = "AxisKeys"
35+
IntervalSetsExt = "IntervalSets"
36+
LinearAlgebraExt = "LinearAlgebra"
37+
StaticArraysExt = "StaticArrays"
38+
StructArraysExt = "StructArrays"
39+
TestExt = "Test"
40+
UnitfulExt = "Unitful"
4141

4242
[deps.Accessors.weakdeps]
4343
AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5"
44-
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
4544
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
46-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
45+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
4746
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
4847
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
4948
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
@@ -90,9 +89,9 @@ version = "0.7.3"
9089

9190
[[deps.Blosc_jll]]
9291
deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Zlib_jll", "Zstd_jll"]
93-
git-tree-sha1 = "c5acdf7065862659dd4245494c40c90a66308651"
92+
git-tree-sha1 = "ef12cdd1c7fb7e1dfd6fa8fd60d4db6bc61d2f23"
9493
uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9"
95-
version = "1.21.6+1"
94+
version = "1.21.6+2"
9695

9796
[[deps.Bzip2_jll]]
9897
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
@@ -235,9 +234,9 @@ version = "0.1.0"
235234

236235
[[deps.CoolProp_jll]]
237236
deps = ["Artifacts", "JLLWrappers", "Libdl"]
238-
git-tree-sha1 = "f0f70a17d132d2ab5bf2b61993db36ac1099f6c7"
237+
git-tree-sha1 = "61b41db28afff106497638ae6807949f30d9e61e"
239238
uuid = "3351c21f-4feb-5f29-afb9-f4fcb0e27549"
240-
version = "6.6.0+0"
239+
version = "6.7.0+0"
241240

242241
[[deps.Crayons]]
243242
git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
@@ -319,14 +318,14 @@ version = "0.1.11"
319318

320319
[[deps.Expat_jll]]
321320
deps = ["Artifacts", "JLLWrappers", "Libdl"]
322-
git-tree-sha1 = "f42a5b1e20e009a43c3646635ed81a9fcaccb287"
321+
git-tree-sha1 = "d55dffd9ae73ff72f1c0482454dcf2ec6c6c4a63"
323322
uuid = "2e619515-83b5-522b-bb60-26c02a35a201"
324-
version = "2.6.4+2"
323+
version = "2.6.5+0"
325324

326325
[[deps.Extents]]
327-
git-tree-sha1 = "81023caa0021a41712685887db1fc03db26f41f5"
326+
git-tree-sha1 = "063512a13dbe9c40d999c439268539aa552d1ae6"
328327
uuid = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
329-
version = "0.1.4"
328+
version = "0.1.5"
330329

331330
[[deps.FileIO]]
332331
deps = ["Pkg", "Requires", "UUIDs"]
@@ -340,9 +339,9 @@ weakdeps = ["HTTP"]
340339

341340
[[deps.FilePathsBase]]
342341
deps = ["Compat", "Dates"]
343-
git-tree-sha1 = "7878ff7172a8e6beedd1dea14bd27c3c6340d361"
342+
git-tree-sha1 = "2ec417fc319faa2d768621085cc1feebbdee686b"
344343
uuid = "48062228-2e41-5def-b9a4-89aafe57970f"
345-
version = "0.9.22"
344+
version = "0.9.23"
346345
weakdeps = ["Mmap", "Test"]
347346

348347
[deps.FilePathsBase.extensions]
@@ -398,15 +397,15 @@ uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d"
398397
version = "6.2.1+6"
399398

400399
[[deps.GeoFormatTypes]]
401-
git-tree-sha1 = "59107c179a586f0fe667024c5eb7033e81333271"
400+
git-tree-sha1 = "8e233d5167e63d708d41f87597433f59a0f213fe"
402401
uuid = "68eda718-8dee-11e9-39e7-89f7f65f511f"
403-
version = "0.4.2"
402+
version = "0.4.4"
404403

405404
[[deps.GeoInterface]]
406405
deps = ["DataAPI", "Extents", "GeoFormatTypes"]
407-
git-tree-sha1 = "f4ee66b6b1872a4ca53303fbb51d158af1bf88d4"
406+
git-tree-sha1 = "294e99f19869d0b0cb71aef92f19d03649d028d5"
408407
uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
409-
version = "1.4.0"
408+
version = "1.4.1"
410409

411410
[[deps.GeoInterfaceRecipes]]
412411
deps = ["GeoInterface", "RecipesBase"]
@@ -446,10 +445,10 @@ version = "0.17.2"
446445
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
447446

448447
[[deps.HDF5_jll]]
449-
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "LazyArtifacts", "LibCURL_jll", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "OpenSSL_jll", "TOML", "Zlib_jll", "libaec_jll"]
450-
git-tree-sha1 = "38c8874692d48d5440d5752d6c74b0c6b0b60739"
448+
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "LibCURL_jll", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "OpenSSL_jll", "TOML", "Zlib_jll", "libaec_jll"]
449+
git-tree-sha1 = "87bd95f99219dc3b86d4ee11a9a7bfa6075000a9"
451450
uuid = "0234f1f7-429e-5d53-9886-15a909be8d59"
452-
version = "1.14.2+1"
451+
version = "1.14.5+0"
453452

454453
[[deps.HTTP]]
455454
deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"]
@@ -482,9 +481,9 @@ uuid = "a09fc81d-aa75-5fe9-8630-4744c3626534"
482481
version = "0.9.4"
483482

484483
[[deps.InlineStrings]]
485-
git-tree-sha1 = "45521d31238e87ee9f9732561bfee12d4eebd52d"
484+
git-tree-sha1 = "6a9fde685a7ac1eb3495f8e812c5a7c3711c2d5e"
486485
uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
487-
version = "1.4.2"
486+
version = "1.4.3"
488487

489488
[deps.InlineStrings.extensions]
490489
ArrowTypesExt = "ArrowTypes"
@@ -587,12 +586,6 @@ git-tree-sha1 = "bf36f528eec6634efc60d7ec062008f171071434"
587586
uuid = "88015f11-f218-50d7-93a8-a6af411a945d"
588587
version = "3.0.0+1"
589588

590-
[[deps.LLVMOpenMP_jll]]
591-
deps = ["Artifacts", "JLLWrappers", "Libdl"]
592-
git-tree-sha1 = "78211fb6cbc872f77cad3fc0b6cf647d923f4929"
593-
uuid = "1d63c593-3942-5779-bab2-d838dc0a180e"
594-
version = "18.1.7+0"
595-
596589
[[deps.LRUCache]]
597590
git-tree-sha1 = "b3cc6698599b10e652832c2f23db3cab99d51b59"
598591
uuid = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637"
@@ -687,9 +680,9 @@ version = "1.1.0"
687680

688681
[[deps.Lz4_jll]]
689682
deps = ["Artifacts", "JLLWrappers", "Libdl"]
690-
git-tree-sha1 = "dbd00758ab9d8f454b2feadb6071eb50af62c824"
683+
git-tree-sha1 = "191686b1ac1ea9c89fc52e996ad15d1d241d1e33"
691684
uuid = "5ced341a-0733-55b8-9ab6-a4889d929147"
692-
version = "1.10.0+2"
685+
version = "1.10.1+0"
693686

694687
[[deps.METIS_jll]]
695688
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
@@ -711,9 +704,9 @@ version = "0.1.11"
711704

712705
[[deps.MPItrampoline_jll]]
713706
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"]
714-
git-tree-sha1 = "4e6c1eb421039b0d26e0fd483fa87651da0f3f57"
707+
git-tree-sha1 = "97aac4a518b6f01851f8821272780e1ba56fe90d"
715708
uuid = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748"
716-
version = "5.5.1+1"
709+
version = "5.5.2+0"
717710

718711
[[deps.MUMPS_seq_jll]]
719712
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"]
@@ -929,9 +922,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
929922

930923
[[deps.REopt]]
931924
deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"]
932-
git-tree-sha1 = "324394f21cb7e2db3d9e7ebde19c4e83c5a64e0f"
925+
git-tree-sha1 = "24f902b6f67ed1d4389d21b5d42f820036b182b4"
933926
uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6"
934-
version = "0.50.0"
927+
version = "0.51.0"
935928

936929
[[deps.Random]]
937930
deps = ["SHA"]
@@ -967,9 +960,9 @@ version = "1.3.0"
967960

968961
[[deps.Roots]]
969962
deps = ["Accessors", "CommonSolve", "Printf"]
970-
git-tree-sha1 = "8e3694d669323cdfb560e344dc872b984de23b71"
963+
git-tree-sha1 = "e52cf0872526c7a0b3e1af9c58a69b90e19b022e"
971964
uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
972-
version = "2.2.2"
965+
version = "2.2.5"
973966

974967
[deps.Roots.extensions]
975968
RootsChainRulesCoreExt = "ChainRulesCore"
@@ -1083,9 +1076,9 @@ version = "1.10.0"
10831076

10841077
[[deps.StringManipulation]]
10851078
deps = ["PrecompileTools"]
1086-
git-tree-sha1 = "a6b1675a536c5ad1a60e5a5153e1fee12eb146e3"
1079+
git-tree-sha1 = "725421ae8e530ec29bcbdddbe91ff8053421d023"
10871080
uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e"
1088-
version = "0.4.0"
1081+
version = "0.4.1"
10891082

10901083
[[deps.SuiteSparse_jll]]
10911084
deps = ["Artifacts", "Libdl", "libblastrampoline_jll"]
@@ -1149,9 +1142,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
11491142

11501143
[[deps.Unitful]]
11511144
deps = ["Dates", "LinearAlgebra", "Random"]
1152-
git-tree-sha1 = "01915bfcd62be15329c9a07235447a89d588327c"
1145+
git-tree-sha1 = "c0667a8e676c53d390a09dc6870b3d8d6650e2bf"
11531146
uuid = "1986cc42-f94f-5a68-af5c-568840ba703d"
1154-
version = "1.21.1"
1147+
version = "1.22.0"
11551148
weakdeps = ["ConstructionBase", "InverseFunctions"]
11561149

11571150
[deps.Unitful.extensions]
@@ -1200,9 +1193,9 @@ version = "1.76.0+1"
12001193

12011194
[[deps.libaec_jll]]
12021195
deps = ["Artifacts", "JLLWrappers", "Libdl"]
1203-
git-tree-sha1 = "648c439c8643710976b4c8b30dccbbe6439fb4db"
1196+
git-tree-sha1 = "f5733a5a9047722470b95a81e1b172383971105c"
12041197
uuid = "477f73a3-ac25-53e9-8cc3-50b2fa2566f0"
1205-
version = "1.1.2+1"
1198+
version = "1.1.3+0"
12061199

12071200
[[deps.libblastrampoline_jll]]
12081201
deps = ["Artifacts", "Libdl"]
@@ -1217,9 +1210,9 @@ version = "100.700.100+0"
12171210

12181211
[[deps.libpng_jll]]
12191212
deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"]
1220-
git-tree-sha1 = "9c42636e3205e555e5785e902387be0061e7efc1"
1213+
git-tree-sha1 = "055a96774f383318750a1a5e10fd4151f04c29c5"
12211214
uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f"
1222-
version = "1.6.44+1"
1215+
version = "1.6.46+0"
12231216

12241217
[[deps.nghttp2_jll]]
12251218
deps = ["Artifacts", "Libdl"]

julia_src/http.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ function reopt(req::HTTP.Request)
7272
]
7373
inputs_with_defaults_from_avert_or_cambium = [
7474
:emissions_factor_series_lb_CO2_per_kwh, :emissions_factor_series_lb_NOx_per_kwh,
75-
:emissions_factor_series_lb_SO2_per_kwh, :emissions_factor_series_lb_PM25_per_kwh
75+
:emissions_factor_series_lb_SO2_per_kwh, :emissions_factor_series_lb_PM25_per_kwh,
76+
:renewable_energy_fraction_series
7677
]
7778
if haskey(d, "CHP")
7879
inputs_with_defaults_from_chp = [
@@ -348,9 +349,9 @@ function avert_emissions_profile(req::HTTP.Request)
348349
return HTTP.Response(200, JSON.json(data))
349350
end
350351

351-
function cambium_emissions_profile(req::HTTP.Request)
352+
function cambium_profile(req::HTTP.Request)
352353
d = JSON.parse(String(req.body))
353-
@info "Getting Cambium CO2 emissions profile..."
354+
@info "Getting emissions or clean energy data from Cambium..."
354355
data = Dict()
355356
error_response = Dict()
356357
try
@@ -360,7 +361,7 @@ function cambium_emissions_profile(req::HTTP.Request)
360361
lifetime = typeof(d["lifetime"]) == String ? parse(Int, d["lifetime"]) : d["lifetime"]
361362
load_year = typeof(d["load_year"]) == String ? parse(Int, d["load_year"]) : d["load_year"]
362363

363-
data = reoptjl.cambium_emissions_profile(;scenario= d["scenario"],
364+
data = reoptjl.cambium_profile(;scenario= d["scenario"],
364365
location_type = d["location_type"],
365366
latitude=latitude,
366367
longitude=longitude,
@@ -597,7 +598,7 @@ HTTP.register!(ROUTER, "POST", "/erp", erp)
597598
HTTP.register!(ROUTER, "POST", "/ghpghx", ghpghx)
598599
HTTP.register!(ROUTER, "GET", "/chp_defaults", chp_defaults)
599600
HTTP.register!(ROUTER, "GET", "/avert_emissions_profile", avert_emissions_profile)
600-
HTTP.register!(ROUTER, "GET", "/cambium_emissions_profile", cambium_emissions_profile)
601+
HTTP.register!(ROUTER, "GET", "/cambium_profile", cambium_profile)
601602
HTTP.register!(ROUTER, "GET", "/easiur_costs", easiur_costs)
602603
HTTP.register!(ROUTER, "GET", "/simulated_load", simulated_load)
603604
HTTP.register!(ROUTER, "GET", "/absorption_chiller_defaults", absorption_chiller_defaults)

reoptjl/custom_table_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@
453453
{
454454
"label" : "Annual % Renewable Electricity (%)",
455455
"key" : "annual_renewable_electricity",
456-
"bau_value" : lambda df: safe_get(df, "outputs.Site.renewable_electricity_fraction_bau"),
457-
"scenario_value": lambda df: safe_get(df, "outputs.Site.renewable_electricity_fraction")
456+
"bau_value" : lambda df: safe_get(df, "outputs.Site.onsite_renewable_electricity_fraction_of_elec_load_bau"),
457+
"scenario_value": lambda df: safe_get(df, "outputs.Site.onsite_renewable_electricity_fraction_of_elec_load")
458458
},
459459
{
460460
"label" : "Annual CO2 Emissions (tonnes)",
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Generated by Django 4.0.7 on 2025-01-27 05:41
2+
3+
import django.core.validators
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('reoptjl', '0076_ashpspaceheaterinputs_force_dispatch_and_more'),
11+
]
12+
13+
operations = [
14+
migrations.AddField(
15+
model_name='electricstorageinputs',
16+
name='max_duration_hours',
17+
field=models.FloatField(blank=True, default=100000.0, help_text='Maximum amount of time storage can discharge at its rated power capacity', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]),
18+
),
19+
migrations.AddField(
20+
model_name='electricstorageinputs',
21+
name='min_duration_hours',
22+
field=models.FloatField(blank=True, default=0.0, help_text='Minimum amount of time storage can discharge at its rated power capacity', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]),
23+
),
24+
]

0 commit comments

Comments
 (0)