From ddba2bcfb03f91f677d6a69466c276e2a81e9d0b Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 26 Jun 2024 13:25:12 -0600 Subject: [PATCH 1/7] Temp Update REopt.jl to mt-therm-effic branch --- julia_src/Manifest.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index d60586baa..5fb33a190 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -917,9 +917,11 @@ 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 = "b51d56a6398f302100004184b64bbe3d1e137277" +git-tree-sha1 = "f4a44705bd9038f920be6998ec553897c09eb5d5" +repo-rev = "mt-therm-effic" +repo-url = "https://github.com/NREL/REopt.jl.git" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.47.1" +version = "0.47.0" [[deps.Random]] deps = ["SHA"] From 54bb8386a50a56e5574528788e635e5f307fdf03 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Thu, 27 Jun 2024 11:35:20 -0600 Subject: [PATCH 2/7] Add thermal_efficiency input to chp_defaults endpoint --- julia_src/http.jl | 3 ++- reoptjl/views.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index 8d3a38eaa..1addd45b2 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -199,7 +199,8 @@ function chp_defaults(req::HTTP.Request) float_vals = ["avg_boiler_fuel_load_mmbtu_per_hour", "boiler_efficiency", "avg_electric_load_kw", - "max_electric_load_kw"] + "max_electric_load_kw", + "thermal_efficiency"] int_vals = ["size_class"] bool_vals = ["is_electric_only"] all_vals = vcat(string_vals, float_vals, int_vals, bool_vals) diff --git a/reoptjl/views.py b/reoptjl/views.py index 3e41f7f62..269400733 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -381,7 +381,8 @@ def chp_defaults(request): "boiler_efficiency": request.GET.get("boiler_efficiency"), "avg_electric_load_kw": request.GET.get("avg_electric_load_kw"), "max_electric_load_kw": request.GET.get("max_electric_load_kw"), - "is_electric_only": request.GET.get("is_electric_only") + "is_electric_only": request.GET.get("is_electric_only"), + "thermal_efficiency": request.GET.get("thermal_efficiency") } if (request.GET.get("size_class")): inputs["size_class"] = int(request.GET.get("size_class")) From 198eb0ae2330d1255b6168e566b05ba7c10f7a60 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Thu, 27 Jun 2024 14:09:36 -0600 Subject: [PATCH 3/7] Only add thermal_efficiency to inputs if exists --- reoptjl/views.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/reoptjl/views.py b/reoptjl/views.py index 269400733..d513e7642 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -381,11 +381,15 @@ def chp_defaults(request): "boiler_efficiency": request.GET.get("boiler_efficiency"), "avg_electric_load_kw": request.GET.get("avg_electric_load_kw"), "max_electric_load_kw": request.GET.get("max_electric_load_kw"), - "is_electric_only": request.GET.get("is_electric_only"), - "thermal_efficiency": request.GET.get("thermal_efficiency") + "is_electric_only": request.GET.get("is_electric_only") } - if (request.GET.get("size_class")): - inputs["size_class"] = int(request.GET.get("size_class")) + + if request.GET.get("size_class"): + inputs["size_class"] = int(request.GET.get("size_class")) # Not sure if this is necessary because we convert to int in http.jl + + if request.GET.get("thermal_efficiency"): + inputs["thermal_efficiency"] = request.GET.get("thermal_efficiency") # Conversion to correct type happens in http.jl + try: julia_host = os.environ.get('JULIA_HOST', "julia") http_jl_response = requests.get("http://" + julia_host + ":8081/chp_defaults/", json=inputs) From 991204811dfc44722d85f9739047ecd48e1b2de3 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Thu, 27 Jun 2024 14:10:01 -0600 Subject: [PATCH 4/7] Avoid assigning Nothing type bc expects Float --- julia_src/http.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index 1addd45b2..631da7486 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -207,7 +207,9 @@ function chp_defaults(req::HTTP.Request) # Process .json inputs and convert to correct type if needed for k in all_vals if !haskey(d, k) - d[k] = nothing + if !(k == "thermal_efficiency") # thermal_efficiency is of type Float64 (incl NaN), so it can't be "nothing" + d[k] = nothing + end elseif !isnothing(d[k]) if k in float_vals && typeof(d[k]) == String d[k] = parse(Float64, d[k]) From bd14a0a4b654d2d0edfe70aade9bdea2bf31c306 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Mon, 8 Jul 2024 15:20:38 -0600 Subject: [PATCH 5/7] Update REopt.jl to v0.47.2 --- julia_src/Manifest.toml | 6 ++---- reoptjl/api.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 5fb33a190..ea4f14952 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -917,11 +917,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 = "f4a44705bd9038f920be6998ec553897c09eb5d5" -repo-rev = "mt-therm-effic" -repo-url = "https://github.com/NREL/REopt.jl.git" +git-tree-sha1 = "c02ff7c0b60352164b89f39789424422083ae4eb" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.47.0" +version = "0.47.2" [[deps.Random]] deps = ["SHA"] diff --git a/reoptjl/api.py b/reoptjl/api.py index bd90ef685..4753f096e 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.47.1", + "reopt_version": "0.47.2", "status": "Validating..." } bundle.data.update({"APIMeta": meta}) From d00e455c6cada89cfb6a2864d98fc1ad50ecff33 Mon Sep 17 00:00:00 2001 From: Alex Zolan Date: Mon, 8 Jul 2024 19:15:25 -0600 Subject: [PATCH 6/7] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36949fa54..15dd0fee5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,12 @@ Classify the change according to the following categories: ##### Removed ### Patches +## Develop 2024-07-08 +#### Added +- Added attribute `thermal_efficiency` to the arguments of http endpoint `chp_defaults` +#### Fixed +- See fixes and changes here: https://github.com/NREL/REopt.jl/releases/tag/v0.47.2 + ## v3.9.1 ### Minor Updates #### Added From 0d43a4f3a45122abd8d4c6aea445d831a9819cdb Mon Sep 17 00:00:00 2001 From: Bill Becker <42586683+Bill-Becker@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:15:14 -0600 Subject: [PATCH 7/7] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15dd0fee5..5e7df597c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ Classify the change according to the following categories: ##### Removed ### Patches -## Develop 2024-07-08 +## v3.9.2 #### Added - Added attribute `thermal_efficiency` to the arguments of http endpoint `chp_defaults` #### Fixed