From 9125445dc642a00ec1d9142dfc4adb2fb875ee77 Mon Sep 17 00:00:00 2001 From: Jacob Schwartz Date: Mon, 20 Nov 2023 18:20:56 -0500 Subject: [PATCH] Fix write_output bug --- src/write_outputs/write_maintenance.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/write_outputs/write_maintenance.jl b/src/write_outputs/write_maintenance.jl index d00af7b696..834f90f118 100644 --- a/src/write_outputs/write_maintenance.jl +++ b/src/write_outputs/write_maintenance.jl @@ -7,10 +7,12 @@ function write_simple_csv(filename::AbstractString, header::Vector, matrix) write_simple_csv(filename, df) end -function prepare_timeseries_variables(EP::Model, set::Set{Symbol}, scale::Float64=1.0) - # function to extract data from DenseAxisArray - data(var) = scale * value.(EP[var]).data +# function to extract data from DenseAxisArray +extract_data(var::JuMP.Containers.DenseAxisArray)::AbstractArray = var.data +extract_data(var::AbstractArray)::AbstractArray = var +function prepare_timeseries_variables(EP::Model, set::Set{Symbol}, scale::Float64=1.0) + data(var) = scale * value.(extract_data(EP[var])) return DataFrame(set .=> data.(set)) end