Skip to content

Commit

Permalink
Fix write_output bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cfe316 committed Nov 20, 2023
1 parent 9258931 commit 9125445
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/write_outputs/write_maintenance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 12 in src/write_outputs/write_maintenance.jl

View check run for this annotation

Codecov / codecov/patch

src/write_outputs/write_maintenance.jl#L11-L12

Added lines #L11 - L12 were not covered by tests

function prepare_timeseries_variables(EP::Model, set::Set{Symbol}, scale::Float64=1.0)
data(var) = scale * value.(extract_data(EP[var]))

Check warning on line 15 in src/write_outputs/write_maintenance.jl

View check run for this annotation

Codecov / codecov/patch

src/write_outputs/write_maintenance.jl#L14-L15

Added lines #L14 - L15 were not covered by tests
return DataFrame(set .=> data.(set))
end

Expand Down

0 comments on commit 9125445

Please sign in to comment.