Skip to content

Commit

Permalink
Merge pull request #1007 from NREL-Sienna/jd/handle_1d_DAxArr
Browse files Browse the repository at this point in the history
add missing method
  • Loading branch information
jd-lara authored Sep 13, 2023
2 parents 0f4628b + 0ed7998 commit e69e29d
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

2 comments on commit e69e29d

@jd-lara
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/91385

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.23.0 -m "<description of version>" e69e29ddf3391c7a7217302dbf3706f79e686bf0
git push origin v0.23.0

Please sign in to comment.