From cf8ab2fd72c570672394131c9fb71809fae0ba2d Mon Sep 17 00:00:00 2001 From: adfarth Date: Mon, 27 Nov 2023 15:26:07 -0700 Subject: [PATCH 01/46] add bau lcc outputs --- CHANGELOG.md | 3 +++ reoptjl/models.py | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd623aa96..60649181b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,9 @@ Classify the change according to the following categories: ### Patches +## Develop - 2023-11-27 +#### Added +- Added the following BAU outputs: lifecycle_chp_standby_cost_after_tax, lifecycle_elecbill_after_tax, lifecycle_production_incentive_after_tax, lifecycle_outage_cost, lifecycle_MG_upgrade_and_fuel_cost ## v3.2.3 ### Minor Updates ##### Changed diff --git a/reoptjl/models.py b/reoptjl/models.py index 5f5a1010d..0dda729b5 100644 --- a/reoptjl/models.py +++ b/reoptjl/models.py @@ -1019,14 +1019,26 @@ class FinancialOutputs(BaseModel, models.Model): null=True, blank=True, help_text=("Component of lifecycle costs (LCC). This value is the present value of all CHP standby charges, after tax.") ) + lifecycle_chp_standby_cost_after_tax_bau = models.FloatField( + null=True, blank=True, + help_text=("BAU Component of lifecycle costs (LCC). This value is the present value of all CHP standby charges, after tax.") + ) lifecycle_elecbill_after_tax = models.FloatField( null=True, blank=True, help_text=("Component of lifecycle costs (LCC). This value is the present value of all electric utility charges, after tax.") ) + lifecycle_elecbill_after_tax_bau = models.FloatField( + null=True, blank=True, + help_text=("BAU Component of lifecycle costs (LCC). This value is the present value of all electric utility charges, after tax.") + ) lifecycle_production_incentive_after_tax = models.FloatField( null=True, blank=True, help_text=("Component of lifecycle costs (LCC). This value is the present value of all production-based incentives, after tax.") ) + lifecycle_production_incentive_after_tax_bau = models.FloatField( + null=True, blank=True, + help_text=("BAU Component of lifecycle costs (LCC). This value is the present value of all production-based incentives, after tax.") + ) lifecycle_offgrid_other_annual_costs_after_tax = models.FloatField( null=True, blank=True, help_text=("Component of lifecycle costs (LCC). This value is the present value of offgrid_other_annual_costs over the analysis period, after tax.") @@ -1040,11 +1052,20 @@ class FinancialOutputs(BaseModel, models.Model): null=True, blank=True, help_text=("Component of lifecycle costs (LCC). Expected outage cost.") ) + lifecycle_outage_cost_bau = models.FloatField( + null=True, blank=True, + help_text=("BAU Component of lifecycle costs (LCC). Expected outage cost.") + ) lifecycle_MG_upgrade_and_fuel_cost = models.FloatField( null=True, blank=True, help_text=("Component of lifecycle costs (LCC). This is the cost to upgrade generation and storage technologies to be included in microgrid" "plus present value of microgrid fuel costs.") ) + lifecycle_MG_upgrade_and_fuel_cost_bau = models.FloatField( + null=True, blank=True, + help_text=("BAU Component of lifecycle costs (LCC). This is the cost to upgrade generation and storage technologies to be included in microgrid" + "plus present value of microgrid fuel costs.") + ) replacements_future_cost_after_tax = models.FloatField( null=True, blank=True, help_text="Future cost of replacing storage and/or generator systems, after tax." From f3247dfc4a6dc56a12f870d837eb5737d424d7ac Mon Sep 17 00:00:00 2001 From: adfarth Date: Thu, 30 Nov 2023 13:31:44 -0700 Subject: [PATCH 02/46] Create 0051_financialoutputs_lifecycle_mg_upgrade_and_fuel_cost_bau_and_more.py --- ...e_mg_upgrade_and_fuel_cost_bau_and_more.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 reoptjl/migrations/0051_financialoutputs_lifecycle_mg_upgrade_and_fuel_cost_bau_and_more.py diff --git a/reoptjl/migrations/0051_financialoutputs_lifecycle_mg_upgrade_and_fuel_cost_bau_and_more.py b/reoptjl/migrations/0051_financialoutputs_lifecycle_mg_upgrade_and_fuel_cost_bau_and_more.py new file mode 100644 index 000000000..8cfb47986 --- /dev/null +++ b/reoptjl/migrations/0051_financialoutputs_lifecycle_mg_upgrade_and_fuel_cost_bau_and_more.py @@ -0,0 +1,38 @@ +# Generated by Django 4.0.7 on 2023-11-30 20:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('reoptjl', '0050_apimeta_api_key'), + ] + + operations = [ + migrations.AddField( + model_name='financialoutputs', + name='lifecycle_MG_upgrade_and_fuel_cost_bau', + field=models.FloatField(blank=True, help_text='BAU Component of lifecycle costs (LCC). This is the cost to upgrade generation and storage technologies to be included in microgridplus present value of microgrid fuel costs.', null=True), + ), + migrations.AddField( + model_name='financialoutputs', + name='lifecycle_chp_standby_cost_after_tax_bau', + field=models.FloatField(blank=True, help_text='BAU Component of lifecycle costs (LCC). This value is the present value of all CHP standby charges, after tax.', null=True), + ), + migrations.AddField( + model_name='financialoutputs', + name='lifecycle_elecbill_after_tax_bau', + field=models.FloatField(blank=True, help_text='BAU Component of lifecycle costs (LCC). This value is the present value of all electric utility charges, after tax.', null=True), + ), + migrations.AddField( + model_name='financialoutputs', + name='lifecycle_outage_cost_bau', + field=models.FloatField(blank=True, help_text='BAU Component of lifecycle costs (LCC). Expected outage cost.', null=True), + ), + migrations.AddField( + model_name='financialoutputs', + name='lifecycle_production_incentive_after_tax_bau', + field=models.FloatField(blank=True, help_text='BAU Component of lifecycle costs (LCC). This value is the present value of all production-based incentives, after tax.', null=True), + ), + ] From 98ba9e2954edf3d8fe4534640edcd8ec12b03186 Mon Sep 17 00:00:00 2001 From: adfarth Date: Wed, 6 Dec 2023 09:06:45 -0700 Subject: [PATCH 03/46] up REopt --- julia_src/Manifest.toml | 70 ++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 46 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index eaa477f06..a32fd3f8c 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -1,6 +1,6 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.8.5" +julia_version = "1.7.1" manifest_format = "2.0" project_hash = "e6825aaf1b270a6d70a8067b9b1106b9388e5c98" @@ -24,7 +24,6 @@ version = "0.9.4" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" -version = "1.1.1" [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" @@ -40,9 +39,9 @@ uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" [[deps.BenchmarkTools]] deps = ["JSON", "Logging", "Printf", "Profile", "Statistics", "UUIDs"] -git-tree-sha1 = "d9a9701b899b30332bbcb3e1679c41cce81fb0e8" +git-tree-sha1 = "f1f03a9fa24271160ed7e73051fba3c1a759b53f" uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" -version = "1.3.2" +version = "1.4.0" [[deps.BitFlags]] git-tree-sha1 = "2dc09997850d68179b69dafb58ae806167a32b1b" @@ -133,14 +132,13 @@ version = "0.3.0" [[deps.Compat]] deps = ["Dates", "LinearAlgebra", "UUIDs"] -git-tree-sha1 = "8a62af3e248a8c4bad6b32cbbe663ae02275e32c" +git-tree-sha1 = "886826d76ea9e72b35fcd000e535588f7b60f21d" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.10.0" +version = "4.10.1" [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.0.1+0" [[deps.ConcurrentUtilities]] deps = ["Serialization", "Sockets"] @@ -162,9 +160,9 @@ version = "0.1.0" [[deps.CoolProp_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "3e707957390c96dbe6184dc27eb6da2f5d2e6aac" +git-tree-sha1 = "f0f70a17d132d2ab5bf2b61993db36ac1099f6c7" uuid = "3351c21f-4feb-5f29-afb9-f4fcb0e27549" -version = "6.5.0+0" +version = "6.6.0+0" [[deps.Crayons]] git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" @@ -231,9 +229,8 @@ uuid = "4dc1fcf4-5e3b-5448-94ab-0c38ec0385c1" version = "0.3.1" [[deps.Downloads]] -deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] +deps = ["ArgTools", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" -version = "1.6.0" [[deps.ExceptionUnwrapping]] deps = ["Test"] @@ -264,9 +261,6 @@ git-tree-sha1 = "9f00e42f8d99fdde64d40c8ea5d14269a2e2c1aa" uuid = "48062228-2e41-5def-b9a4-89aafe57970f" version = "0.9.21" -[[deps.FileWatching]] -uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" - [[deps.FixedPointNumbers]] deps = ["Statistics"] git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" @@ -357,9 +351,9 @@ version = "1.9.14" [[deps.Hwloc_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "8ecb0b34472a3c98f945e3c75fc7d5428d165511" +git-tree-sha1 = "ca0f6bf568b4bfc807e7537f081c81e35ceca114" uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" -version = "2.9.3+0" +version = "2.10.0+0" [[deps.ImageCore]] deps = ["AbstractFFTs", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Graphics", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "Reexport"] @@ -400,9 +394,9 @@ uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" version = "0.2.2" [[deps.IterTools]] -git-tree-sha1 = "4ced6667f9974fc5c5943fa5e2ef1ca43ea9e450" +git-tree-sha1 = "fa6287a4469f5e048d763df38279ee729fbd44e5" uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" -version = "1.8.0" +version = "1.4.0" [[deps.IteratorInterfaceExtensions]] git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" @@ -463,12 +457,10 @@ uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" -version = "0.6.3" [[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "7.84.0+0" [[deps.LibGit2]] deps = ["Base64", "NetworkOptions", "Printf", "SHA"] @@ -477,7 +469,6 @@ uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" -version = "1.10.2+0" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" @@ -566,14 +557,13 @@ version = "1.19.0" [[deps.MbedTLS]] deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "NetworkOptions", "Random", "Sockets"] -git-tree-sha1 = "f512dc13e64e96f703fd92ce617755ee6b5adf0f" +git-tree-sha1 = "c067a280ddc25f196b5e7df3877c6b226d390aaf" uuid = "739be429-bea8-5141-9913-cc70e7f3736d" -version = "1.1.8" +version = "1.1.9" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" -version = "2.28.0+0" [[deps.MicrosoftMPI_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -598,7 +588,6 @@ version = "0.3.4" [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" -version = "2022.2.1" [[deps.MutableArithmetics]] deps = ["LinearAlgebra", "SparseArrays", "Test"] @@ -614,7 +603,6 @@ version = "1.0.2" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" -version = "1.2.0" [[deps.OffsetArrays]] deps = ["Adapt"] @@ -625,7 +613,6 @@ version = "1.12.10" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.20+0" [[deps.OpenJpeg_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libtiff_jll", "LittleCMS_jll", "Pkg", "libpng_jll"] @@ -636,7 +623,6 @@ version = "2.4.0+0" [[deps.OpenLibm_jll]] deps = ["Artifacts", "Libdl"] uuid = "05823500-19ac-5b8b-9628-191a04bc5112" -version = "0.8.1+0" [[deps.OpenMPI_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "PMIx_jll", "TOML", "Zlib_jll", "libevent_jll", "prrte_jll"] @@ -663,9 +649,9 @@ uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" version = "0.5.5+0" [[deps.OrderedCollections]] -git-tree-sha1 = "2e73fe17cac3c62ad1aebe70d44c963c3cfdc3e3" +git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.6.2" +version = "1.6.3" [[deps.PMIx_jll]] deps = ["Artifacts", "Hwloc_jll", "JLLWrappers", "Libdl", "Zlib_jll", "libevent_jll"] @@ -694,7 +680,6 @@ version = "2.8.0" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -version = "1.8.0" [[deps.PooledArrays]] deps = ["DataAPI", "Future"] @@ -716,9 +701,9 @@ version = "1.4.1" [[deps.PrettyTables]] deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "Reexport", "StringManipulation", "Tables"] -git-tree-sha1 = "3f43c2aae6aa4a2503b05587ab74f4f6aeff9fd0" +git-tree-sha1 = "88b895d13d53b5577fd53379d913b9ab9ac82660" uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" -version = "2.3.0" +version = "2.3.1" [[deps.Printf]] deps = ["Unicode"] @@ -734,9 +719,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "a56f12eca2b737e9d9210000ee599920001cc303" +git-tree-sha1 = "373fd99edecab625cdfa492bdbeeaa4fd7b181ab" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.38.1" +version = "0.38.2" [[deps.Random]] deps = ["SHA", "Serialization"] @@ -772,7 +757,6 @@ version = "2.0.22" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" -version = "0.7.0" [[deps.SQLite_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"] @@ -855,7 +839,6 @@ version = "0.3.4" [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" -version = "1.0.0" [[deps.TableTraits]] deps = ["IteratorInterfaceExtensions"] @@ -872,7 +855,6 @@ version = "1.11.1" [[deps.Tar]] deps = ["ArgTools", "SHA"] uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" -version = "1.10.1" [[deps.TensorCore]] deps = ["LinearAlgebra"] @@ -910,9 +892,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Unitful]] deps = ["ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "Random"] -git-tree-sha1 = "242982d62ff0d1671e9029b52743062739255c7e" +git-tree-sha1 = "3c793be6df9dd77a0cf49d80984ef9ff996948fa" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.18.0" +version = "1.19.0" [[deps.WeakRefStrings]] deps = ["DataAPI", "InlineStrings", "Parsers"] @@ -934,7 +916,6 @@ version = "0.16.1" [[deps.Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" -version = "1.2.12+3" [[deps.Zstd_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -951,7 +932,6 @@ version = "1.0.6+1" [[deps.libblastrampoline_jll]] deps = ["Artifacts", "Libdl", "OpenBLAS_jll"] uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.1.1+0" [[deps.libevent_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenSSL_jll"] @@ -967,19 +947,17 @@ version = "100.700.100+0" [[deps.libpng_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "94d180a6d2b5e55e447e2d27a29ed04fe79eb30c" +git-tree-sha1 = "f7c281e9c61905521993a987d38b5ab1d4b53bef" uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" -version = "1.6.38+0" +version = "1.6.38+1" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.48.0+0" [[deps.p7zip_jll]] deps = ["Artifacts", "Libdl"] uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" -version = "17.4.0+0" [[deps.prrte_jll]] deps = ["Artifacts", "Hwloc_jll", "JLLWrappers", "Libdl", "PMIx_jll", "libevent_jll"] From 860ff6704b1ac04c7bd1aaff4862d18449a26207 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Sat, 9 Dec 2023 20:46:08 -0700 Subject: [PATCH 04/46] Remove sensitive encrypted file ASAP per management - knowingly breaking things without a solution CI Tests and likely deployments will break until we have a workaroudn solution --- .gitattributes | 1 - julia_src/xpress/licenseserver/Dockerfile | 1 - 2 files changed, 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 25f76e523..1ab870755 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1 @@ #pattern filter=crypt diff=crypt -julia_src/xpress/licenseserver/xpauth.xpr filter=crypt diff=crypt merge=crypt diff --git a/julia_src/xpress/licenseserver/Dockerfile b/julia_src/xpress/licenseserver/Dockerfile index 5a561a777..402c4588f 100644 --- a/julia_src/xpress/licenseserver/Dockerfile +++ b/julia_src/xpress/licenseserver/Dockerfile @@ -15,7 +15,6 @@ ENV PATH=${XPRESSDIR}/bin:${PATH} WORKDIR ${XPRESS} COPY --from=xpress /opt/reopt/solver/ . -COPY xpauth.xpr . RUN sed -i -e 's/\r$//' install.sh RUN printf 'f\ns\n\ny\n.\ny\n' | ./install.sh >> license_info.txt; RUN rm xp8.12.3_linux_x86_64.tar.gz From 8831bd4cc3c2dfb4fdd43a69d498d056cde61f6d Mon Sep 17 00:00:00 2001 From: adfarth Date: Mon, 11 Dec 2023 12:30:05 -0700 Subject: [PATCH 05/46] Update Manifest.toml --- julia_src/Manifest.toml | 52 +++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index a32fd3f8c..6db1500c5 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -1,6 +1,6 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.7.1" +julia_version = "1.8.5" manifest_format = "2.0" project_hash = "e6825aaf1b270a6d70a8067b9b1106b9388e5c98" @@ -12,9 +12,9 @@ version = "1.5.0" [[deps.Adapt]] deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "02f731463748db57cc2ebfbd9fbc9ce8280d3433" +git-tree-sha1 = "cde29ddf7e5726c9fb511f340244ea3481267608" uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.7.1" +version = "3.7.2" [[deps.ArchGDAL]] deps = ["CEnum", "ColorTypes", "Dates", "DiskArrays", "Extents", "GDAL", "GDAL_jll", "GeoFormatTypes", "GeoInterface", "GeoInterfaceRecipes", "ImageCore", "Tables"] @@ -24,6 +24,7 @@ version = "0.9.4" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +version = "1.1.1" [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" @@ -139,6 +140,7 @@ version = "4.10.1" [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.0.1+0" [[deps.ConcurrentUtilities]] deps = ["Serialization", "Sockets"] @@ -229,8 +231,9 @@ uuid = "4dc1fcf4-5e3b-5448-94ab-0c38ec0385c1" version = "0.3.1" [[deps.Downloads]] -deps = ["ArgTools", "LibCURL", "NetworkOptions"] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" +version = "1.6.0" [[deps.ExceptionUnwrapping]] deps = ["Test"] @@ -261,6 +264,9 @@ git-tree-sha1 = "9f00e42f8d99fdde64d40c8ea5d14269a2e2c1aa" uuid = "48062228-2e41-5def-b9a4-89aafe57970f" version = "0.9.21" +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + [[deps.FixedPointNumbers]] deps = ["Statistics"] git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" @@ -394,9 +400,9 @@ uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" version = "0.2.2" [[deps.IterTools]] -git-tree-sha1 = "fa6287a4469f5e048d763df38279ee729fbd44e5" +git-tree-sha1 = "4ced6667f9974fc5c5943fa5e2ef1ca43ea9e450" uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" -version = "1.4.0" +version = "1.8.0" [[deps.IteratorInterfaceExtensions]] git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" @@ -423,9 +429,9 @@ version = "0.21.4" [[deps.JpegTurbo_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "6f2675ef130a300a112286de91973805fcc5ffbc" +git-tree-sha1 = "60b1194df0a3298f460063de985eae7b01bc011a" uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8" -version = "2.1.91+0" +version = "3.0.1+0" [[deps.JuMP]] deps = ["LinearAlgebra", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "Printf", "SnoopPrecompile", "SparseArrays"] @@ -457,10 +463,12 @@ uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.6.3" [[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" +version = "7.84.0+0" [[deps.LibGit2]] deps = ["Base64", "NetworkOptions", "Printf", "SHA"] @@ -469,6 +477,7 @@ uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.10.2+0" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" @@ -518,9 +527,9 @@ version = "1.9.4+0" [[deps.MPICH_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "8a5b4d2220377d1ece13f49438d71ad20cf1ba83" +git-tree-sha1 = "2ee75365ca243c1a39d467e35ffd3d4d32eef11e" uuid = "7cb0a576-ebde-5e09-9194-50597f1243b4" -version = "4.1.2+0" +version = "4.1.2+1" [[deps.MPIPreferences]] deps = ["Libdl", "Preferences"] @@ -564,6 +573,7 @@ version = "1.1.9" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.0+0" [[deps.MicrosoftMPI_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -588,6 +598,7 @@ version = "0.3.4" [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" +version = "2022.2.1" [[deps.MutableArithmetics]] deps = ["LinearAlgebra", "SparseArrays", "Test"] @@ -603,6 +614,7 @@ version = "1.0.2" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" [[deps.OffsetArrays]] deps = ["Adapt"] @@ -613,6 +625,7 @@ version = "1.12.10" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.20+0" [[deps.OpenJpeg_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libtiff_jll", "LittleCMS_jll", "Pkg", "libpng_jll"] @@ -623,6 +636,7 @@ version = "2.4.0+0" [[deps.OpenLibm_jll]] deps = ["Artifacts", "Libdl"] uuid = "05823500-19ac-5b8b-9628-191a04bc5112" +version = "0.8.1+0" [[deps.OpenMPI_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "PMIx_jll", "TOML", "Zlib_jll", "libevent_jll", "prrte_jll"] @@ -680,6 +694,7 @@ version = "2.8.0" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +version = "1.8.0" [[deps.PooledArrays]] deps = ["DataAPI", "Future"] @@ -719,9 +734,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "373fd99edecab625cdfa492bdbeeaa4fd7b181ab" +git-tree-sha1 = "013fc07e92f4b742f09b7adae75d2d63dfbc9237" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.38.2" +version = "0.39.0" [[deps.Random]] deps = ["SHA", "Serialization"] @@ -757,6 +772,7 @@ version = "2.0.22" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" [[deps.SQLite_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"] @@ -839,6 +855,7 @@ version = "0.3.4" [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.0" [[deps.TableTraits]] deps = ["IteratorInterfaceExtensions"] @@ -855,6 +872,7 @@ version = "1.11.1" [[deps.Tar]] deps = ["ArgTools", "SHA"] uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.10.1" [[deps.TensorCore]] deps = ["LinearAlgebra"] @@ -916,6 +934,7 @@ version = "0.16.1" [[deps.Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.12+3" [[deps.Zstd_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -932,6 +951,7 @@ version = "1.0.6+1" [[deps.libblastrampoline_jll]] deps = ["Artifacts", "Libdl", "OpenBLAS_jll"] uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.1.1+0" [[deps.libevent_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenSSL_jll"] @@ -946,18 +966,20 @@ uuid = "06c338fa-64ff-565b-ac2f-249532af990e" version = "100.700.100+0" [[deps.libpng_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "f7c281e9c61905521993a987d38b5ab1d4b53bef" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"] +git-tree-sha1 = "93284c28274d9e75218a416c65ec49d0e0fcdf3d" uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" -version = "1.6.38+1" +version = "1.6.40+0" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +version = "1.48.0+0" [[deps.p7zip_jll]] deps = ["Artifacts", "Libdl"] uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" +version = "17.4.0+0" [[deps.prrte_jll]] deps = ["Artifacts", "Hwloc_jll", "JLLWrappers", "Libdl", "PMIx_jll", "libevent_jll"] From 523f9aa363eefed770023609451a9ec3503b3930 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 12 Dec 2023 20:24:49 -0700 Subject: [PATCH 06/46] Purge per NREL management and legal --- .bash_profile | 19 ------------------- .gitignore | 4 ---- debug_inputs.json | 1 + docker-compose.nginx.yml | 10 ---------- docker-compose.nojulia.yml | 9 --------- docker-compose.yml | 13 ------------- julia_src/Dockerfile | 19 ------------------- julia_src/docker-compose.yml | 10 ---------- julia_src/xpress/Dockerfile | 7 +------ julia_src/xpress/licenseserver/Dockerfile | 22 ---------------------- workflow_notes.txt | 13 +++++++++++++ 11 files changed, 15 insertions(+), 112 deletions(-) create mode 100644 debug_inputs.json delete mode 100644 julia_src/xpress/licenseserver/Dockerfile create mode 100644 workflow_notes.txt diff --git a/.bash_profile b/.bash_profile index 3d6089f90..d40a3b728 100755 --- a/.bash_profile +++ b/.bash_profile @@ -29,25 +29,6 @@ export DYLD_LIBRARY_PATH # for Mac #============================================================================== -#------------------------------------------------------------------------------ - -# Uncomment the following if you are using the Xpress solver -#------------------------------------------------------------------------------ -#XPRESSDIR="/usr/local/opt/xpress" -#DYLD_LIBRARY_PATH="${XPRESSDIR}/lib:${SRC_DIR}:${DYLD_LIBRARY_PATH}" # for Mac -#LD_LIBRARY_PATH="${XPRESSDIR}/lib:${SRC_DIR}:${LD_LIBRARY_PATH}" # for Linux -#CLASSPATH="${XPRESSDIR}/lib/xprs.jar:${XPRESSDIR}/lib/xprb.jar:${XPRESSDIR}/lib/xprm.jar:${CLASSPATH}" -#PATH="${XPRESSDIR}/bin:${PATH}" -# -#export PATH -#export XPRESS="$XPRESSDIR/bin" -#export DYLD_LIBRARY_PATH -#export LD_LIBRARY_PATH -#export CLASSPATH -#source /opt/xpressmp/bin/xpvars.sh -#============================================================================== - - #------------------------------------------------------------------------------ # You can change the following to add Julia to your system Path #------------------------------------------------------------------------------ diff --git a/.gitignore b/.gitignore index 52ea5b572..b57ebff2f 100755 --- a/.gitignore +++ b/.gitignore @@ -114,8 +114,4 @@ all_data* docs/formulation/*aux docs/formulation/*log -# Customized docker files -docker-compose.xpressOS.yml -Dockerfile.xpressOS.pyjul - /.werf_secret_key diff --git a/debug_inputs.json b/debug_inputs.json new file mode 100644 index 000000000..4161ee682 --- /dev/null +++ b/debug_inputs.json @@ -0,0 +1 @@ +{"api_key": "uaz52dr5KTT5Qs5U72rS70hw3IYeHVEyAaDUFQvo", "Settings": {"timeout_seconds": 420, "time_steps_per_hour": 1, "optimality_tolerance": 0.001, "add_soc_incentive": true, "run_bau": true, "include_climate_in_objective": false, "include_health_in_objective": false, "off_grid_flag": false}, "Financial": {"analysis_years": 25, "elec_cost_escalation_rate_fraction": 0.006, "offtaker_discount_rate_fraction": 0.07, "offtaker_tax_rate_fraction": 0.0, "om_cost_escalation_rate_fraction": 0.001, "owner_discount_rate_fraction": 0.07, "owner_tax_rate_fraction": 0.0, "third_party_ownership": false, "value_of_lost_load_per_kwh": 0.0, "microgrid_upgrade_cost_fraction": 0.0, "offgrid_other_capital_costs": 0.0, "offgrid_other_annual_costs": 0.0, "CO2_cost_per_tonne": 51.0, "CO2_cost_escalation_rate_fraction": 0.042173, "generator_fuel_cost_escalation_rate_fraction": 0.012, "existing_boiler_fuel_cost_escalation_rate_fraction": 0.015, "boiler_fuel_cost_escalation_rate_fraction": 0.015, "chp_fuel_cost_escalation_rate_fraction": 0.015}, "Site": {"latitude": 39.91065, "longitude": -105.2348, "include_exported_elec_emissions_in_total": true, "include_exported_renewable_electricity_in_total": true}, "ElectricLoad": {"annual_kwh": 10000000.0, "doe_reference_name": "MediumOffice", "year": 2017, "loads_kw_is_net": true, "critical_loads_kw_is_net": false, "critical_load_fraction": 0.5, "operating_reserve_required_fraction": 0.0, "min_load_met_annual_fraction": 1.0}, "ElectricTariff": {"monthly_demand_rates": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], "monthly_energy_rates": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2], "urdb_label": "", "urdb_rate_name": "", "urdb_utility_name": "", "add_monthly_rates_to_urdb_rate": false, "add_tou_energy_rates_to_urdb_rate": false}, "ElectricUtility": {"interconnection_limit_kw": 1000000000.0, "net_metering_limit_kw": 100000000.0, "emissions_region": "", "emissions_factor_CO2_decrease_fraction": 0.01174, "emissions_factor_NOx_decrease_fraction": 0.01174, "emissions_factor_SO2_decrease_fraction": 0.01174, "emissions_factor_PM25_decrease_fraction": 0.01174}, "Wind": {"size_class": "large", "min_kw": 0.0, "max_kw": 10000.0, "installed_cost_per_kw": 2386.0, "om_cost_per_kw": 35.0, "macrs_option_years": 0, "macrs_bonus_fraction": 0.0, "macrs_itc_reduction": 0.5, "federal_itc_fraction": 0.0, "state_ibi_fraction": 0.0, "state_ibi_max": 10000000000.0, "utility_ibi_fraction": 0.0, "utility_ibi_max": 10000000000.0, "federal_rebate_per_kw": 0.0, "state_rebate_per_kw": 0.0, "state_rebate_max": 10000000000.0, "utility_rebate_per_kw": 0.0, "utility_rebate_max": 10000000000.0, "production_incentive_per_kwh": 0.0, "production_incentive_max_benefit": 1000000000.0, "production_incentive_years": 1, "production_incentive_max_kw": 1000000000.0, "can_net_meter": true, "can_wholesale": true, "can_export_beyond_nem_limit": true, "can_curtail": true, "operating_reserve_required_fraction": 0.0}} \ No newline at end of file diff --git a/docker-compose.nginx.yml b/docker-compose.nginx.yml index a057d5010..82f33693a 100644 --- a/docker-compose.nginx.yml +++ b/docker-compose.nginx.yml @@ -74,14 +74,6 @@ services: - django-nginx restart: "on-failure" - licenseserver: - build: - context: julia_src/xpress/licenseserver - mac_address: c4:b3:01:d3:d5:eb - command: xpserver - expose: - - 27100 - julia-nginx: container_name: julia-nginx build: @@ -91,8 +83,6 @@ services: - JULIA_NUM_THREADS=2 expose: - 8081 - depends_on: - - licenseserver volumes: - ./julia_src:/opt/julia_src diff --git a/docker-compose.nojulia.yml b/docker-compose.nojulia.yml index 8a49c33d8..1d8c7536d 100644 --- a/docker-compose.nojulia.yml +++ b/docker-compose.nojulia.yml @@ -65,14 +65,5 @@ services: volumes: - .:/opt/reopt - licenseserver: - container_name: licenseserver-nojul - build: - context: julia_src/xpress/licenseserver - mac_address: c4:b3:01:d3:d5:eb - command: xpserver - expose: - - 27100 - volumes: pgdata: diff --git a/docker-compose.yml b/docker-compose.yml index e9a2c9938..1211e572f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -58,26 +58,13 @@ services: - 8000:8000 volumes: - .:/opt/reopt - - licenseserver: - container_name: xpress_license_server - build: - context: julia_src/xpress/licenseserver - mac_address: c4:b3:01:d3:d5:eb - command: xpserver - expose: - - 27100 julia: container_name: julia_api build: context: julia_src/ - args: - - XPRESS_LICENSE_HOST=xpress_license_server command: julia --project=/opt/julia_src http.jl ports: - "8081:8081" - depends_on: - - licenseserver volumes: - ./julia_src:/opt/julia_src diff --git a/julia_src/Dockerfile b/julia_src/Dockerfile index 828ba9a49..be6838401 100644 --- a/julia_src/Dockerfile +++ b/julia_src/Dockerfile @@ -1,5 +1,3 @@ -FROM reopt/xpressbase AS xpress - FROM julia:1.8.5 # Install NREL root certs for machines running on NREL's network. @@ -7,23 +5,6 @@ ARG NREL_ROOT_CERT_URL_ROOT="" RUN set -x && if [ -n "$NREL_ROOT_CERT_URL_ROOT" ]; then curl -fsSLk -o /usr/local/share/ca-certificates/nrel_root.crt "${NREL_ROOT_CERT_URL_ROOT}/nrel_root.pem" && curl -fsSLk -o /usr/local/share/ca-certificates/nrel_xca1.crt "${NREL_ROOT_CERT_URL_ROOT}/nrel_xca1.pem" && update-ca-certificates; fi ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt -# Install Xpress solver for client -ENV XPRESSDIR=/opt/xpressmp -ENV XPRESS=/opt/xpressmp/bin -ENV LD_LIBRARY_PATH=${XPRESSDIR}/lib:${LD_LIBRARY_PATH} -ENV LIBPATH=${XPRESSDIR}/lib:${LIBPATH} -ARG CLASSPATH=${XPRESSDIR}/lib/xprs.jar:${CLASSPATH} -ARG CLASSPATH=${XPRESSDIR}/lib/xprb.jar:${CLASSPATH} -ENV CLASSPATH=${XPRESSDIR}/lib/xprm.jar:${CLASSPATH} -ENV PATH=${XPRESSDIR}/bin:${PATH} - -WORKDIR /opt/reopt/solver -COPY --from=xpress /opt/reopt/solver . -RUN sed -i -e 's/\r$//' install.sh -ARG XPRESS_LICENSE_HOST=licenseserver -RUN set -x && printf "f\nc\n\nn\n\n${XPRESS_LICENSE_HOST}\ny\n" | ./install.sh >> license_info.txt; -RUN rm xp8.12.3_linux_x86_64.tar.gz - # Install gfortran for /ghpghx RUN apt-get update && apt-get install -y \ gfortran diff --git a/julia_src/docker-compose.yml b/julia_src/docker-compose.yml index a47088a6c..a183e266c 100644 --- a/julia_src/docker-compose.yml +++ b/julia_src/docker-compose.yml @@ -1,21 +1,11 @@ version: "2.1" services: - licenseserver: - container_name: xpress_license_server_dev - build: - context: ./xpress/licenseserver - mac_address: c4:b3:01:d3:d5:eb - command: xpserver - expose: - - 27100 julia: container_name: julia_api_dev build: context: . - args: - - XPRESS_LICENSE_HOST=xpress_license_server_dev command: julia --project="/opt/julia_src" http.jl ports: - "8081:8081" \ No newline at end of file diff --git a/julia_src/xpress/Dockerfile b/julia_src/xpress/Dockerfile index b83456fff..c3af507c0 100644 --- a/julia_src/xpress/Dockerfile +++ b/julia_src/xpress/Dockerfile @@ -1,7 +1,2 @@ FROM ubuntu:latest -# For creating base image of Julia API. Requires an untracked tar.gz file for FICO Xpress -# Used in both production and local development - -WORKDIR /opt/reopt/solver -COPY xp8.12.3_linux_x86_64.tar.gz . -COPY install.sh . +# For creating base image of Julia API diff --git a/julia_src/xpress/licenseserver/Dockerfile b/julia_src/xpress/licenseserver/Dockerfile deleted file mode 100644 index 402c4588f..000000000 --- a/julia_src/xpress/licenseserver/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM reopt/xpressbase AS xpress - -FROM ubuntu:latest - -# Install Xpress solver -ENV XPRESSDIR=/opt/xpressmp -ENV XPRESS=/opt/xpressmp/bin -ENV LD_LIBRARY_PATH=${XPRESSDIR}/lib:${SRC_DIR}:${LD_LIBRARY_PATH} -ENV LIBPATH=${XPRESSDIR}/lib:${LIBPATH} -ENV PYTHONPATH=${XPRESSDIR}/lib:${PYTHONPATH} -ARG CLASSPATH=${XPRESSDIR}/lib/xprs.jar:${CLASSPATH} -ARG CLASSPATH=${XPRESSDIR}/lib/xprb.jar:${CLASSPATH} -ENV CLASSPATH=${XPRESSDIR}/lib/xprm.jar:${CLASSPATH} -ENV PATH=${XPRESSDIR}/bin:${PATH} - -WORKDIR ${XPRESS} -COPY --from=xpress /opt/reopt/solver/ . -RUN sed -i -e 's/\r$//' install.sh -RUN printf 'f\ns\n\ny\n.\ny\n' | ./install.sh >> license_info.txt; -RUN rm xp8.12.3_linux_x86_64.tar.gz - -CMD xpserver \ No newline at end of file diff --git a/workflow_notes.txt b/workflow_notes.txt new file mode 100644 index 000000000..57ceca294 --- /dev/null +++ b/workflow_notes.txt @@ -0,0 +1,13 @@ +docker compose build +docker compose up + +docker extension for viewing container status, attaching to containers + +Julia package changes +Updating REopt.jl version within Docker container - REopt#branch versus Docker no-julia +Restart julia_api + +Test with postman +Test with django - shell into django container + +Debugging within VSCode Remote Containers in the django container From b64243b8257cc4d5cb3153ef7b4ee4c85ab9538e Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 12 Dec 2023 20:44:36 -0700 Subject: [PATCH 07/46] Remove accidental commit of local files --- debug_inputs.json | 1 - workflow_notes.txt | 13 ------------- 2 files changed, 14 deletions(-) delete mode 100644 debug_inputs.json delete mode 100644 workflow_notes.txt diff --git a/debug_inputs.json b/debug_inputs.json deleted file mode 100644 index 4161ee682..000000000 --- a/debug_inputs.json +++ /dev/null @@ -1 +0,0 @@ -{"api_key": "uaz52dr5KTT5Qs5U72rS70hw3IYeHVEyAaDUFQvo", "Settings": {"timeout_seconds": 420, "time_steps_per_hour": 1, "optimality_tolerance": 0.001, "add_soc_incentive": true, "run_bau": true, "include_climate_in_objective": false, "include_health_in_objective": false, "off_grid_flag": false}, "Financial": {"analysis_years": 25, "elec_cost_escalation_rate_fraction": 0.006, "offtaker_discount_rate_fraction": 0.07, "offtaker_tax_rate_fraction": 0.0, "om_cost_escalation_rate_fraction": 0.001, "owner_discount_rate_fraction": 0.07, "owner_tax_rate_fraction": 0.0, "third_party_ownership": false, "value_of_lost_load_per_kwh": 0.0, "microgrid_upgrade_cost_fraction": 0.0, "offgrid_other_capital_costs": 0.0, "offgrid_other_annual_costs": 0.0, "CO2_cost_per_tonne": 51.0, "CO2_cost_escalation_rate_fraction": 0.042173, "generator_fuel_cost_escalation_rate_fraction": 0.012, "existing_boiler_fuel_cost_escalation_rate_fraction": 0.015, "boiler_fuel_cost_escalation_rate_fraction": 0.015, "chp_fuel_cost_escalation_rate_fraction": 0.015}, "Site": {"latitude": 39.91065, "longitude": -105.2348, "include_exported_elec_emissions_in_total": true, "include_exported_renewable_electricity_in_total": true}, "ElectricLoad": {"annual_kwh": 10000000.0, "doe_reference_name": "MediumOffice", "year": 2017, "loads_kw_is_net": true, "critical_loads_kw_is_net": false, "critical_load_fraction": 0.5, "operating_reserve_required_fraction": 0.0, "min_load_met_annual_fraction": 1.0}, "ElectricTariff": {"monthly_demand_rates": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], "monthly_energy_rates": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2], "urdb_label": "", "urdb_rate_name": "", "urdb_utility_name": "", "add_monthly_rates_to_urdb_rate": false, "add_tou_energy_rates_to_urdb_rate": false}, "ElectricUtility": {"interconnection_limit_kw": 1000000000.0, "net_metering_limit_kw": 100000000.0, "emissions_region": "", "emissions_factor_CO2_decrease_fraction": 0.01174, "emissions_factor_NOx_decrease_fraction": 0.01174, "emissions_factor_SO2_decrease_fraction": 0.01174, "emissions_factor_PM25_decrease_fraction": 0.01174}, "Wind": {"size_class": "large", "min_kw": 0.0, "max_kw": 10000.0, "installed_cost_per_kw": 2386.0, "om_cost_per_kw": 35.0, "macrs_option_years": 0, "macrs_bonus_fraction": 0.0, "macrs_itc_reduction": 0.5, "federal_itc_fraction": 0.0, "state_ibi_fraction": 0.0, "state_ibi_max": 10000000000.0, "utility_ibi_fraction": 0.0, "utility_ibi_max": 10000000000.0, "federal_rebate_per_kw": 0.0, "state_rebate_per_kw": 0.0, "state_rebate_max": 10000000000.0, "utility_rebate_per_kw": 0.0, "utility_rebate_max": 10000000000.0, "production_incentive_per_kwh": 0.0, "production_incentive_max_benefit": 1000000000.0, "production_incentive_years": 1, "production_incentive_max_kw": 1000000000.0, "can_net_meter": true, "can_wholesale": true, "can_export_beyond_nem_limit": true, "can_curtail": true, "operating_reserve_required_fraction": 0.0}} \ No newline at end of file diff --git a/workflow_notes.txt b/workflow_notes.txt deleted file mode 100644 index 57ceca294..000000000 --- a/workflow_notes.txt +++ /dev/null @@ -1,13 +0,0 @@ -docker compose build -docker compose up - -docker extension for viewing container status, attaching to containers - -Julia package changes -Updating REopt.jl version within Docker container - REopt#branch versus Docker no-julia -Restart julia_api - -Test with postman -Test with django - shell into django container - -Debugging within VSCode Remote Containers in the django container From 659a5560c6d99c5346fdf876635822e25127293c Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 11:58:42 -0700 Subject: [PATCH 08/46] Add julia_src/highs setup for HiGHS (and Cbc) --- docker-compose.highs.yml | 73 +++ julia_src/Dockerfile.highs | 17 + julia_src/highs/Manifest.toml | 1046 +++++++++++++++++++++++++++++++++ julia_src/highs/Project.toml | 16 + julia_src/highs/http.jl | 481 +++++++++++++++ julia_src/highs/precompile.jl | 10 + 6 files changed, 1643 insertions(+) create mode 100644 docker-compose.highs.yml create mode 100644 julia_src/Dockerfile.highs create mode 100644 julia_src/highs/Manifest.toml create mode 100644 julia_src/highs/Project.toml create mode 100644 julia_src/highs/http.jl create mode 100644 julia_src/highs/precompile.jl diff --git a/docker-compose.highs.yml b/docker-compose.highs.yml new file mode 100644 index 000000000..1b4a74ec2 --- /dev/null +++ b/docker-compose.highs.yml @@ -0,0 +1,73 @@ +version: "2.1" + +services: + + redis: + image: redis + command: redis-server + expose: + - 6379 + + db: + image: postgres + restart: always + environment: + - POSTGRES_USER=reopt + - POSTGRES_PASSWORD=reopt + - POSTGRES_DB=reopt + expose: + - 5432 + + celery: + build: + context: . + dockerfile: Dockerfile + image: base-api-image + command: > + "celery -A reopt_api worker -l info" + environment: + - APP_ENV=local + - SQL_HOST=db + - SQL_PORT=5432 + - REDIS_HOST=redis + volumes: + - .:/opt/reopt + depends_on: + - db + - redis + - julia + + django: + build: + context: . + dockerfile: Dockerfile + image: base-api-image + command: > + "python manage.py migrate + && /opt/reopt/bin/wait-for-it.bash -t 0 julia:8081 -- python manage.py runserver 0.0.0.0:8000" + environment: + - APP_ENV=local + - SQL_HOST=db + - SQL_PORT=5432 + - REDIS_HOST=redis + depends_on: + - db + - redis + - julia + ports: + - 8000:8000 + volumes: + - .:/opt/reopt + + julia: + container_name: julia_api + build: + context: julia_src/ + dockerfile: Dockerfile.highs + environment: + - SOLVER=HiGHS + command: julia --project=/opt/julia_src/highs highs/http.jl + ports: + - "8081:8081" + volumes: + - ./julia_src:/opt/julia_src diff --git a/julia_src/Dockerfile.highs b/julia_src/Dockerfile.highs new file mode 100644 index 000000000..c4dc43130 --- /dev/null +++ b/julia_src/Dockerfile.highs @@ -0,0 +1,17 @@ +FROM julia:1.8.5 + +# Install NREL root certs for machines running on NREL's network. +ARG NREL_ROOT_CERT_URL_ROOT="" +RUN set -x && if [ -n "$NREL_ROOT_CERT_URL_ROOT" ]; then curl -fsSLk -o /usr/local/share/ca-certificates/nrel_root.crt "${NREL_ROOT_CERT_URL_ROOT}/nrel_root.pem" && curl -fsSLk -o /usr/local/share/ca-certificates/nrel_xca1.crt "${NREL_ROOT_CERT_URL_ROOT}/nrel_xca1.pem" && update-ca-certificates; fi +ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt + +# Install Julia packages +ENV JULIA_NUM_THREADS=2 + +WORKDIR /opt/julia_src +COPY . . +RUN julia --project=/opt/julia_src/highs -e 'import Pkg; Pkg.instantiate();' +RUN julia --project=/opt/julia_src/highs highs/precompile.jl +EXPOSE 8081 + +CMD ["bash"] \ No newline at end of file diff --git a/julia_src/highs/Manifest.toml b/julia_src/highs/Manifest.toml new file mode 100644 index 000000000..dd54e7683 --- /dev/null +++ b/julia_src/highs/Manifest.toml @@ -0,0 +1,1046 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.8.5" +manifest_format = "2.0" +project_hash = "4e90c1d5222205cd4398c57eb1b0094e7c9e44a9" + +[[deps.ASL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "6252039f98492252f9e47c312c8ffda0e3b9e78d" +uuid = "ae81ac8f-d209-56e5-92de-9978fef736f9" +version = "0.1.3+0" + +[[deps.AbstractFFTs]] +deps = ["ChainRulesCore", "LinearAlgebra", "Test"] +git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef" +uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" +version = "1.5.0" + +[[deps.Adapt]] +deps = ["LinearAlgebra", "Requires"] +git-tree-sha1 = "f8c724a2066b2d37d0234fe4022ec67987022d00" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "4.0.0" + +[[deps.ArchGDAL]] +deps = ["CEnum", "ColorTypes", "Dates", "DiskArrays", "Extents", "GDAL", "GeoFormatTypes", "GeoInterface", "GeoInterfaceRecipes", "ImageCore", "Tables"] +git-tree-sha1 = "70908bb727c9a0ba863c5145aa48ee838cc29b84" +uuid = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3" +version = "0.9.3" + +[[deps.ArgTools]] +uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +version = "1.1.1" + +[[deps.Arrow_jll]] +deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Lz4_jll", "Pkg", "Thrift_jll", "Zlib_jll", "boost_jll", "snappy_jll"] +git-tree-sha1 = "d64cb60c0e6a138fbe5ea65bcbeea47813a9a700" +uuid = "8ce61222-c28f-5041-a97a-c2198fb817bf" +version = "10.0.0+1" + +[[deps.Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" + +[[deps.AxisArrays]] +deps = ["Dates", "IntervalSets", "IterTools", "RangeArrays"] +git-tree-sha1 = "16351be62963a67ac4083f748fdb3cca58bfd52f" +uuid = "39de3d68-74b9-583c-8d2d-e117c070f3a9" +version = "0.4.7" + +[[deps.Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[deps.BenchmarkTools]] +deps = ["JSON", "Logging", "Printf", "Profile", "Statistics", "UUIDs"] +git-tree-sha1 = "f1f03a9fa24271160ed7e73051fba3c1a759b53f" +uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +version = "1.4.0" + +[[deps.BitFlags]] +git-tree-sha1 = "2dc09997850d68179b69dafb58ae806167a32b1b" +uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" +version = "0.1.8" + +[[deps.Blosc]] +deps = ["Blosc_jll"] +git-tree-sha1 = "310b77648d38c223d947ff3f50f511d08690b8d5" +uuid = "a74b3585-a348-5f62-a45c-50e91977d574" +version = "0.7.3" + +[[deps.Blosc_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "19b98ee7e3db3b4eff74c5c9c72bf32144e24f10" +uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9" +version = "1.21.5+0" + +[[deps.Bzip2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "19a35467a82e236ff51bc17a3a44b69ef35185a2" +uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" +version = "1.0.8+0" + +[[deps.CEnum]] +git-tree-sha1 = "eb4cb44a499229b3b8426dcfb5dd85333951ff90" +uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" +version = "0.4.2" + +[[deps.CSV]] +deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "PrecompileTools", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings", "WorkerUtilities"] +git-tree-sha1 = "44dbf560808d49041989b8a96cae4cffbeb7966a" +uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +version = "0.10.11" + +[[deps.Cbc]] +deps = ["Cbc_jll", "MathOptInterface", "SparseArrays"] +git-tree-sha1 = "53748bbb94ce592cfd5394528abc822f774f0d38" +uuid = "9961bab8-2fa3-5c5a-9d89-47fab24efd76" +version = "1.2.0" + +[[deps.Cbc_jll]] +deps = ["ASL_jll", "Artifacts", "Cgl_jll", "Clp_jll", "CoinUtils_jll", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "OpenBLAS32_jll", "Osi_jll", "Pkg"] +git-tree-sha1 = "1d12b6aa435f30bd5619e0144f4c815c854a91b6" +uuid = "38041ee0-ae04-5750-a4d2-bb4d0d83d27d" +version = "200.1000.800+0" + +[[deps.Cgl_jll]] +deps = ["Artifacts", "Clp_jll", "CoinUtils_jll", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Osi_jll", "Pkg"] +git-tree-sha1 = "3e53a23c0bf96e8c0115777e351a04d5b0f52529" +uuid = "3830e938-1dd0-5f3e-8b8e-b3ee43226782" +version = "0.6000.600+0" + +[[deps.ChainRulesCore]] +deps = ["Compat", "LinearAlgebra", "SparseArrays"] +git-tree-sha1 = "2118cb2765f8197b08e5958cdd17c165427425ee" +uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" +version = "1.19.0" + +[[deps.ChangesOfVariables]] +deps = ["InverseFunctions", "LinearAlgebra", "Test"] +git-tree-sha1 = "2fba81a302a7be671aefe194f0525ef231104e7f" +uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" +version = "0.1.8" + +[[deps.Clp_jll]] +deps = ["Artifacts", "CoinUtils_jll", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "METIS_jll", "MUMPS_seq_jll", "OpenBLAS32_jll", "Osi_jll", "Pkg"] +git-tree-sha1 = "51861cd16c6c4e0018ad401b2afb36e51c7d4bcd" +uuid = "06985876-5285-5a41-9fcb-8948a742cc53" +version = "100.1700.700+1" + +[[deps.CodecBzip2]] +deps = ["Bzip2_jll", "Libdl", "TranscodingStreams"] +git-tree-sha1 = "c0ae2a86b162fb5d7acc65269b469ff5b8a73594" +uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" +version = "0.8.1" + +[[deps.CodecZlib]] +deps = ["TranscodingStreams", "Zlib_jll"] +git-tree-sha1 = "cd67fc487743b2f0fd4380d4cbd3a24660d0eec8" +uuid = "944b1d66-785c-5afd-91f1-9de20f533193" +version = "0.7.3" + +[[deps.CoinUtils_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "OpenBLAS32_jll", "Pkg"] +git-tree-sha1 = "5e9852361e31af66143665e780535df262fa3407" +uuid = "be027038-0da8-5614-b30d-e42594cb92df" +version = "200.1100.600+0" + +[[deps.ColorTypes]] +deps = ["FixedPointNumbers", "Random"] +git-tree-sha1 = "eb7f0f8307f71fac7c606984ea5fb2817275d6e4" +uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" +version = "0.11.4" + +[[deps.ColorVectorSpace]] +deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "SpecialFunctions", "Statistics", "TensorCore"] +git-tree-sha1 = "600cc5508d66b78aae350f7accdb58763ac18589" +uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4" +version = "0.9.10" + +[[deps.Colors]] +deps = ["ColorTypes", "FixedPointNumbers", "Reexport"] +git-tree-sha1 = "fc08e5930ee9a4e03f84bfb5211cb54e7769758a" +uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" +version = "0.12.10" + +[[deps.CommonSolve]] +git-tree-sha1 = "0eee5eb66b1cf62cd6ad1b460238e60e4b09400c" +uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" +version = "0.2.4" + +[[deps.CommonSubexpressions]] +deps = ["MacroTools", "Test"] +git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" +uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" +version = "0.3.0" + +[[deps.Compat]] +deps = ["Dates", "LinearAlgebra", "UUIDs"] +git-tree-sha1 = "886826d76ea9e72b35fcd000e535588f7b60f21d" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "4.10.1" + +[[deps.CompilerSupportLibraries_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.0.1+0" + +[[deps.ConcurrentUtilities]] +deps = ["Serialization", "Sockets"] +git-tree-sha1 = "8cfa272e8bdedfa88b6aefbbca7c19f1befac519" +uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" +version = "2.3.0" + +[[deps.ConstructionBase]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "c53fc348ca4d40d7b371e71fd52251839080cbc9" +uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" +version = "1.5.4" + +[[deps.CoolProp]] +deps = ["CoolProp_jll", "Markdown", "Unitful"] +git-tree-sha1 = "94062163b5656b1351f7f7a784341b8fe13c1ca1" +uuid = "e084ae63-2819-5025-826e-f8e611a84251" +version = "0.1.0" + +[[deps.CoolProp_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "f0f70a17d132d2ab5bf2b61993db36ac1099f6c7" +uuid = "3351c21f-4feb-5f29-afb9-f4fcb0e27549" +version = "6.6.0+0" + +[[deps.Crayons]] +git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" +uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" +version = "4.1.1" + +[[deps.DataAPI]] +git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c" +uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" +version = "1.15.0" + +[[deps.DataFrames]] +deps = ["Compat", "DataAPI", "DataStructures", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrecompileTools", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SentinelArrays", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] +git-tree-sha1 = "04c738083f29f86e62c8afc341f0967d8717bdb8" +uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +version = "1.6.1" + +[[deps.DataStructures]] +deps = ["Compat", "InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "3dbd312d370723b6bb43ba9d02fc36abade4518d" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.18.15" + +[[deps.DataValueInterfaces]] +git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" +uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" +version = "1.0.0" + +[[deps.Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[deps.DelimitedFiles]] +deps = ["Mmap"] +uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" + +[[deps.DiffResults]] +deps = ["StaticArraysCore"] +git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621" +uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" +version = "1.1.0" + +[[deps.DiffRules]] +deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] +git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272" +uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" +version = "1.15.1" + +[[deps.DiskArrays]] +deps = ["OffsetArrays"] +git-tree-sha1 = "1bfa9de80f35ac63c6c381b2d43c590875896a1f" +uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3" +version = "0.3.22" + +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.9.3" + +[[deps.DotEnv]] +git-tree-sha1 = "d48ae0052378d697f8caf0855c4df2c54a97e580" +uuid = "4dc1fcf4-5e3b-5448-94ab-0c38ec0385c1" +version = "0.3.1" + +[[deps.Downloads]] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] +uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" +version = "1.6.0" + +[[deps.ExceptionUnwrapping]] +deps = ["Test"] +git-tree-sha1 = "e90caa41f5a86296e014e148ee061bd6c3edec96" +uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" +version = "0.1.9" + +[[deps.Expat_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "4558ab818dcceaab612d1bb8c19cee87eda2b83c" +uuid = "2e619515-83b5-522b-bb60-26c02a35a201" +version = "2.5.0+0" + +[[deps.Extents]] +git-tree-sha1 = "2140cd04483da90b2da7f99b2add0750504fc39c" +uuid = "411431e0-e8b7-467b-b5e0-f676ba4f2910" +version = "0.1.2" + +[[deps.FileIO]] +deps = ["Pkg", "Requires", "UUIDs"] +git-tree-sha1 = "299dc33549f68299137e51e6d49a13b5b1da9673" +uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" +version = "1.16.1" + +[[deps.FilePathsBase]] +deps = ["Compat", "Dates", "Mmap", "Printf", "Test", "UUIDs"] +git-tree-sha1 = "9f00e42f8d99fdde64d40c8ea5d14269a2e2c1aa" +uuid = "48062228-2e41-5def-b9a4-89aafe57970f" +version = "0.9.21" + +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[deps.FixedPointNumbers]] +deps = ["Statistics"] +git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" +uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" +version = "0.8.4" + +[[deps.ForwardDiff]] +deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions", "StaticArrays"] +git-tree-sha1 = "cf0fe81336da9fb90944683b8c41984b08793dad" +uuid = "f6369f11-7733-5829-9624-2563aa707210" +version = "0.10.36" + +[[deps.Future]] +deps = ["Random"] +uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" + +[[deps.GDAL]] +deps = ["CEnum", "GDAL_jll", "NetworkOptions", "PROJ_jll"] +git-tree-sha1 = "34705a1a6716ffea9cae844fbc66301911700bb1" +uuid = "add2ef01-049f-52c4-9ee2-e494f65e021a" +version = "1.6.1" + +[[deps.GDAL_jll]] +deps = ["Arrow_jll", "Artifacts", "Expat_jll", "GEOS_jll", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "LibPQ_jll", "Libdl", "Libtiff_jll", "NetCDF_jll", "OpenJpeg_jll", "PROJ_jll", "Pkg", "SQLite_jll", "Zlib_jll", "Zstd_jll", "libgeotiff_jll"] +git-tree-sha1 = "aa913bff49c25482fe3db2c357cb5f8127a6d2ba" +uuid = "a7073274-a066-55f0-b90d-d619367d196c" +version = "301.600.200+0" + +[[deps.GEOS_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "818ab247de98d8848a022c7be084b1283d912326" +uuid = "d604d12d-fa86-5845-992e-78dc15976526" +version = "3.11.2+0" + +[[deps.GeoFormatTypes]] +git-tree-sha1 = "59107c179a586f0fe667024c5eb7033e81333271" +uuid = "68eda718-8dee-11e9-39e7-89f7f65f511f" +version = "0.4.2" + +[[deps.GeoInterface]] +deps = ["Extents"] +git-tree-sha1 = "d4f85701f569584f2cff7ba67a137d03f0cfb7d0" +uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" +version = "1.3.3" + +[[deps.GeoInterfaceRecipes]] +deps = ["GeoInterface", "RecipesBase"] +git-tree-sha1 = "0e26e1737e94de57c858649dc28e482b6c87d341" +uuid = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" +version = "1.0.1" + +[[deps.GhpGhx]] +git-tree-sha1 = "bddcbcddc9a4ae7ae4f1ea7d4d8ccf38507d4071" +repo-rev = "main" +repo-url = "https://github.com/NREL/GhpGhx.jl.git" +uuid = "7ce85f02-24a8-4d69-a3f0-14b5daa7d30c" +version = "0.1.0" + +[[deps.Graphics]] +deps = ["Colors", "LinearAlgebra", "NaNMath"] +git-tree-sha1 = "d61890399bc535850c4bf08e4e0d3a7ad0f21cbd" +uuid = "a2bd30eb-e257-5431-a919-1863eab51364" +version = "1.1.2" + +[[deps.H5Zblosc]] +deps = ["Blosc", "HDF5"] +git-tree-sha1 = "d3966da25e48c05c31cd9786fd201627877612a2" +uuid = "c8ec2601-a99c-407f-b158-e79c03c2f5f7" +version = "0.1.1" + +[[deps.HDF5]] +deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Printf", "Random", "Requires", "UUIDs"] +git-tree-sha1 = "114e20044677badbc631ee6fdc80a67920561a29" +uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" +version = "0.16.16" + +[[deps.HDF5_jll]] +deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"] +git-tree-sha1 = "4cc2bb72df6ff40b055295fdef6d92955f9dede8" +uuid = "0234f1f7-429e-5d53-9886-15a909be8d59" +version = "1.12.2+2" + +[[deps.HTTP]] +deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] +git-tree-sha1 = "abbbb9ec3afd783a7cbd82ef01dcd088ea051398" +uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" +version = "1.10.1" + +[[deps.HiGHS]] +deps = ["HiGHS_jll", "MathOptInterface", "PrecompileTools", "SparseArrays"] +git-tree-sha1 = "fce13308f09771b160232903cad57be39a8a0ebb" +uuid = "87dc4568-4c63-4d18-b0c0-bb2238e4078b" +version = "1.7.5" + +[[deps.HiGHS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"] +git-tree-sha1 = "10bf0ecdf70f643bfc1948a6af0a98be3950a3fc" +uuid = "8fd58aa0-07eb-5a78-9b36-339c94fd15ea" +version = "1.6.0+0" + +[[deps.ImageCore]] +deps = ["AbstractFFTs", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Graphics", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "Reexport"] +git-tree-sha1 = "acf614720ef026d38400b3817614c45882d75500" +uuid = "a09fc81d-aa75-5fe9-8630-4744c3626534" +version = "0.9.4" + +[[deps.InlineStrings]] +deps = ["Parsers"] +git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" +uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" +version = "1.4.0" + +[[deps.InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[deps.IntervalSets]] +deps = ["Dates", "Random", "Statistics"] +git-tree-sha1 = "3d8866c029dd6b16e69e0d4a939c4dfcb98fac47" +uuid = "8197267c-284f-5f27-9208-e0e47529a953" +version = "0.7.8" + +[[deps.InverseFunctions]] +deps = ["Test"] +git-tree-sha1 = "68772f49f54b479fa88ace904f6127f0a3bb2e46" +uuid = "3587e190-3f89-42d0-90ee-14403ec27112" +version = "0.1.12" + +[[deps.InvertedIndices]] +git-tree-sha1 = "0dc7b50b8d436461be01300fd8cd45aa0274b038" +uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f" +version = "1.3.0" + +[[deps.IrrationalConstants]] +git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" +uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" +version = "0.2.2" + +[[deps.IterTools]] +git-tree-sha1 = "274c38bd733f9d29036d0a73658fff1dc1d3a065" +uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" +version = "1.9.0" + +[[deps.IteratorInterfaceExtensions]] +git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" +uuid = "82899510-4779-5014-852e-03e436cf321d" +version = "1.0.0" + +[[deps.JLD]] +deps = ["Compat", "FileIO", "H5Zblosc", "HDF5", "Printf"] +git-tree-sha1 = "ec6afa4fd3402e4dd5b15b3e5dd2f7dd52043ce8" +uuid = "4138dd39-2aa7-5051-a626-17a0bb65d9c8" +version = "0.13.3" + +[[deps.JLLWrappers]] +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.5.0" + +[[deps.JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.4" + +[[deps.JpegTurbo_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "60b1194df0a3298f460063de985eae7b01bc011a" +uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8" +version = "3.0.1+0" + +[[deps.JuMP]] +deps = ["LinearAlgebra", "MacroTools", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "Printf", "SnoopPrecompile", "SparseArrays"] +git-tree-sha1 = "cd161958e8b47f9696a6b03f563afb4e5fe8f703" +uuid = "4076af6c-e467-56ae-b986-b466b2749572" +version = "1.17.0" + +[[deps.Kerberos_krb5_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "60274b4ab38e8d1248216fe6b6ace75ae09b0502" +uuid = "b39eb1a6-c29a-53d7-8c32-632cd16f18da" +version = "1.19.3+0" + +[[deps.LERC_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "bf36f528eec6634efc60d7ec062008f171071434" +uuid = "88015f11-f218-50d7-93a8-a6af411a945d" +version = "3.0.0+1" + +[[deps.LZO_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "e5b909bcf985c5e2605737d2ce278ed791b89be6" +uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" +version = "2.10.1+0" + +[[deps.LaTeXStrings]] +git-tree-sha1 = "50901ebc375ed41dbf8058da26f9de442febbbec" +uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" +version = "1.3.1" + +[[deps.LibCURL]] +deps = ["LibCURL_jll", "MozillaCACerts_jll"] +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.6.3" + +[[deps.LibCURL_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] +uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" +version = "7.84.0+0" + +[[deps.LibGit2]] +deps = ["Base64", "NetworkOptions", "Printf", "SHA"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[deps.LibPQ_jll]] +deps = ["Artifacts", "JLLWrappers", "Kerberos_krb5_jll", "Libdl", "OpenSSL_jll", "Pkg"] +git-tree-sha1 = "a299629703a93d8efcefccfc16b18ad9a073d131" +uuid = "08be9ffa-1c94-5ee5-a977-46a84ec9b350" +version = "14.3.0+1" + +[[deps.LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.10.2+0" + +[[deps.Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[deps.Libiconv_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "f9557a255370125b405568f9767d6d195822a175" +uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" +version = "1.17.0+0" + +[[deps.Libtiff_jll]] +deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "LERC_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "3eb79b0ca5764d4799c06699573fd8f533259713" +uuid = "89763e89-9b03-5906-acba-b20f662cd828" +version = "4.4.0+0" + +[[deps.LinDistFlow]] +deps = ["JuMP", "LinearAlgebra", "Logging", "SparseArrays"] +git-tree-sha1 = "ad15878e716a18b82325cacc02af4533bb9777e7" +uuid = "bf674bac-ffe4-48d3-9f32-72124ffa9ede" +version = "0.1.4" + +[[deps.LinearAlgebra]] +deps = ["Libdl", "libblastrampoline_jll"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[deps.LittleCMS_jll]] +deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pkg"] +git-tree-sha1 = "110897e7db2d6836be22c18bffd9422218ee6284" +uuid = "d3a379c0-f9a3-5b72-a4c0-6bf4d2e8af0f" +version = "2.12.0+0" + +[[deps.LogExpFunctions]] +deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"] +git-tree-sha1 = "7d6dd4e9212aebaeed356de34ccf262a3cd415aa" +uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" +version = "0.3.26" + +[[deps.Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[deps.LoggingExtras]] +deps = ["Dates", "Logging"] +git-tree-sha1 = "c1dd6d7978c12545b4179fb6153b9250c96b0075" +uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" +version = "1.0.3" + +[[deps.Lz4_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "6c26c5e8a4203d43b5497be3ec5d4e0c3cde240a" +uuid = "5ced341a-0733-55b8-9ab6-a4889d929147" +version = "1.9.4+0" + +[[deps.METIS_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "1fd0a97409e418b78c53fac671cf4622efdf0f21" +uuid = "d00139f3-1899-568f-a2f0-47f597d42d70" +version = "5.1.2+0" + +[[deps.MUMPS_seq_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "METIS_jll", "OpenBLAS32_jll", "Pkg", "libblastrampoline_jll"] +git-tree-sha1 = "f429d6bbe9ad015a2477077c9e89b978b8c26558" +uuid = "d7ed1dd3-d0ae-5e8e-bfb4-87a502085b8d" +version = "500.500.101+0" + +[[deps.MacroTools]] +deps = ["Markdown", "Random"] +git-tree-sha1 = "b211c553c199c111d998ecdaf7623d1b89b69f93" +uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +version = "0.5.12" + +[[deps.MappedArrays]] +git-tree-sha1 = "2dab0221fe2b0f2cb6754eaa743cc266339f527e" +uuid = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900" +version = "0.4.2" + +[[deps.Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[deps.MathOptInterface]] +deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test", "Unicode"] +git-tree-sha1 = "362ae34a5291a79e16b8eb87b5738532c5e799ff" +uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" +version = "1.23.0" + +[[deps.MbedTLS]] +deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "NetworkOptions", "Random", "Sockets"] +git-tree-sha1 = "c067a280ddc25f196b5e7df3877c6b226d390aaf" +uuid = "739be429-bea8-5141-9913-cc70e7f3736d" +version = "1.1.9" + +[[deps.MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.0+0" + +[[deps.Missings]] +deps = ["DataAPI"] +git-tree-sha1 = "f66bdc5de519e8f8ae43bdc598782d35a25b1272" +uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" +version = "1.1.0" + +[[deps.Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[deps.MosaicViews]] +deps = ["MappedArrays", "OffsetArrays", "PaddedViews", "StackViews"] +git-tree-sha1 = "7b86a5d4d70a9f5cdf2dacb3cbe6d251d1a61dbe" +uuid = "e94cdb99-869f-56ef-bcf0-1ae2bcbe0389" +version = "0.3.4" + +[[deps.MozillaCACerts_jll]] +uuid = "14a3606d-f60d-562e-9121-12d972cd8159" +version = "2022.2.1" + +[[deps.MutableArithmetics]] +deps = ["LinearAlgebra", "SparseArrays", "Test"] +git-tree-sha1 = "806eea990fb41f9b36f1253e5697aa645bf6a9f8" +uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" +version = "1.4.0" + +[[deps.NaNMath]] +deps = ["OpenLibm_jll"] +git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" +uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" +version = "1.0.2" + +[[deps.NetCDF_jll]] +deps = ["Artifacts", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "XML2_jll", "Zlib_jll"] +git-tree-sha1 = "7f5a03e6712f5447c9c344430b8d1927a4777483" +uuid = "7243133f-43d8-5620-bbf4-c2c921802cf3" +version = "400.902.206+0" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.OffsetArrays]] +deps = ["Adapt"] +git-tree-sha1 = "6a731f2b5c03157418a20c12195eb4b74c8f8621" +uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +version = "1.13.0" + +[[deps.OpenBLAS32_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9c6c2ed4b7acd2137b878eb96c68e63b76199d0f" +uuid = "656ef2d0-ae68-5445-9ca0-591084a874a2" +version = "0.3.17+0" + +[[deps.OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.20+0" + +[[deps.OpenJpeg_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libtiff_jll", "LittleCMS_jll", "Pkg", "libpng_jll"] +git-tree-sha1 = "76374b6e7f632c130e78100b166e5a48464256f8" +uuid = "643b3616-a352-519d-856d-80112ee9badc" +version = "2.4.0+0" + +[[deps.OpenLibm_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "05823500-19ac-5b8b-9628-191a04bc5112" +version = "0.8.1+0" + +[[deps.OpenSSL]] +deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] +git-tree-sha1 = "51901a49222b09e3743c65b8847687ae5fc78eb2" +uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" +version = "1.4.1" + +[[deps.OpenSSL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "a12e56c72edee3ce6b96667745e6cbbe5498f200" +uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" +version = "1.1.23+0" + +[[deps.OpenSpecFun_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" +uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" +version = "0.5.5+0" + +[[deps.OrderedCollections]] +git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.6.3" + +[[deps.Osi_jll]] +deps = ["Artifacts", "CoinUtils_jll", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "OpenBLAS32_jll", "Pkg"] +git-tree-sha1 = "4f00d103782fb742e50886924eeea2fe722d3f7a" +uuid = "7da25872-d9ce-5375-a4d3-7a845f58efdd" +version = "0.10800.700+0" + +[[deps.PROJ_jll]] +deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "Libtiff_jll", "Pkg", "SQLite_jll"] +git-tree-sha1 = "fcb3f39ae1184a056ecc415863d46d2109aa6947" +uuid = "58948b4f-47e0-5654-a9ad-f609743f8632" +version = "900.100.0+0" + +[[deps.PaddedViews]] +deps = ["OffsetArrays"] +git-tree-sha1 = "0fac6313486baae819364c52b4f483450a9d793f" +uuid = "5432bcbf-9aad-5242-b902-cca2824c8663" +version = "0.5.12" + +[[deps.Parsers]] +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.8.1" + +[[deps.Pkg]] +deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +version = "1.8.0" + +[[deps.PooledArrays]] +deps = ["DataAPI", "Future"] +git-tree-sha1 = "36d8b4b899628fb92c2749eb488d884a926614d3" +uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" +version = "1.4.3" + +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.2.0" + +[[deps.Preferences]] +deps = ["TOML"] +git-tree-sha1 = "00805cd429dcb4870060ff49ef443486c262e38e" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.4.1" + +[[deps.PrettyTables]] +deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "Reexport", "StringManipulation", "Tables"] +git-tree-sha1 = "88b895d13d53b5577fd53379d913b9ab9ac82660" +uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" +version = "2.3.1" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[deps.Profile]] +deps = ["Printf"] +uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" + +[[deps.REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[deps.REopt]] +deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] +git-tree-sha1 = "a56f12eca2b737e9d9210000ee599920001cc303" +repo-rev = "v0.38.1" +repo-url = "https://github.com/NREL/REopt.jl.git" +uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" +version = "0.38.1" + +[[deps.Random]] +deps = ["SHA", "Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[deps.RangeArrays]] +git-tree-sha1 = "b9039e93773ddcfc828f12aadf7115b4b4d225f5" +uuid = "b3c3ace0-ae52-54e7-9d0b-2c1406fd6b9d" +version = "0.3.2" + +[[deps.RecipesBase]] +deps = ["PrecompileTools"] +git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" +uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +version = "1.3.4" + +[[deps.Reexport]] +git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" +uuid = "189a3867-3050-52da-a836-e630ba90ab69" +version = "1.2.2" + +[[deps.Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.3.0" + +[[deps.Roots]] +deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"] +git-tree-sha1 = "0f1d92463a020321983d04c110f476c274bafe2e" +uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" +version = "2.0.22" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" + +[[deps.SQLite_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"] +git-tree-sha1 = "81f7d934b52b2441f7b44520bd982fdb3607b0da" +uuid = "76ed43ae-9a5d-5a62-8c75-30186b810ce8" +version = "3.43.0+0" + +[[deps.SentinelArrays]] +deps = ["Dates", "Random"] +git-tree-sha1 = "0e7508ff27ba32f26cd459474ca2ede1bc10991f" +uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c" +version = "1.4.1" + +[[deps.Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[deps.Setfield]] +deps = ["ConstructionBase", "Future", "MacroTools", "StaticArraysCore"] +git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" +uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" +version = "1.1.1" + +[[deps.SimpleBufferStream]] +git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" +uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" +version = "1.1.0" + +[[deps.SnoopPrecompile]] +deps = ["Preferences"] +git-tree-sha1 = "e760a70afdcd461cf01a575947738d359234665c" +uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c" +version = "1.0.3" + +[[deps.Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[deps.SortingAlgorithms]] +deps = ["DataStructures"] +git-tree-sha1 = "5165dfb9fd131cf0c6957a3a7605dede376e7b63" +uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" +version = "1.2.0" + +[[deps.SparseArrays]] +deps = ["LinearAlgebra", "Random"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + +[[deps.SpecialFunctions]] +deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] +git-tree-sha1 = "e2cfc4012a19088254b3950b85c3c1d8882d864d" +uuid = "276daf66-3868-5448-9aa4-cd146d93841b" +version = "2.3.1" + +[[deps.StackViews]] +deps = ["OffsetArrays"] +git-tree-sha1 = "46e589465204cd0c08b4bd97385e4fa79a0c770c" +uuid = "cae243ae-269e-4f55-b966-ac2d0dc13c15" +version = "0.1.1" + +[[deps.StaticArrays]] +deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore", "Statistics"] +git-tree-sha1 = "fba11dbe2562eecdfcac49a05246af09ee64d055" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "1.8.1" + +[[deps.StaticArraysCore]] +git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" +uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" +version = "1.4.2" + +[[deps.Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[[deps.StringManipulation]] +deps = ["PrecompileTools"] +git-tree-sha1 = "a04cabe79c5f01f4d723cc6704070ada0b9d46d5" +uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e" +version = "0.3.4" + +[[deps.TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.0" + +[[deps.TableTraits]] +deps = ["IteratorInterfaceExtensions"] +git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" +uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" +version = "1.0.1" + +[[deps.Tables]] +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"] +git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d" +uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +version = "1.11.1" + +[[deps.Tar]] +deps = ["ArgTools", "SHA"] +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.10.1" + +[[deps.TensorCore]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "1feb45f88d133a655e001435632f019a9a1bcdb6" +uuid = "62fd8b95-f654-4bbd-a8a5-9c27f68ccd50" +version = "0.1.1" + +[[deps.Test]] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[deps.TestEnv]] +deps = ["Pkg"] +git-tree-sha1 = "c35f69c951ac4f74b8b074f62dfb1e169b351497" +uuid = "1e6cf692-eddd-4d53-88a5-2d735e33781b" +version = "1.101.1" + +[[deps.Thrift_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "boost_jll"] +git-tree-sha1 = "fd7da49fae680c18aa59f421f0ba468e658a2d7a" +uuid = "e0b8ae26-5307-5830-91fd-398402328850" +version = "0.16.0+0" + +[[deps.TranscodingStreams]] +deps = ["Random", "Test"] +git-tree-sha1 = "1fbeaaca45801b4ba17c251dd8603ef24801dd84" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.10.2" + +[[deps.URIs]] +git-tree-sha1 = "67db6cc7b3821e19ebe75791a9dd19c9b1188f2b" +uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" +version = "1.5.1" + +[[deps.UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[deps.Unitful]] +deps = ["ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "Random"] +git-tree-sha1 = "3c793be6df9dd77a0cf49d80984ef9ff996948fa" +uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" +version = "1.19.0" + +[[deps.WeakRefStrings]] +deps = ["DataAPI", "InlineStrings", "Parsers"] +git-tree-sha1 = "b1be2855ed9ed8eac54e5caff2afcdb442d52c23" +uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5" +version = "1.4.2" + +[[deps.WorkerUtilities]] +git-tree-sha1 = "cd1659ba0d57b71a464a29e64dbc67cfe83d54e7" +uuid = "76eceee3-57b5-4d4a-8e66-0e911cebbf60" +version = "1.6.1" + +[[deps.XML2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] +git-tree-sha1 = "801cbe47eae69adc50f36c3caec4758d2650741b" +uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" +version = "2.12.2+0" + +[[deps.Zlib_jll]] +deps = ["Libdl"] +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.12+3" + +[[deps.Zstd_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "49ce682769cd5de6c72dcf1b94ed7790cd08974c" +uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" +version = "1.5.5+0" + +[[deps.boost_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "7a89efe0137720ca82f99e8daa526d23120d0d37" +uuid = "28df3c45-c428-5900-9ff8-a3135698ca75" +version = "1.76.0+1" + +[[deps.libblastrampoline_jll]] +deps = ["Artifacts", "Libdl", "OpenBLAS_jll"] +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.1.1+0" + +[[deps.libgeotiff_jll]] +deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "Libtiff_jll", "PROJ_jll", "Pkg"] +git-tree-sha1 = "13dfba87a1fe301c4b40f991d0ec990bbee59bbe" +uuid = "06c338fa-64ff-565b-ac2f-249532af990e" +version = "100.700.100+0" + +[[deps.libpng_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"] +git-tree-sha1 = "93284c28274d9e75218a416c65ec49d0e0fcdf3d" +uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" +version = "1.6.40+0" + +[[deps.nghttp2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +version = "1.48.0+0" + +[[deps.p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" +version = "17.4.0+0" + +[[deps.snappy_jll]] +deps = ["Artifacts", "JLLWrappers", "LZO_jll", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "985c1da710b0e43f7c52f037441021dfd0e3be14" +uuid = "fe1e1685-f7be-5f59-ac9f-4ca204017dfd" +version = "1.1.9+1" diff --git a/julia_src/highs/Project.toml b/julia_src/highs/Project.toml new file mode 100644 index 000000000..4ab258b23 --- /dev/null +++ b/julia_src/highs/Project.toml @@ -0,0 +1,16 @@ +[deps] +AxisArrays = "39de3d68-74b9-583c-8d2d-e117c070f3a9" +Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76" +DotEnv = "4dc1fcf4-5e3b-5448-94ab-0c38ec0385c1" +GhpGhx = "7ce85f02-24a8-4d69-a3f0-14b5daa7d30c" +HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" +HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b" +JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +JuMP = "4076af6c-e467-56ae-b986-b466b2749572" +MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" +MutableArithmetics = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" +PROJ_jll = "58948b4f-47e0-5654-a9ad-f609743f8632" +REopt = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" + +[compat] +PROJ_jll = "900.0.0" diff --git a/julia_src/highs/http.jl b/julia_src/highs/http.jl new file mode 100644 index 000000000..abd943c5a --- /dev/null +++ b/julia_src/highs/http.jl @@ -0,0 +1,481 @@ +using HTTP, JSON, JuMP +using HiGHS, Cbc +using REopt +using GhpGhx +using DotEnv +DotEnv.config() + +const test_nrel_developer_api_key = ENV["NREL_DEVELOPER_API_KEY"] + +function reopt(req::HTTP.Request) + d = JSON.parse(String(req.body)) + settings = d["Settings"] + if !isempty(get(d, "api_key", "")) + ENV["NREL_DEVELOPER_API_KEY"] = pop!(d, "api_key") + else + ENV["NREL_DEVELOPER_API_KEY"] = test_nrel_developer_api_key + delete!(d, "api_key") + end + timeout_seconds = convert(Float64, pop!(settings, "timeout_seconds")) + optimality_tolerance = pop!(settings, "optimality_tolerance") + run_bau = pop!(settings, "run_bau") + ms = nothing + if run_bau + m1 = Model(optimizer_with_attributes(HiGHS.Optimizer, + "time_limit" => timeout_seconds, + "mip_rel_gap" => optimality_tolerance, + "output_flag" => false, "log_to_console" => false) + ) + m2 = Model(optimizer_with_attributes(HiGHS.Optimizer, + "time_limit" => timeout_seconds, + "mip_rel_gap" => optimality_tolerance, + "output_flag" => false, "log_to_console" => false) + ) + ms = [m1, m2] + else + ms = Model(optimizer_with_attributes(HiGHS.Optimizer, + "time_limit" => timeout_seconds, + "mip_rel_gap" => optimality_tolerance, + "output_flag" => false, "log_to_console" => false) + ) + end + @info "Starting REopt..." + error_response = Dict() + results = Dict() + inputs_with_defaults_set_in_julia = Dict() + model_inputs = nothing + # Catch handled/unhandled exceptions in data pre-processing, JuMP setup + try + model_inputs = REoptInputs(d) + catch e + @error "Something went wrong during REopt inputs processing!" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) + end + + if isa(model_inputs, Dict) && model_inputs["status"] == "error" + results = model_inputs + else + # Catch handled/unhandled exceptions in optimization + try + results = run_reopt(ms, model_inputs) + inputs_with_defaults_from_easiur = [ + :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, + :NOx_cost_escalation_rate_fraction, :SO2_cost_escalation_rate_fraction, :PM25_cost_escalation_rate_fraction + ] + inputs_with_defaults_from_avert = [ + :emissions_factor_series_lb_CO2_per_kwh, :emissions_factor_series_lb_NOx_per_kwh, + :emissions_factor_series_lb_SO2_per_kwh, :emissions_factor_series_lb_PM25_per_kwh + ] + if haskey(d, "CHP") + inputs_with_defaults_from_chp = [ + :installed_cost_per_kw, :tech_sizes_for_cost_curve, :om_cost_per_kwh, + :electric_efficiency_full_load, :thermal_efficiency_full_load, :min_allowable_kw, + :cooling_thermal_factor, :min_turn_down_fraction, :unavailability_periods, :max_kw, + :size_class, :electric_efficiency_half_load, :thermal_efficiency_half_load + ] + chp_dict = Dict(key=>getfield(model_inputs.s.chp, key) for key in inputs_with_defaults_from_chp) + else + chp_dict = Dict() + end + if haskey(d, "SteamTurbine") + inputs_with_defaults_from_steamturbine = [ + :size_class, :gearbox_generator_efficiency, :isentropic_efficiency, + :inlet_steam_pressure_psig, :inlet_steam_temperature_degF, :installed_cost_per_kw, :om_cost_per_kwh, + :outlet_steam_pressure_psig, :net_to_gross_electric_ratio, :electric_produced_to_thermal_consumed_ratio, + :thermal_produced_to_thermal_consumed_ratio + ] + steamturbine_dict = Dict(key=>getfield(model_inputs.s.steam_turbine, key) for key in inputs_with_defaults_from_steamturbine) + else + steamturbine_dict = Dict() + end + if haskey(d, "GHP") + inputs_with_defaults_from_ghp = [ + :space_heating_efficiency_thermal_factor, + :cooling_efficiency_thermal_factor + ] + ghp_dict = Dict(key=>getfield(model_inputs.s.ghp_option_list[1], key) for key in inputs_with_defaults_from_ghp) + else + ghp_dict = Dict() + end + if haskey(d, "CoolingLoad") + inputs_with_defaults_from_chiller = [ + :cop + ] + chiller_dict = Dict(key=>getfield(model_inputs.s.existing_chiller, key) for key in inputs_with_defaults_from_chiller) + else + chiller_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_easiur), + "ElectricUtility" => Dict(key=>getfield(model_inputs.s.electric_utility, key) for key in inputs_with_defaults_from_avert), + "CHP" => chp_dict, + "SteamTurbine" => steamturbine_dict, + "GHP" => ghp_dict, + "ExistingChiller" => chiller_dict + ) + catch e + @error "Something went wrong in REopt optimization!" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) # append instead of rewrite? + end + end + + if typeof(ms) <: AbstractArray + finalize(backend(ms[1])) + finalize(backend(ms[2])) + empty!(ms[1]) + empty!(ms[2]) + else + finalize(backend(ms)) + empty!(ms) + end + GC.gc() + + if isempty(error_response) + @info "REopt model solved with status $(results["status"])." + if results["status"] == "error" + response = Dict( + "results" => results + ) + if !isempty(inputs_with_defaults_set_in_julia) + response["inputs_with_defaults_set_in_julia"] = inputs_with_defaults_set_in_julia + end + return HTTP.Response(400, JSON.json(response)) + else + response = Dict( + "results" => results, + "inputs_with_defaults_set_in_julia" => inputs_with_defaults_set_in_julia + ) + return HTTP.Response(200, JSON.json(response)) + end + else + @info "An error occured in the Julia code." + return HTTP.Response(500, JSON.json(error_response)) + end +end + +function erp(req::HTTP.Request) + erp_inputs = JSON.parse(String(req.body)) + + @info "Starting ERP..." + error_response = Dict() + results = Dict() + try + results = backup_reliability(erp_inputs) + catch e + @error "Something went wrong in the ERP Julia code!" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) + end + GC.gc() + if isempty(error_response) + @info "ERP ran successfully." + return HTTP.Response(200, JSON.json(results)) + else + return HTTP.Response(500, JSON.json(error_response)) + end +end + + +function ghpghx(req::HTTP.Request) + inputs_dict = JSON.parse(String(req.body)) + pop!(inputs_dict, "status") + @info "Starting GHPGHX" + results, inputs_params = GhpGhx.ghp_model(inputs_dict) + # Create a dictionary of the results data needed for REopt + ghpghx_results = GhpGhx.get_results_for_reopt(results, inputs_params) + @info "GHPGHX model solved" + return HTTP.Response(200, JSON.json(ghpghx_results)) +end + +function chp_defaults(req::HTTP.Request) + d = JSON.parse(String(req.body)) + string_vals = ["hot_water_or_steam", "prime_mover"] + float_vals = ["avg_boiler_fuel_load_mmbtu_per_hour", + "boiler_efficiency", + "avg_electric_load_kw", + "max_electric_load_kw"] + int_vals = ["size_class"] + bool_vals = ["is_electric_only"] + all_vals = vcat(string_vals, float_vals, int_vals, bool_vals) + # Process .json inputs and convert to correct type if needed + for k in all_vals + if !haskey(d, k) + d[k] = nothing + elseif !isnothing(d[k]) + if k in float_vals && typeof(d[k]) == String + d[k] = parse(Float64, d[k]) + elseif k in int_vals && typeof(d[k]) == String + d[k] = parse(Int64, d[k]) + elseif k in bool_vals && typeof(d[k]) == String + d[k] = parse(Bool, d[k]) + end + end + end + + @info "Getting CHP defaults..." + data = Dict() + error_response = Dict() + try + d_symb = REopt.dictkeys_tosymbols(d) + if haskey(d_symb, :prime_mover) && d_symb[:prime_mover] == "steam_turbine" + # delete!(d_symb, :prime_mover) + data = REopt.get_steam_turbine_defaults_size_class(; + avg_boiler_fuel_load_mmbtu_per_hour=get(d_symb, :avg_boiler_fuel_load_mmbtu_per_hour, nothing), + size_class=get(d_symb, :size_class, nothing)) + else + data = get_chp_defaults_prime_mover_size_class(;d_symb...) + end + catch e + @error "Something went wrong in the chp_defaults endpoint" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) + end + if isempty(error_response) + @info "CHP defaults determined." + response = data + return HTTP.Response(200, JSON.json(response)) + else + @info "An error occured in the chp_defaults endpoint" + return HTTP.Response(500, JSON.json(error_response)) + end +end + +function absorption_chiller_defaults(req::HTTP.Request) + d = JSON.parse(String(req.body)) + keys = ["thermal_consumption_hot_water_or_steam", + "chp_prime_mover", + "boiler_type", + "load_max_tons"] + # Process .json inputs and convert to correct type if needed + for k in keys + if !haskey(d, k) + d[k] = nothing + elseif !isnothing(d[k]) + if k in ["load_max_tons"] && typeof(d[k]) == String + d[k] = parse(Float64, d[k]) + elseif k in ["load_max_tons"] && typeof(d[k]) == Int64 + d[k] = convert(Float64, d[k]) + end + end + end + + @info "Getting AbsorptionChiller defaults..." + data = Dict() + error_response = Dict() + try + data = get_absorption_chiller_defaults(; + thermal_consumption_hot_water_or_steam=d["thermal_consumption_hot_water_or_steam"], + chp_prime_mover=d["chp_prime_mover"], + boiler_type=d["boiler_type"], + load_max_tons=d["load_max_tons"]) + catch e + @error "Something went wrong in the absorption_chiller_defaults" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) + end + if isempty(error_response) + @info "AbsorptionChiller defaults determined." + response = data + return HTTP.Response(200, JSON.json(response)) + else + @info "An error occured in the absorption_chiller_defaults endpoint" + return HTTP.Response(500, JSON.json(error_response)) + end +end + +function emissions_profile(req::HTTP.Request) + d = JSON.parse(String(req.body)) + @info "Getting emissions profile..." + data = Dict() + error_response = Dict() + try + latitude = typeof(d["latitude"]) == String ? parse(Float64, d["latitude"]) : d["latitude"] + longitude = typeof(d["longitude"]) == String ? parse(Float64, d["longitude"]) : d["longitude"] + data = emissions_profiles(;latitude=latitude, longitude=longitude, time_steps_per_hour=1) + if haskey(data, "error") + @info "An error occured getting the emissions data" + return HTTP.Response(400, JSON.json(data)) + end + catch e + @error "Something went wrong getting the emissions data" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) + return HTTP.Response(500, JSON.json(error_response)) + end + @info "Emissions profile determined." + return HTTP.Response(200, JSON.json(data)) +end + +function easiur_costs(req::HTTP.Request) + d = JSON.parse(String(req.body)) + @info "Getting EASIUR health emissions cost data..." + data = Dict() + error_response = Dict() + try + latitude = typeof(d["latitude"]) == String ? parse(Float64, d["latitude"]) : d["latitude"] + longitude = typeof(d["longitude"]) == String ? parse(Float64, d["longitude"]) : d["longitude"] + inflation = typeof(d["inflation"]) == String ? parse(Float64, d["inflation"]) : d["inflation"] + data = easiur_data(;latitude=latitude, longitude=longitude, inflation=inflation) + if haskey(data, "error") + @info "An error occured getting the health emissions cost data" + return HTTP.Response(400, JSON.json(data)) + end + catch e + @error "Something went wrong getting the health emissions cost data" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) + return HTTP.Response(500, JSON.json(error_response)) + end + @info "Health emissions cost data determined." + return HTTP.Response(200, JSON.json(data)) +end + +function simulated_load(req::HTTP.Request) + d = JSON.parse(String(req.body)) + + # Arrays in d are being parsed as type Vector{Any} instead of fixed type Vector{String or <:Real} without conversion + for key in ["doe_reference_name", "cooling_doe_ref_name"] + if key in keys(d) && typeof(d[key]) <: Vector{} + d[key] = convert(Vector{String}, d[key]) + end + 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", + "monthly_tonhour", "addressable_load_fraction"] + for key in vector_types + if key in keys(d) && typeof(d[key]) <: Vector{} + d[key] = convert(Vector{Real}, 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]) + end + end + + @info "Getting CRB Loads..." + data = Dict() + error_response = Dict() + try + data = simulated_load(d) + catch e + @error "Something went wrong in the simulated_load" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) + end + if isempty(error_response) + @info "CRB Loads determined." + response = data + return HTTP.Response(200, JSON.json(response)) + else + @info "An error occured in the simulated_load 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)) + + @info "Getting ghp_efficiency_thermal_factors..." + # The REopt.jl function assumes the REopt input dictionary is being mutated, so put in that form + data = Dict([("Site", Dict([("latitude", d["latitude"]), ("longitude", d["longitude"])])), + ("SpaceHeatingLoad", Dict([("doe_reference_name", d["doe_reference_name"])])), + ("CoolingLoad", Dict([("doe_reference_name", d["doe_reference_name"])])), + ("GHP", Dict())]) + error_response = Dict() + nearest_city = "" + climate_zone = "" + try + for factor in ["space_heating", "cooling"] + nearest_city, climate_zone = REopt.assign_thermal_factor!(data, factor) + end + catch e + @error "Something went wrong in the ghp_efficiency_thermal_factors" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) + end + if isempty(error_response) + @info "ghp_efficiency_thermal_factors determined." + response = Dict([("doe_reference_name", d["doe_reference_name"]), + ("nearest_city", nearest_city), + ("climate_zone", climate_zone), + data["GHP"]...]) + return HTTP.Response(200, JSON.json(response)) + else + @info "An error occured in the ghp_efficiency_thermal_factors endpoint" + return HTTP.Response(500, JSON.json(error_response)) + end +end + +function ground_conductivity(req::HTTP.Request) + d = JSON.parse(String(req.body)) + + @info "Getting ground_conductivity..." + error_response = Dict() + nearest_city = "" + climate_zone = "" + ground_thermal_conductivity = 0.01 + try + nearest_city, climate_zone = REopt.find_ashrae_zone_city(d["latitude"], d["longitude"], get_zone=true) + ground_thermal_conductivity = GhpGhx.ground_k_by_climate_zone[climate_zone] + catch e + @error "Something went wrong in the ground_conductivity" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) + end + if isempty(error_response) + @info "ground_conductivity determined." + response = Dict([("climate_zone", climate_zone), + ("nearest_city", nearest_city), + ("thermal_conductivity", ground_thermal_conductivity)]) + return HTTP.Response(200, JSON.json(response)) + else + @info "An error occured in the ground_conductivity endpoint" + return HTTP.Response(500, JSON.json(error_response)) + end +end + +function health(req::HTTP.Request) + return HTTP.Response(200, JSON.json(Dict("Julia-api"=>"healthy!"))) +end + +function get_existing_chiller_default_cop(req::HTTP.Request) + d = JSON.parse(String(req.body)) + chiller_cop = nothing + + for key in ["existing_chiller_max_thermal_factor_on_peak_load","max_load_kw","max_load_kw_thermal"] + if !(key in keys(d)) + d[key] = nothing + end + end + + @info "Getting default existing chiller COP..." + error_response = Dict() + try + chiller_cop = get_existing_chiller_default_cop(; + existing_chiller_max_thermal_factor_on_peak_load=d["existing_chiller_max_thermal_factor_on_peak_load"], + max_load_kw=d["max_load_kw"], + max_load_kw_thermal=d["max_load_kw_thermal"]) + catch e + @error "Something went wrong in the get_existing_chiller_default_cop" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) + end + if isempty(error_response) + @info("Default existing chiller COP detected.") + response = Dict([("existing_chiller_cop", chiller_cop)]) + return HTTP.Response(200, JSON.json(response)) + else + @info "An error occured in the get_existing_chiller_default_cop endpoint" + return HTTP.Response(500, JSON.json(error_response)) + end +end + +# define REST endpoints to dispatch to "service" functions +const ROUTER = HTTP.Router() + +# HTTP.register!(ROUTER, "POST", "/job", job) +HTTP.register!(ROUTER, "POST", "/reopt", reopt) +HTTP.register!(ROUTER, "POST", "/erp", erp) +HTTP.register!(ROUTER, "POST", "/ghpghx", ghpghx) +HTTP.register!(ROUTER, "GET", "/chp_defaults", chp_defaults) +HTTP.register!(ROUTER, "GET", "/emissions_profile", emissions_profile) +HTTP.register!(ROUTER, "GET", "/easiur_costs", easiur_costs) +HTTP.register!(ROUTER, "GET", "/simulated_load", simulated_load) +HTTP.register!(ROUTER, "GET", "/absorption_chiller_defaults", absorption_chiller_defaults) +HTTP.register!(ROUTER, "GET", "/ghp_efficiency_thermal_factors", ghp_efficiency_thermal_factors) +HTTP.register!(ROUTER, "GET", "/ground_conductivity", ground_conductivity) +HTTP.register!(ROUTER, "GET", "/health", health) +HTTP.register!(ROUTER, "GET", "/get_existing_chiller_default_cop", get_existing_chiller_default_cop) +HTTP.serve(ROUTER, "0.0.0.0", 8081, reuseaddr=true) diff --git a/julia_src/highs/precompile.jl b/julia_src/highs/precompile.jl new file mode 100644 index 000000000..d1cca2d46 --- /dev/null +++ b/julia_src/highs/precompile.jl @@ -0,0 +1,10 @@ +using AxisArrays +using HTTP +using JSON +using JuMP +using MathOptInterface +using MutableArithmetics +using REopt +using GhpGhx +using HiGHS +using Cbc \ No newline at end of file From 3a6b3912c1434cdeea43e01b35b7241f99eddf1f Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 12:03:26 -0700 Subject: [PATCH 09/46] Move V2 Julia env into xpress folder --- julia_src/xpress/Dockerfile | 2 -- julia_src/{ => xpress}/Manifest.toml | 0 julia_src/{ => xpress}/Project.toml | 0 julia_src/{ => xpress}/REopt.jl | 0 julia_src/{ => xpress}/http.jl | 1 + julia_src/{ => xpress}/precompile.jl | 0 julia_src/{ => xpress}/reopt_model.jl | 0 julia_src/{ => xpress}/types.jl | 0 julia_src/{ => xpress}/utils.jl | 0 julia_src/{ => xpress}/xpress_model.jl | 0 10 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 julia_src/xpress/Dockerfile rename julia_src/{ => xpress}/Manifest.toml (100%) rename julia_src/{ => xpress}/Project.toml (100%) rename julia_src/{ => xpress}/REopt.jl (100%) rename julia_src/{ => xpress}/http.jl (99%) rename julia_src/{ => xpress}/precompile.jl (100%) rename julia_src/{ => xpress}/reopt_model.jl (100%) rename julia_src/{ => xpress}/types.jl (100%) rename julia_src/{ => xpress}/utils.jl (100%) rename julia_src/{ => xpress}/xpress_model.jl (100%) diff --git a/julia_src/xpress/Dockerfile b/julia_src/xpress/Dockerfile deleted file mode 100644 index c3af507c0..000000000 --- a/julia_src/xpress/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM ubuntu:latest -# For creating base image of Julia API diff --git a/julia_src/Manifest.toml b/julia_src/xpress/Manifest.toml similarity index 100% rename from julia_src/Manifest.toml rename to julia_src/xpress/Manifest.toml diff --git a/julia_src/Project.toml b/julia_src/xpress/Project.toml similarity index 100% rename from julia_src/Project.toml rename to julia_src/xpress/Project.toml diff --git a/julia_src/REopt.jl b/julia_src/xpress/REopt.jl similarity index 100% rename from julia_src/REopt.jl rename to julia_src/xpress/REopt.jl diff --git a/julia_src/http.jl b/julia_src/xpress/http.jl similarity index 99% rename from julia_src/http.jl rename to julia_src/xpress/http.jl index 7d9955c67..9cb0f93f0 100644 --- a/julia_src/http.jl +++ b/julia_src/xpress/http.jl @@ -1,6 +1,7 @@ using HTTP, JSON, JuMP import Xpress include("REopt.jl") +using GhpGhx import REopt as reoptjl using GhpGhx using DotEnv diff --git a/julia_src/precompile.jl b/julia_src/xpress/precompile.jl similarity index 100% rename from julia_src/precompile.jl rename to julia_src/xpress/precompile.jl diff --git a/julia_src/reopt_model.jl b/julia_src/xpress/reopt_model.jl similarity index 100% rename from julia_src/reopt_model.jl rename to julia_src/xpress/reopt_model.jl diff --git a/julia_src/types.jl b/julia_src/xpress/types.jl similarity index 100% rename from julia_src/types.jl rename to julia_src/xpress/types.jl diff --git a/julia_src/utils.jl b/julia_src/xpress/utils.jl similarity index 100% rename from julia_src/utils.jl rename to julia_src/xpress/utils.jl diff --git a/julia_src/xpress_model.jl b/julia_src/xpress/xpress_model.jl similarity index 100% rename from julia_src/xpress_model.jl rename to julia_src/xpress/xpress_model.jl From 028d7b3264c898cf395dd405aca57285811d24c7 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 12:06:00 -0700 Subject: [PATCH 10/46] Remove gfortran install for general/unused Dockerfile --- julia_src/Dockerfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/julia_src/Dockerfile b/julia_src/Dockerfile index be6838401..79a69e121 100644 --- a/julia_src/Dockerfile +++ b/julia_src/Dockerfile @@ -5,10 +5,6 @@ ARG NREL_ROOT_CERT_URL_ROOT="" RUN set -x && if [ -n "$NREL_ROOT_CERT_URL_ROOT" ]; then curl -fsSLk -o /usr/local/share/ca-certificates/nrel_root.crt "${NREL_ROOT_CERT_URL_ROOT}/nrel_root.pem" && curl -fsSLk -o /usr/local/share/ca-certificates/nrel_xca1.crt "${NREL_ROOT_CERT_URL_ROOT}/nrel_xca1.pem" && update-ca-certificates; fi ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt -# Install gfortran for /ghpghx -RUN apt-get update && apt-get install -y \ - gfortran - # Install Julia packages ENV JULIA_NUM_THREADS=2 WORKDIR /opt/julia_src/ From d5f11ca4116ecf56b4ab1f726ef56292e14cf30b Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 12:07:40 -0700 Subject: [PATCH 11/46] .gitignore NREL-production solver files --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index b57ebff2f..ecf8e4fe2 100755 --- a/.gitignore +++ b/.gitignore @@ -115,3 +115,8 @@ docs/formulation/*aux docs/formulation/*log /.werf_secret_key + +# Customized solver setup and docker files +julia_src/xpress/licenseserver +julia_src/Dockerfile.xpress +docker-compose.xpress.yml From 669cdf6e8428d66c05f211fcbe8652e3b7d66a84 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 12:08:52 -0700 Subject: [PATCH 12/46] WIP updates to GitHub Actions/workflows tests --- .github/disabled_cbc_workflows/push_test_cbc.yml | 2 +- .github/workflows/pull_request_tests.yml | 14 ++++++++------ .github/workflows/push_tests.yml | 14 ++++++++------ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/disabled_cbc_workflows/push_test_cbc.yml b/.github/disabled_cbc_workflows/push_test_cbc.yml index 6cdee3f12..619bc4bcd 100644 --- a/.github/disabled_cbc_workflows/push_test_cbc.yml +++ b/.github/disabled_cbc_workflows/push_test_cbc.yml @@ -26,4 +26,4 @@ jobs: - name: Check django logs run: docker logs django - name: test - run: docker-compose exec -T celery python manage.py test reo.tests.test_custom_rates reo.tests.test_demand_ratchet -v 2 --failfast --no-input + run: docker-compose exec -T celery python manage.py test reoptjl.test.test_job_endpoint -v 2 --failfast --no-input diff --git a/.github/workflows/pull_request_tests.yml b/.github/workflows/pull_request_tests.yml index 935fca926..2f9975c55 100644 --- a/.github/workflows/pull_request_tests.yml +++ b/.github/workflows/pull_request_tests.yml @@ -18,10 +18,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Decrypt - env: - TRANSCRYPT_PASSWORD: ${{ secrets.TRANSCRYPT_PASSWORD }} - run: ./.github/scripts/decrypt.sh + # - name: Decrypt + # env: + # TRANSCRYPT_PASSWORD: ${{ secrets.TRANSCRYPT_PASSWORD }} + # run: ./.github/scripts/decrypt.sh - name: Make keys.py env: NREL_DEV_API_KEY: ${{ secrets.NREL_DEV_API_KEY }} @@ -34,5 +34,7 @@ jobs: uses: jakejarvis/wait-action@master with: time: '150s' - - name: test - run: docker exec reopt_api_celery_1 python manage.py test -v 2 --failfast --no-input + - name: test v3 validator + run: docker exec reopt_api_celery_1 python manage.py test reoptjl.test.test_validator -v 2 --failfast --no-input + - name: test v3 http.jl endpoints + run: docker exec reopt_api_celery_1 python manage.py test reoptjl.test.test_http_endpoints -v 2 --failfast --no-input diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index 5be16a9f6..e36dbb517 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -14,10 +14,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Decrypt - env: - TRANSCRYPT_PASSWORD: ${{ secrets.TRANSCRYPT_PASSWORD }} - run: ./.github/scripts/decrypt.sh + # - name: Decrypt + # env: + # TRANSCRYPT_PASSWORD: ${{ secrets.TRANSCRYPT_PASSWORD }} + # run: ./.github/scripts/decrypt.sh - name: Make keys.py env: NREL_DEV_API_KEY: ${{ secrets.NREL_DEV_API_KEY }} @@ -30,5 +30,7 @@ jobs: uses: jakejarvis/wait-action@master with: time: '150s' - - name: test - run: docker exec reopt_api_celery_1 python manage.py test -v 2 --failfast --no-input + - name: test v3 validator + run: docker exec reopt_api_celery_1 python manage.py test reoptjl.test.test_validator -v 2 --failfast --no-input + - name: test v3 http.jl endpoints + run: docker exec reopt_api_celery_1 python manage.py test reoptjl.test.test_http_endpoints -v 2 --failfast --no-input From 61d1e08ce0bb9897fe1fe14aed209f5c93067fda Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 12:09:40 -0700 Subject: [PATCH 13/46] Update nginx setup to use HiGHS/Cbc solver --- julia_src/run_julia_servers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia_src/run_julia_servers.sh b/julia_src/run_julia_servers.sh index a5518e97e..15709c731 100644 --- a/julia_src/run_julia_servers.sh +++ b/julia_src/run_julia_servers.sh @@ -6,7 +6,7 @@ echo "starting $1 julia servers ..." for (( c=$START; c<=$END; c++ )) do - julia --project=/opt/julia_src http.jl & + julia --project=/opt/julia_src/highs http.jl & done wait From e9f0a6a8c5e2b43332131dad2abe424d6b559382 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 12:10:21 -0700 Subject: [PATCH 14/46] Comment out unneeded decrypt.sh for GitHub Actions/workflows --- .github/scripts/decrypt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/decrypt.sh b/.github/scripts/decrypt.sh index 92f53d53b..32d3ae913 100755 --- a/.github/scripts/decrypt.sh +++ b/.github/scripts/decrypt.sh @@ -1,6 +1,6 @@ #!/bin/sh -transcrypt/transcrypt --flush-credentials -y || true -transcrypt/transcrypt -c aes-256-cbc -p "$TRANSCRYPT_PASSWORD" -y +# transcrypt/transcrypt --flush-credentials -y || true +# transcrypt/transcrypt -c aes-256-cbc -p "$TRANSCRYPT_PASSWORD" -y From 303625d46354f8903c63bf3d5b20fbc9b0f147d7 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 12:11:29 -0700 Subject: [PATCH 15/46] Update werf for production deploy expected Dockerfile.xpress (not in public repo) --- werf.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/werf.yaml b/werf.yaml index 014172cc6..7ae0bf673 100644 --- a/werf.yaml +++ b/werf.yaml @@ -10,7 +10,7 @@ args: --- image: julia-api context: julia_src/ -dockerfile: Dockerfile +dockerfile: Dockerfile.xpress args: XPRESS_LICENSE_HOST: {{ env "XPRESS_LICENSE_HOST" | quote }} NREL_ROOT_CERT_URL_ROOT: {{ env "NREL_ROOT_CERT_URL_ROOT" | quote }} From d3b5db435bf25d0229818b6f0fd4953c658f20f2 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 12:12:11 -0700 Subject: [PATCH 16/46] Update production julia-deployment for expected solver setup --- .helm/templates/julia-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.helm/templates/julia-deployment.yaml b/.helm/templates/julia-deployment.yaml index d7a01b461..baf8468d6 100644 --- a/.helm/templates/julia-deployment.yaml +++ b/.helm/templates/julia-deployment.yaml @@ -34,7 +34,7 @@ spec: containers: - name: {{ .Chart.Name }}-julia image: {{ index .Values.werf.image "julia-api" }} - args: ["julia", "--project=/opt/julia_src", "http.jl"] + args: ["julia", "--project=/opt/julia_src/xpress", "http.jl"] ports: - containerPort: 8081 envFrom: From 3036052a19658f336ed304d8ea33328fc9bbd8c7 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 12:13:26 -0700 Subject: [PATCH 17/46] Add TODO list for WIP solver setup --- julia_src/TODO.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 julia_src/TODO.txt diff --git a/julia_src/TODO.txt b/julia_src/TODO.txt new file mode 100644 index 000000000..9f6ecbd3f --- /dev/null +++ b/julia_src/TODO.txt @@ -0,0 +1,3 @@ +Make separate functions which all/some http.jl uses for any solver +Added HiGHS and Cbc to the same Julia env setup with http.jl, in julia_src/highs env +Add input to Settings input for choice of solver between HiGHS and Cbc \ No newline at end of file From 1a966a1f6bad275654a84d7c13bbb1c9437509df Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 12:14:25 -0700 Subject: [PATCH 18/46] Attempt to read in and assign api_key in production This is working locally but not in production because NREL strips out the api_key from the POST before it hits the REopt API --- reoptjl/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reoptjl/api.py b/reoptjl/api.py index 15d4fda65..c39303243 100644 --- a/reoptjl/api.py +++ b/reoptjl/api.py @@ -17,6 +17,7 @@ from ghpghx.models import GHPGHXInputs from django.core.exceptions import ValidationError from reoptjl.models import APIMeta +import keys log = logging.getLogger(__name__) @@ -72,7 +73,8 @@ def obj_get_list(self, bundle, **kwargs): def obj_create(self, bundle, **kwargs): run_uuid = str(uuid.uuid4()) - api_key = bundle.request.GET.get("api_key", "") + # Attempt to get POSTed api_key assigned to APIMeta.api_key (or try method below for user_uuid) + api_key = keys.developer_nrel_gov_key #bundle.request.GET.get("api_key", "") if 'user_uuid' in bundle.data.keys(): if type(bundle.data['user_uuid']) == str: From 28bc177c87e4e7a834450fbb4ffc158058d0e6f0 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 12:23:42 -0700 Subject: [PATCH 19/46] Add back NREL production pattern for transcrypt --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 1ab870755..9aa888010 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ #pattern filter=crypt diff=crypt +julia_src/xpress/licenseserver/xpauth.xpr filter=crypt diff=crypt merge=crypt \ No newline at end of file From fe08514d218351271add3551966ae33b9c2d1127 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 12:28:27 -0700 Subject: [PATCH 20/46] Fix nginx setup to use HiGHS solver --- docker-compose.nginx.yml | 1 + julia_src/run_julia_servers.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.nginx.yml b/docker-compose.nginx.yml index 82f33693a..22ab2b231 100644 --- a/docker-compose.nginx.yml +++ b/docker-compose.nginx.yml @@ -78,6 +78,7 @@ services: container_name: julia-nginx build: context: julia_src/ + dockerfile: Dockerfile.highs command: bash ./run_julia_servers.sh 8 environment: - JULIA_NUM_THREADS=2 diff --git a/julia_src/run_julia_servers.sh b/julia_src/run_julia_servers.sh index 15709c731..45b65a40e 100644 --- a/julia_src/run_julia_servers.sh +++ b/julia_src/run_julia_servers.sh @@ -6,7 +6,7 @@ echo "starting $1 julia servers ..." for (( c=$START; c<=$END; c++ )) do - julia --project=/opt/julia_src/highs http.jl & + julia --project=/opt/julia_src/highs highs/http.jl & done wait From e9ddabd5e8b00f75abc08b92a3dbddb2ca2972c3 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 13:12:10 -0700 Subject: [PATCH 21/46] Use docker-compose.highs for Git Workflows --- .github/workflows/pull_request_tests.yml | 2 +- .github/workflows/push_tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request_tests.yml b/.github/workflows/pull_request_tests.yml index 2f9975c55..38519f7f9 100644 --- a/.github/workflows/pull_request_tests.yml +++ b/.github/workflows/pull_request_tests.yml @@ -27,7 +27,7 @@ jobs: NREL_DEV_API_KEY: ${{ secrets.NREL_DEV_API_KEY }} run: ./.github/scripts/make_keys.py.sh - name: Build containers - run: docker-compose up -d + run: docker-compose -f docker-compose.highs.yml up -d - name: Check running containers run: docker ps -a - name: Wait for julia_api diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index e36dbb517..8095c022e 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -23,7 +23,7 @@ jobs: NREL_DEV_API_KEY: ${{ secrets.NREL_DEV_API_KEY }} run: ./.github/scripts/make_keys.py.sh - name: Build containers - run: docker-compose up -d + run: docker-compose -f docker-compose.highs.yml up -d - name: Check running containers run: docker ps -a - name: Wait for julia_api From bbaa63136246ceadf6c3ffa54dd4d7463bab0c42 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 13:19:26 -0700 Subject: [PATCH 22/46] Add empty line after crypt pattern --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 9aa888010..25f76e523 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ #pattern filter=crypt diff=crypt -julia_src/xpress/licenseserver/xpauth.xpr filter=crypt diff=crypt merge=crypt \ No newline at end of file +julia_src/xpress/licenseserver/xpauth.xpr filter=crypt diff=crypt merge=crypt From 52b7517c57d8fcaf6a45d030de3b859c04d89694 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 13:53:30 -0700 Subject: [PATCH 23/46] Specify REopt functions when needed --- julia_src/highs/http.jl | 5 +++-- julia_src/xpress/http.jl | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/julia_src/highs/http.jl b/julia_src/highs/http.jl index abd943c5a..e9c13033b 100644 --- a/julia_src/highs/http.jl +++ b/julia_src/highs/http.jl @@ -219,7 +219,7 @@ function chp_defaults(req::HTTP.Request) d_symb = REopt.dictkeys_tosymbols(d) if haskey(d_symb, :prime_mover) && d_symb[:prime_mover] == "steam_turbine" # delete!(d_symb, :prime_mover) - data = REopt.get_steam_turbine_defaults_size_class(; + data = get_steam_turbine_defaults_size_class(; avg_boiler_fuel_load_mmbtu_per_hour=get(d_symb, :avg_boiler_fuel_load_mmbtu_per_hour, nothing), size_class=get(d_symb, :size_class, nothing)) else @@ -444,7 +444,8 @@ function get_existing_chiller_default_cop(req::HTTP.Request) @info "Getting default existing chiller COP..." error_response = Dict() try - chiller_cop = get_existing_chiller_default_cop(; + # Have to specify "REopt.get_existing..." because http function has the same name + chiller_cop = REopt.get_existing_chiller_default_cop(; existing_chiller_max_thermal_factor_on_peak_load=d["existing_chiller_max_thermal_factor_on_peak_load"], max_load_kw=d["max_load_kw"], max_load_kw_thermal=d["max_load_kw_thermal"]) diff --git a/julia_src/xpress/http.jl b/julia_src/xpress/http.jl index 9cb0f93f0..11c7ec83d 100644 --- a/julia_src/xpress/http.jl +++ b/julia_src/xpress/http.jl @@ -480,6 +480,7 @@ function get_existing_chiller_default_cop(req::HTTP.Request) @info "Getting default existing chiller COP..." error_response = Dict() try + # Have to specify "reoptjl.get_existing..." because http function has the same name chiller_cop = reoptjl.get_existing_chiller_default_cop(; existing_chiller_max_thermal_factor_on_peak_load=d["existing_chiller_max_thermal_factor_on_peak_load"], max_load_kw=d["max_load_kw"], From f7065297fa99fa6bdce85fa9c0629a16b984526c Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Thu, 28 Dec 2023 13:57:24 -0700 Subject: [PATCH 24/46] Distinguish REopt function from http endpoint for simulated_load --- julia_src/highs/http.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia_src/highs/http.jl b/julia_src/highs/http.jl index e9c13033b..95d5dc50b 100644 --- a/julia_src/highs/http.jl +++ b/julia_src/highs/http.jl @@ -352,7 +352,7 @@ function simulated_load(req::HTTP.Request) data = Dict() error_response = Dict() try - data = simulated_load(d) + data = REopt.simulated_load(d) catch e @error "Something went wrong in the simulated_load" exception=(e, catch_backtrace()) error_response["error"] = sprint(showerror, e) From e67950829b18ab2bb929958bf6b04b5040b87dd0 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Tue, 2 Jan 2024 11:43:06 -0700 Subject: [PATCH 25/46] Update Jenkins deploy scripts for production solver --- .helm/templates/julia-deployment.yaml | 2 +- Jenkinsfile | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.helm/templates/julia-deployment.yaml b/.helm/templates/julia-deployment.yaml index baf8468d6..3b77c0583 100644 --- a/.helm/templates/julia-deployment.yaml +++ b/.helm/templates/julia-deployment.yaml @@ -34,7 +34,7 @@ spec: containers: - name: {{ .Chart.Name }}-julia image: {{ index .Values.werf.image "julia-api" }} - args: ["julia", "--project=/opt/julia_src/xpress", "http.jl"] + args: ["julia", "--project=/opt/julia_src/xpress", "xpress/http.jl"] ports: - containerPort: 8081 envFrom: diff --git a/Jenkinsfile b/Jenkinsfile index ee7e6512f..ba48cf2c6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -65,12 +65,20 @@ pipeline { WERF_LOG_VERBOSE = "true" WERF_SYNCHRONIZATION = ":local" XPRESS_LICENSE_HOST = credentials("reopt-api-xpress-license-host") + LICENSESERVER_URL = credentials("reopt-api-xpress-licenseserver-url") NREL_ROOT_CERT_URL_ROOT = credentials("reopt-api-nrel-root-cert-url-root") } stages { stage("deploy") { stages { + stage("solver setup") { + steps { + sh "git clone ${LICENSESERVER_URL} julia_src/xpress/licenseserver" + sh "cp julia_src/xpress/licenseserver/Dockerfile.xpress julia_src/" + } + } + stage("lint") { steps { withCredentials([string(credentialsId: "reopt-api-werf-secret-key", variable: "WERF_SECRET_KEY")]) { From 3e5353dbc7902c895743d57ce7b8c58ff724daa9 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Tue, 2 Jan 2024 13:00:34 -0700 Subject: [PATCH 26/46] Update Jenkinsfile git clone step --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ba48cf2c6..cd8442d71 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,7 +74,9 @@ pipeline { stages { stage("solver setup") { steps { - sh "git clone ${LICENSESERVER_URL} julia_src/xpress/licenseserver" + dir("julia_src/xpress/licenseserver") { + git url: env.LICENSESERVER_URL + } sh "cp julia_src/xpress/licenseserver/Dockerfile.xpress julia_src/" } } From 70568c126a3cbd630340c95b0601524f3c729605 Mon Sep 17 00:00:00 2001 From: Nick Muerdter <12112+GUI@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:30:12 -0500 Subject: [PATCH 27/46] Try to fix deploy now that there are uncommitted files. --- werf-giterminism.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/werf-giterminism.yaml b/werf-giterminism.yaml index d875f180b..5b264044c 100644 --- a/werf-giterminism.yaml +++ b/werf-giterminism.yaml @@ -4,3 +4,6 @@ config: allowEnvVariables: - XPRESS_LICENSE_HOST - NREL_ROOT_CERT_URL_ROOT + dockerfile: + allowUncommitted: + - julia_src/Dockerfile.xpress From f7f4d207ac134080052eb919f0846ddd91c5e4f7 Mon Sep 17 00:00:00 2001 From: Nick Muerdter <12112+GUI@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:50:05 -0500 Subject: [PATCH 28/46] Another attempt at allow build from dockerfile not in repo. --- werf-giterminism.yaml | 2 ++ werf.yaml | 1 + 2 files changed, 3 insertions(+) diff --git a/werf-giterminism.yaml b/werf-giterminism.yaml index 5b264044c..2ee985fae 100644 --- a/werf-giterminism.yaml +++ b/werf-giterminism.yaml @@ -7,3 +7,5 @@ config: dockerfile: allowUncommitted: - julia_src/Dockerfile.xpress + allowContextAddFiles: + - julia_src/Dockerfile.xpress diff --git a/werf.yaml b/werf.yaml index 7ae0bf673..fbb179aac 100644 --- a/werf.yaml +++ b/werf.yaml @@ -11,6 +11,7 @@ args: image: julia-api context: julia_src/ dockerfile: Dockerfile.xpress +contextAddFiles: Dockerfile.xpress args: XPRESS_LICENSE_HOST: {{ env "XPRESS_LICENSE_HOST" | quote }} NREL_ROOT_CERT_URL_ROOT: {{ env "NREL_ROOT_CERT_URL_ROOT" | quote }} From 7bb19fc82c4fed4aabfcd101ebe6c6a533febf77 Mon Sep 17 00:00:00 2001 From: Nick Muerdter <12112+GUI@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:54:51 -0500 Subject: [PATCH 29/46] Try to allow copying of ignored dir. --- werf-giterminism.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/werf-giterminism.yaml b/werf-giterminism.yaml index 2ee985fae..fb1e7fb24 100644 --- a/werf-giterminism.yaml +++ b/werf-giterminism.yaml @@ -9,3 +9,4 @@ config: - julia_src/Dockerfile.xpress allowContextAddFiles: - julia_src/Dockerfile.xpress + - julia_src/licenseserver From 2c189f6cd1ef66f7d3399be942a1aba9fafddaa9 Mon Sep 17 00:00:00 2001 From: Nick Muerdter <12112+GUI@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:58:39 -0500 Subject: [PATCH 30/46] Fix path. --- werf-giterminism.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/werf-giterminism.yaml b/werf-giterminism.yaml index fb1e7fb24..52553aa47 100644 --- a/werf-giterminism.yaml +++ b/werf-giterminism.yaml @@ -9,4 +9,4 @@ config: - julia_src/Dockerfile.xpress allowContextAddFiles: - julia_src/Dockerfile.xpress - - julia_src/licenseserver + - julia_src/xpress/licenseserver From 5577deb0ea2f00f3f744eb8dddbae46f2605b46a Mon Sep 17 00:00:00 2001 From: Nick Muerdter <12112+GUI@users.noreply.github.com> Date: Tue, 2 Jan 2024 17:10:12 -0500 Subject: [PATCH 31/46] Another attempt at fixing builds with uncommitted files. --- werf.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/werf.yaml b/werf.yaml index fbb179aac..74aa64159 100644 --- a/werf.yaml +++ b/werf.yaml @@ -11,7 +11,9 @@ args: image: julia-api context: julia_src/ dockerfile: Dockerfile.xpress -contextAddFiles: Dockerfile.xpress +contextAddFiles: + - Dockerfile.xpress + - xpress/licenseserver args: XPRESS_LICENSE_HOST: {{ env "XPRESS_LICENSE_HOST" | quote }} NREL_ROOT_CERT_URL_ROOT: {{ env "NREL_ROOT_CERT_URL_ROOT" | quote }} From 856d9099fc4307a6703fd92a8440bdd6fc5a8e94 Mon Sep 17 00:00:00 2001 From: Bill Becker Date: Tue, 2 Jan 2024 22:18:10 -0700 Subject: [PATCH 32/46] Add helper setup script for NREL employees --- julia_src/xpress/solver_setup.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 julia_src/xpress/solver_setup.sh diff --git a/julia_src/xpress/solver_setup.sh b/julia_src/xpress/solver_setup.sh new file mode 100644 index 000000000..9e1ad0828 --- /dev/null +++ b/julia_src/xpress/solver_setup.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Instructions for setting up the solver +# The $LICENSESERVER and $TRANSCRYPT_PASSWORD environment variables must be assigned or replaced +git clone $LICENSESERVER_URL +cd licenseserver +# Only need transcrypt for local testing +transcrypt/transcrypt --flush-credentials -y || true +transcrypt/transcrypt -c aes-256-cbc -p "$TRANSCRYPT_PASSWORD" -y +# Needed for deploys to NREL servers +cp Dockerfile.xpress ../.. +# Only need for local testing +cp docker-compose.xpress.yml ../../.. From 3fe2be2c2fa8ba550d9326aa089ce472094e3ca0 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 2 Jan 2024 22:35:15 -0700 Subject: [PATCH 33/46] Add executable permission for solver_setup.sh --- julia_src/xpress/solver_setup.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 julia_src/xpress/solver_setup.sh diff --git a/julia_src/xpress/solver_setup.sh b/julia_src/xpress/solver_setup.sh old mode 100644 new mode 100755 From 946151cfcc992219f60acbe361ac497b920864d3 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 2 Jan 2024 22:43:12 -0700 Subject: [PATCH 34/46] .gitignore changes to solver_setup.sh for safety --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ecf8e4fe2..a91c462f1 100755 --- a/.gitignore +++ b/.gitignore @@ -120,3 +120,4 @@ docs/formulation/*log julia_src/xpress/licenseserver julia_src/Dockerfile.xpress docker-compose.xpress.yml +julia_src/xpress/solver_setup.sh From 6bab03fec3b01acd4b0cba6a821dcba8c730b713 Mon Sep 17 00:00:00 2001 From: adfarth Date: Sun, 7 Jan 2024 15:47:48 -0700 Subject: [PATCH 35/46] Fix gen cost validation --- CHANGELOG.md | 5 +++++ reoptjl/validators.py | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd623aa96..07ecc58dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,11 @@ Classify the change according to the following categories: ### Patches +## Develop - 2024-01-07 +### Minor Updates +#### Fixed +- Fixed setting of default Generator `installed_cost_per_kw` so that user inputs are not overridden + ## v3.2.3 ### Minor Updates ##### Changed diff --git a/reoptjl/validators.py b/reoptjl/validators.py index b5a534060..3a3002674 100644 --- a/reoptjl/validators.py +++ b/reoptjl/validators.py @@ -455,13 +455,16 @@ def update_pv_defaults_offgrid(self, pvmodel): if self.models["Generator"].__getattribute__("om_cost_per_kw") == None: if self.models["Settings"].off_grid_flag==False: self.models["Generator"].om_cost_per_kw = 20.0 + else: + self.models["Generator"].om_cost_per_kw = 10.0 + + if self.models["generator"].__getattribute__("installed_cost_per_kw") == None: + if self.models["Settings"].off_grid_flag==False: if self.models["Generator"].only_runs_during_grid_outage: self.models["Generator"].installed_cost_per_kw = 650.0 else: self.models["Generator"].installed_cost_per_kw = 800.0 - self.models["Generator"] - else: - self.models["Generator"].om_cost_per_kw = 10.0 + else: self.models["Generator"].installed_cost_per_kw = 880.0 if self.models["Generator"].__getattribute__("min_turn_down_fraction") == None: From 2e39a0456e424bc6bdf05a461bd96f38736aba81 Mon Sep 17 00:00:00 2001 From: adfarth Date: Sun, 7 Jan 2024 19:39:34 -0700 Subject: [PATCH 36/46] Update validators.py --- reoptjl/validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reoptjl/validators.py b/reoptjl/validators.py index 3a3002674..bb2d18875 100644 --- a/reoptjl/validators.py +++ b/reoptjl/validators.py @@ -458,7 +458,7 @@ def update_pv_defaults_offgrid(self, pvmodel): else: self.models["Generator"].om_cost_per_kw = 10.0 - if self.models["generator"].__getattribute__("installed_cost_per_kw") == None: + if self.models["Generator"].__getattribute__("installed_cost_per_kw") == None: if self.models["Settings"].off_grid_flag==False: if self.models["Generator"].only_runs_during_grid_outage: self.models["Generator"].installed_cost_per_kw = 650.0 From e13b9f9a2af2f2af2e521d4efc2b6b1e709aa7a2 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 10 Jan 2024 09:18:15 -0700 Subject: [PATCH 37/46] Avoid /summary error with off-grid ElectricTariff doesn't exist for off-grid, and this was causing an error when trying to add None's together --- reoptjl/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reoptjl/views.py b/reoptjl/views.py index e04fb11b8..5909273fb 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -855,7 +855,10 @@ def queryset_for_summary(api_metas,summary_dict:dict): ) if len(tariffOuts) > 0: for m in tariffOuts: - summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = (m.year_one_energy_cost_before_tax_bau + m.year_one_demand_cost_before_tax_bau + m.year_one_fixed_cost_before_tax_bau + m.year_one_min_charge_adder_before_tax_bau) - (m.year_one_energy_cost_before_tax + m.year_one_demand_cost_before_tax + m.year_one_fixed_cost_before_tax + m.year_one_min_charge_adder_before_tax) + if len(tariffInputs) > 0: + summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = (m.year_one_energy_cost_before_tax_bau + m.year_one_demand_cost_before_tax_bau + m.year_one_fixed_cost_before_tax_bau + m.year_one_min_charge_adder_before_tax_bau) - (m.year_one_energy_cost_before_tax + m.year_one_demand_cost_before_tax + m.year_one_fixed_cost_before_tax + m.year_one_min_charge_adder_before_tax) + else: + summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = 0.0 load = ElectricLoadInputs.objects.filter(meta__run_uuid__in=run_uuids).only( 'meta__run_uuid', From 8805d27583c3b8736cba2887e578aef821b60c20 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 10 Jan 2024 09:23:30 -0700 Subject: [PATCH 38/46] Update CHANGELOG and REopt.jl version in API meta --- CHANGELOG.md | 8 ++++---- reoptjl/api.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbdde66fe..59d600547 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,14 +27,14 @@ Classify the change according to the following categories: ### Patches -## Develop - 2024-01-07 +## v3.3.0 ### Minor Updates +#### Added +- Added the following BAU outputs: lifecycle_chp_standby_cost_after_tax, lifecycle_elecbill_after_tax, lifecycle_production_incentive_after_tax, lifecycle_outage_cost, lifecycle_MG_upgrade_and_fuel_cost #### Fixed - Fixed setting of default Generator `installed_cost_per_kw` so that user inputs are not overridden +- Avoid /summary endpoint error with off-grid runs where there is no ElectricTariff -## Develop - 2023-11-27 -#### Added -- Added the following BAU outputs: lifecycle_chp_standby_cost_after_tax, lifecycle_elecbill_after_tax, lifecycle_production_incentive_after_tax, lifecycle_outage_cost, lifecycle_MG_upgrade_and_fuel_cost ## v3.2.3 ### Minor Updates ##### Changed diff --git a/reoptjl/api.py b/reoptjl/api.py index c39303243..d803c7b30 100644 --- a/reoptjl/api.py +++ b/reoptjl/api.py @@ -98,7 +98,7 @@ def obj_create(self, bundle, **kwargs): meta = { "run_uuid": run_uuid, "api_version": 3, - "reopt_version": "0.38.1", + "reopt_version": "0.39.0", "status": "Validating..." } bundle.data.update({"APIMeta": meta}) From af6d02be616748639e5ba2312333de9608b853bc Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 10 Jan 2024 09:26:26 -0700 Subject: [PATCH 39/46] Update REopt.jl in the HiGHS solver environment --- julia_src/highs/Manifest.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/julia_src/highs/Manifest.toml b/julia_src/highs/Manifest.toml index dd54e7683..04d899e6d 100644 --- a/julia_src/highs/Manifest.toml +++ b/julia_src/highs/Manifest.toml @@ -790,11 +790,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "a56f12eca2b737e9d9210000ee599920001cc303" -repo-rev = "v0.38.1" -repo-url = "https://github.com/NREL/REopt.jl.git" +git-tree-sha1 = "013fc07e92f4b742f09b7adae75d2d63dfbc9237" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.38.1" +version = "0.39.0" [[deps.Random]] deps = ["SHA", "Serialization"] From 8b492b661cc7242995b647072dc876baea54f3e6 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 10 Jan 2024 14:12:02 -0700 Subject: [PATCH 40/46] Update REopt.jl to v0.39.1 --- CHANGELOG.md | 2 + julia_src/xpress/Manifest.toml | 111 +++++++++++++++++---------------- reoptjl/api.py | 2 +- 3 files changed, 61 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59d600547..abfe93ed2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ Classify the change according to the following categories: ### Minor Updates #### Added - Added the following BAU outputs: lifecycle_chp_standby_cost_after_tax, lifecycle_elecbill_after_tax, lifecycle_production_incentive_after_tax, lifecycle_outage_cost, lifecycle_MG_upgrade_and_fuel_cost +### Changed +- Updated REopt.jl version to 0.39.1 along with updates to other dependencies #### Fixed - Fixed setting of default Generator `installed_cost_per_kw` so that user inputs are not overridden - Avoid /summary endpoint error with off-grid runs where there is no ElectricTariff diff --git a/julia_src/xpress/Manifest.toml b/julia_src/xpress/Manifest.toml index 6db1500c5..3694e177b 100644 --- a/julia_src/xpress/Manifest.toml +++ b/julia_src/xpress/Manifest.toml @@ -10,11 +10,17 @@ git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef" uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" version = "1.5.0" +[[deps.Accessors]] +deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "MacroTools", "Requires", "Test"] +git-tree-sha1 = "cb96992f1bec110ad211b7e410e57ddf7944c16f" +uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" +version = "0.1.35" + [[deps.Adapt]] deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "cde29ddf7e5726c9fb511f340244ea3481267608" +git-tree-sha1 = "f8c724a2066b2d37d0234fe4022ec67987022d00" uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.7.2" +version = "4.0.0" [[deps.ArchGDAL]] deps = ["CEnum", "ColorTypes", "Dates", "DiskArrays", "Extents", "GDAL", "GDAL_jll", "GeoFormatTypes", "GeoInterface", "GeoInterfaceRecipes", "ImageCore", "Tables"] @@ -74,15 +80,15 @@ version = "0.4.2" [[deps.CSV]] deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "PrecompileTools", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings", "WorkerUtilities"] -git-tree-sha1 = "44dbf560808d49041989b8a96cae4cffbeb7966a" +git-tree-sha1 = "679e69c611fff422038e9e21e270c4197d49d918" uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" -version = "0.10.11" +version = "0.10.12" [[deps.ChainRulesCore]] deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "e0af648f0692ec1691b5d094b8724ba1346281cf" +git-tree-sha1 = "2118cb2765f8197b08e5958cdd17c165427425ee" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.18.0" +version = "1.19.0" [[deps.ChangesOfVariables]] deps = ["InverseFunctions", "LinearAlgebra", "Test"] @@ -142,6 +148,11 @@ deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" version = "1.0.1+0" +[[deps.CompositionsBase]] +git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad" +uuid = "a33af91c-f02d-484b-be07-31d278c5ca2b" +version = "0.1.2" + [[deps.ConcurrentUtilities]] deps = ["Serialization", "Sockets"] git-tree-sha1 = "8cfa272e8bdedfa88b6aefbbca7c19f1befac519" @@ -184,9 +195,9 @@ version = "1.6.1" [[deps.DataStructures]] deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "3dbd312d370723b6bb43ba9d02fc36abade4518d" +git-tree-sha1 = "ac67408d9ddf207de5cfa9a97e114352430f01ed" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.15" +version = "0.18.16" [[deps.DataValueInterfaces]] git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" @@ -237,9 +248,9 @@ version = "1.6.0" [[deps.ExceptionUnwrapping]] deps = ["Test"] -git-tree-sha1 = "e90caa41f5a86296e014e148ee061bd6c3edec96" +git-tree-sha1 = "dcb08a0d93ec0b1cdc4af184b26b591e9695423a" uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" -version = "0.1.9" +version = "0.1.10" [[deps.Expat_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -254,9 +265,9 @@ version = "0.1.2" [[deps.FileIO]] deps = ["Pkg", "Requires", "UUIDs"] -git-tree-sha1 = "299dc33549f68299137e51e6d49a13b5b1da9673" +git-tree-sha1 = "c5c28c245101bd59154f649e19b038d15901b5dc" uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" -version = "1.16.1" +version = "1.16.2" [[deps.FilePathsBase]] deps = ["Compat", "Dates", "Mmap", "Printf", "Test", "UUIDs"] @@ -308,15 +319,15 @@ version = "0.4.2" [[deps.GeoInterface]] deps = ["Extents"] -git-tree-sha1 = "d53480c0793b13341c40199190f92c611aa2e93c" +git-tree-sha1 = "d4f85701f569584f2cff7ba67a137d03f0cfb7d0" uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" -version = "1.3.2" +version = "1.3.3" [[deps.GeoInterfaceRecipes]] deps = ["GeoInterface", "RecipesBase"] -git-tree-sha1 = "0e26e1737e94de57c858649dc28e482b6c87d341" +git-tree-sha1 = "fb1156076f24f1dfee45b3feadb31d05730a49ac" uuid = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" -version = "1.0.1" +version = "1.0.2" [[deps.GhpGhx]] git-tree-sha1 = "bddcbcddc9a4ae7ae4f1ea7d4d8ccf38507d4071" @@ -333,15 +344,15 @@ version = "1.1.2" [[deps.H5Zblosc]] deps = ["Blosc", "HDF5"] -git-tree-sha1 = "d3966da25e48c05c31cd9786fd201627877612a2" +git-tree-sha1 = "d778420e524bcf56066e8c63c7aa315ae7269da2" uuid = "c8ec2601-a99c-407f-b158-e79c03c2f5f7" -version = "0.1.1" +version = "0.1.2" [[deps.HDF5]] -deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Printf", "Random", "Requires", "UUIDs"] -git-tree-sha1 = "114e20044677badbc631ee6fdc80a67920561a29" +deps = ["Compat", "HDF5_jll", "Libdl", "MPIPreferences", "Mmap", "Preferences", "Printf", "Random", "Requires", "UUIDs"] +git-tree-sha1 = "26407bd1c60129062cec9da63dc7d08251544d53" uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" -version = "0.16.16" +version = "0.17.1" [[deps.HDF5_jll]] 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"] @@ -400,9 +411,9 @@ uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" version = "0.2.2" [[deps.IterTools]] -git-tree-sha1 = "4ced6667f9974fc5c5943fa5e2ef1ca43ea9e450" +git-tree-sha1 = "42d5f897009e7ff2cf88db414a389e5ed1bdd023" uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" -version = "1.8.0" +version = "1.10.0" [[deps.IteratorInterfaceExtensions]] git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" @@ -411,9 +422,9 @@ version = "1.0.0" [[deps.JLD]] deps = ["Compat", "FileIO", "H5Zblosc", "HDF5", "Printf"] -git-tree-sha1 = "ec6afa4fd3402e4dd5b15b3e5dd2f7dd52043ce8" +git-tree-sha1 = "9e46670950251e88316a421b3bfa8f1190abe43a" uuid = "4138dd39-2aa7-5051-a626-17a0bb65d9c8" -version = "0.13.3" +version = "0.13.4" [[deps.JLLWrappers]] deps = ["Artifacts", "Preferences"] @@ -446,10 +457,10 @@ uuid = "88015f11-f218-50d7-93a8-a6af411a945d" version = "3.0.0+1" [[deps.LLVMOpenMP_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f689897ccbe049adb19a065c495e75f372ecd42b" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "d986ce2d884d49126836ea94ed5bfb0f12679713" uuid = "1d63c593-3942-5779-bab2-d838dc0a180e" -version = "15.0.4+0" +version = "15.0.7+0" [[deps.LaTeXStrings]] git-tree-sha1 = "50901ebc375ed41dbf8058da26f9de442febbbec" @@ -539,15 +550,15 @@ version = "0.1.10" [[deps.MPItrampoline_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "6979eccb6a9edbbb62681e158443e79ecc0d056a" +git-tree-sha1 = "8eeb3c73bbc0ca203d0dc8dad4008350bbe5797b" uuid = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748" -version = "5.3.1+0" +version = "5.3.1+1" [[deps.MacroTools]] deps = ["Markdown", "Random"] -git-tree-sha1 = "9ee1618cbf5240e6d4e0371d6f24065083f60c48" +git-tree-sha1 = "b211c553c199c111d998ecdaf7623d1b89b69f93" uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.11" +version = "0.5.12" [[deps.MappedArrays]] git-tree-sha1 = "2dab0221fe2b0f2cb6754eaa743cc266339f527e" @@ -618,9 +629,9 @@ version = "1.2.0" [[deps.OffsetArrays]] deps = ["Adapt"] -git-tree-sha1 = "2ac17d29c523ce1cd38e27785a7d23024853a4bb" +git-tree-sha1 = "6a731f2b5c03157418a20c12195eb4b74c8f8621" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.12.10" +version = "1.13.0" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] @@ -640,9 +651,9 @@ version = "0.8.1+0" [[deps.OpenMPI_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "PMIx_jll", "TOML", "Zlib_jll", "libevent_jll", "prrte_jll"] -git-tree-sha1 = "694458ae803b684f09c07f90459cb79655fb377d" +git-tree-sha1 = "1d1421618bab0e820bdc7ae1a2b46ce576981273" uuid = "fe0851c0-eecd-5654-98d4-656369965a5c" -version = "5.0.0+0" +version = "5.0.1+0" [[deps.OpenSSL]] deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] @@ -687,9 +698,9 @@ version = "0.5.12" [[deps.Parsers]] deps = ["Dates", "PrecompileTools", "UUIDs"] -git-tree-sha1 = "a935806434c9d4c506ba941871b327b96d41f2bf" +git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.8.0" +version = "2.8.1" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] @@ -734,9 +745,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "013fc07e92f4b742f09b7adae75d2d63dfbc9237" +git-tree-sha1 = "143c40671c75f23e9a786df8f97948b6cfb18823" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.39.0" +version = "0.39.1" [[deps.Random]] deps = ["SHA", "Serialization"] @@ -765,10 +776,10 @@ uuid = "ae029012-a4dd-5104-9daa-d747884805df" version = "1.3.0" [[deps.Roots]] -deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"] -git-tree-sha1 = "0f1d92463a020321983d04c110f476c274bafe2e" +deps = ["Accessors", "ChainRulesCore", "CommonSolve", "Printf"] +git-tree-sha1 = "af540898b1e6ca7aa6ba7213c05052809c6c522a" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "2.0.22" +version = "2.1.0" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" @@ -789,12 +800,6 @@ version = "1.4.1" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" -[[deps.Setfield]] -deps = ["ConstructionBase", "Future", "MacroTools", "StaticArraysCore"] -git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" -uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" -version = "1.1.1" - [[deps.SimpleBufferStream]] git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" @@ -811,9 +816,9 @@ uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[deps.SortingAlgorithms]] deps = ["DataStructures"] -git-tree-sha1 = "5165dfb9fd131cf0c6957a3a7605dede376e7b63" +git-tree-sha1 = "66e0a8e672a0bdfca2c3f5937efb8538b9ddc085" uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "1.2.0" +version = "1.2.1" [[deps.SparseArrays]] deps = ["LinearAlgebra", "Random"] @@ -833,9 +838,9 @@ version = "0.1.1" [[deps.StaticArrays]] deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore", "Statistics"] -git-tree-sha1 = "5ef59aea6f18c25168842bded46b16662141ab87" +git-tree-sha1 = "4e17a790909b17f7bf1496e3aec138cf01b60b3b" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.7.0" +version = "1.9.0" [[deps.StaticArraysCore]] git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" diff --git a/reoptjl/api.py b/reoptjl/api.py index d803c7b30..65aa0443a 100644 --- a/reoptjl/api.py +++ b/reoptjl/api.py @@ -98,7 +98,7 @@ def obj_create(self, bundle, **kwargs): meta = { "run_uuid": run_uuid, "api_version": 3, - "reopt_version": "0.39.0", + "reopt_version": "0.39.1", "status": "Validating..." } bundle.data.update({"APIMeta": meta}) From bec766adb2f36b817a623550aab300aa8e9e85bd Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 10 Jan 2024 14:37:53 -0700 Subject: [PATCH 41/46] Use year_one_bill instead of 5 separate components, and add export_benefit --- reoptjl/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reoptjl/views.py b/reoptjl/views.py index 5909273fb..087ad1f31 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -856,7 +856,7 @@ def queryset_for_summary(api_metas,summary_dict:dict): if len(tariffOuts) > 0: for m in tariffOuts: if len(tariffInputs) > 0: - summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = (m.year_one_energy_cost_before_tax_bau + m.year_one_demand_cost_before_tax_bau + m.year_one_fixed_cost_before_tax_bau + m.year_one_min_charge_adder_before_tax_bau) - (m.year_one_energy_cost_before_tax + m.year_one_demand_cost_before_tax + m.year_one_fixed_cost_before_tax + m.year_one_min_charge_adder_before_tax) + summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = (m.year_one_bill_before_tax_bau + m.year_one_export_benefit_before_tax_bau) - (m.year_one_bill_before_tax + m.year_one_export_benefit_before_tax) else: summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = 0.0 From 1bab248262b926349a8e5c770ec1fbe8227a1335 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 10 Jan 2024 15:08:22 -0700 Subject: [PATCH 42/46] Remove (wrong) export value from year_one_savings --- reoptjl/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reoptjl/views.py b/reoptjl/views.py index 087ad1f31..34ba57016 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -856,7 +856,7 @@ def queryset_for_summary(api_metas,summary_dict:dict): if len(tariffOuts) > 0: for m in tariffOuts: if len(tariffInputs) > 0: - summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = (m.year_one_bill_before_tax_bau + m.year_one_export_benefit_before_tax_bau) - (m.year_one_bill_before_tax + m.year_one_export_benefit_before_tax) + summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = m.year_one_bill_before_tax_bau - m.year_one_bill_before_tax else: summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = 0.0 From d012d08c3f232470a544f0c9c060f335c0814f83 Mon Sep 17 00:00:00 2001 From: Bill Becker <42586683+Bill-Becker@users.noreply.github.com> Date: Wed, 10 Jan 2024 17:21:03 -0700 Subject: [PATCH 43/46] Fix version numbers to be consistent with release tags --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abfe93ed2..203af3443 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ Classify the change according to the following categories: ### Patches -## v3.3.0 +## v3.4.0 ### Minor Updates #### Added - Added the following BAU outputs: lifecycle_chp_standby_cost_after_tax, lifecycle_elecbill_after_tax, lifecycle_production_incentive_after_tax, lifecycle_outage_cost, lifecycle_MG_upgrade_and_fuel_cost @@ -37,6 +37,10 @@ Classify the change according to the following categories: - Fixed setting of default Generator `installed_cost_per_kw` so that user inputs are not overridden - Avoid /summary endpoint error with off-grid runs where there is no ElectricTariff +## v3.3.0 +### Changed +- Updates to REopt.jl for passing API key + ## v3.2.3 ### Minor Updates ##### Changed From 50fbf38a7163727075d03d84d7de28782666303a Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 10 Jan 2024 19:25:20 -0700 Subject: [PATCH 44/46] Hot Fix check on year_one_bill_ is None --- reoptjl/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reoptjl/views.py b/reoptjl/views.py index 34ba57016..2884a5638 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -855,7 +855,7 @@ def queryset_for_summary(api_metas,summary_dict:dict): ) if len(tariffOuts) > 0: for m in tariffOuts: - if len(tariffInputs) > 0: + if (m.year_one_bill_before_tax_bau is not None) and (m.year_one_bill_before_tax is not None): summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = m.year_one_bill_before_tax_bau - m.year_one_bill_before_tax else: summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = 0.0 From 027687da178390c87f50eaa4907bf1d977988c2e Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 10 Jan 2024 19:25:20 -0700 Subject: [PATCH 45/46] Hot Fix check on year_one_bill_ is None --- reoptjl/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reoptjl/views.py b/reoptjl/views.py index 34ba57016..2884a5638 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -855,7 +855,7 @@ def queryset_for_summary(api_metas,summary_dict:dict): ) if len(tariffOuts) > 0: for m in tariffOuts: - if len(tariffInputs) > 0: + if (m.year_one_bill_before_tax_bau is not None) and (m.year_one_bill_before_tax is not None): summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = m.year_one_bill_before_tax_bau - m.year_one_bill_before_tax else: summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = 0.0 From 5468d26a2980fa37da016ab61a10271e7e5eed36 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 17 Jan 2024 10:54:47 -0700 Subject: [PATCH 46/46] Add focus value of off-grid Return null for N/A values --- reoptjl/views.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/reoptjl/views.py b/reoptjl/views.py index 2884a5638..1438c6db9 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -830,7 +830,17 @@ def queryset_for_summary(api_metas,summary_dict:dict): summary_dict[str(m.meta.run_uuid)]['focus'] = "Financial" else: summary_dict[str(m.meta.run_uuid)]['focus'] = "Resilience" - + + # Use settings to find out if it is an off-grid evaluation + settings = Settings.objects.filter(meta__run_uuid__in=run_uuids).only( + 'meta__run_uuid', + 'off_grid_flag' + ) + if len(settings) > 0: + for m in settings: + if m.off_grid_flag: + summary_dict[str(m.meta.run_uuid)]['focus'] = "Off-grid" + tariffInputs = ElectricTariffInputs.objects.filter(meta__run_uuid__in=run_uuids).only( 'meta__run_uuid', 'urdb_rate_name' @@ -858,7 +868,7 @@ def queryset_for_summary(api_metas,summary_dict:dict): if (m.year_one_bill_before_tax_bau is not None) and (m.year_one_bill_before_tax is not None): summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = m.year_one_bill_before_tax_bau - m.year_one_bill_before_tax else: - summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = 0.0 + summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = None load = ElectricLoadInputs.objects.filter(meta__run_uuid__in=run_uuids).only( 'meta__run_uuid', @@ -880,7 +890,10 @@ def queryset_for_summary(api_metas,summary_dict:dict): ) if len(fin) > 0: for m in fin: - summary_dict[str(m.meta.run_uuid)]['npv_us_dollars'] = m.npv + if m.npv is not None: + summary_dict[str(m.meta.run_uuid)]['npv_us_dollars'] = m.npv + else: + summary_dict[str(m.meta.run_uuid)]['npv_us_dollars'] = None summary_dict[str(m.meta.run_uuid)]['net_capital_costs'] = m.initial_capital_costs_after_incentives batt = ElectricStorageOutputs.objects.filter(meta__run_uuid__in=run_uuids).only(