From ba4e377d620c24ef04ab1675d47171224f81af1c Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Fri, 29 Sep 2023 01:12:00 -0600 Subject: [PATCH] fixes to run --- src/simulation/hdf_simulation_store.jl | 2 +- src/simulation/optimization_output_cache.jl | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/simulation/hdf_simulation_store.jl b/src/simulation/hdf_simulation_store.jl index 2a8494eba2..e2b639f507 100644 --- a/src/simulation/hdf_simulation_store.jl +++ b/src/simulation/hdf_simulation_store.jl @@ -595,7 +595,7 @@ function write_result!( output_cache = get_output_cache(store.cache, model_name, key) cur_size = get_size(store.cache) - add_result!(output_cache, index, data.data, is_full(store.cache, cur_size)) + add_result!(output_cache, index, permutedims(data.data, (3, 1, 2)), is_full(store.cache, cur_size)) if get_dirty_size(output_cache) >= get_min_flush_size(store.cache) discard = !should_keep_in_cache(output_cache) diff --git a/src/simulation/optimization_output_cache.jl b/src/simulation/optimization_output_cache.jl index da76708ff3..276c529273 100644 --- a/src/simulation/optimization_output_cache.jl +++ b/src/simulation/optimization_output_cache.jl @@ -52,7 +52,10 @@ end """ Add result to the cache. """ -function add_result!(cache::OptimizationOutputCache, timestamp, array, system_cache_is_full) +function add_result!(cache::OptimizationOutputCache, + timestamp::Dates.DateTime, + array::Array{Float64}, + system_cache_is_full::Bool) if cache.size_per_entry == 0 cache.size_per_entry = length(array) * sizeof(first(array)) end @@ -77,7 +80,11 @@ function add_result!(cache::OptimizationOutputCache, timestamp, array, system_ca return cache.size_per_entry end -function _add_result!(cache::OptimizationOutputCache, timestamp, data) +function _add_result!( + cache::OptimizationOutputCache, + timestamp::Dates.DateTime, + data::Array{Float64}, +) cache.data[timestamp] = data push!(cache.dirty_timestamps, timestamp) return