Skip to content

Commit

Permalink
Avoid converting intentional Vector{String} types to Vector{Float64} …
Browse files Browse the repository at this point in the history
…for CoolingLoad
  • Loading branch information
Bill-Becker committed Feb 21, 2025
1 parent 7c98191 commit d0e1d95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/scenario.jl
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,11 @@ function Scenario(d::Dict; flex_hvac_from_json=false)
end
year = get!(d["CoolingLoad"], "year", electric_load.year)
validate_load_year_consistency(electric_load.year, year, "CoolingLoad")
# If array inputs are coming from Julia JSON.parsefile (reader), they have type Vector{Any}; convert to expected type here
# If array inputs are coming from Julia JSON.parsefile (reader), they have type Vector{Any}; convert to expected type here
cooling_type_convert = ["monthly_fractions_of_electric_load", "per_time_step_fractions_of_electric_load",
"blended_doe_reference_percents", "monthly_tonhour", "thermal_loads_ton"]
for (k,v) in d["CoolingLoad"]
if typeof(v) <: AbstractVector{Any}
if typeof(v) <: AbstractVector{Any} && k in cooling_type_convert
d["CoolingLoad"][k] = convert(Vector{Float64}, v)
end
end
Expand Down

0 comments on commit d0e1d95

Please sign in to comment.