Skip to content

Commit

Permalink
add missing method
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Sep 13, 2023
1 parent 0f4628b commit 0ed7998
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/operation/decision_model_store.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ function write_result!(
return
end

function write_result!(
store::DecisionModelStore,
name::Symbol,
key::OptimizationContainerKey,
index::DecisionModelIndexType,
update_timestamp::Dates.DateTime,
array::DenseAxisArray{<:Any, 1},
)
columns = axes(array)[1]
if eltype(columns) !== String
# TODO: This happens because buses are stored by indexes instead of name.
columns = string.(columns)
end
container = getfield(store, get_store_container_type(key))
container[key][index] =
DenseAxisArray(reshape(array.data, 1, length(columns)), ["1"], columns)
return
end

function read_results(
store::DecisionModelStore,
key::OptimizationContainerKey;
Expand Down

0 comments on commit 0ed7998

Please sign in to comment.