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 diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index d60586baa..ea4f14952 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -917,9 +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 = "b51d56a6398f302100004184b64bbe3d1e137277" +git-tree-sha1 = "c02ff7c0b60352164b89f39789424422083ae4eb" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.47.1" +version = "0.47.2" [[deps.Random]] deps = ["SHA"] diff --git a/julia_src/http.jl b/julia_src/http.jl index 8d3a38eaa..631da7486 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -199,14 +199,17 @@ 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) # 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]) 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}) diff --git a/reoptjl/views.py b/reoptjl/views.py index 3e41f7f62..d513e7642 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -383,8 +383,13 @@ def chp_defaults(request): "max_electric_load_kw": request.GET.get("max_electric_load_kw"), "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)