From 1d0ccef00110459a915506613514be20d1b9c088 Mon Sep 17 00:00:00 2001 From: "elias.kuepper" Date: Mon, 24 Jun 2019 17:10:14 -0700 Subject: [PATCH] CSV allowmissing as optional --- src/utils/load_data.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/load_data.jl b/src/utils/load_data.jl index e7bff8d..2e3b57d 100644 --- a/src/utils/load_data.jl +++ b/src/utils/load_data.jl @@ -42,7 +42,7 @@ load the `techs.csv` in the folder `data_path` with the following columns: returns `techs::OptVariable` techs[tech] - OptDataCEPTech """ function load_cep_data_techs(data_path::String) - tab=CSV.read(joinpath(data_path,"techs.csv"),allowmissing=:none) + tab=CSV.read(joinpath(data_path,"techs.csv");allowmissing=:none) #Check existance of necessary column :tech in names(tab) || throw(@error "No column called `tech` in `techs.csv`") #Build empty OptVariable @@ -88,7 +88,7 @@ returns `nodes::OptVariable` nodes[tech, node] - OptDataCEPNode """ function load_cep_data_nodes(data_path::String, techs::OptVariable) - tab=CSV.read(joinpath(data_path,"nodes.csv"),allowmissing=:none) + tab=CSV.read(joinpath(data_path,"nodes.csv");allowmissing=:none) # Check exisistance of columns check_column(tab,[:node, :infrastruct]) #Create empty OptVariable @@ -131,7 +131,7 @@ returns `lines::OptVarible` lines[tech, line] - OptDataCEPLine function load_cep_data_lines(data_path::String, techs::OptVariable) if isfile(joinpath(data_path,"lines.csv")) - tab=CSV.read(joinpath(data_path,"lines.csv"),allowmissing=:none) + tab=CSV.read(joinpath(data_path,"lines.csv");allowmissing=:none) #Check existance of necessary column check_column(tab, [:line]) @@ -211,7 +211,7 @@ returns `costs::OptVariable` costs[tech,node,year,account,impact] - Number function load_cep_data_costs(data_path::String, techs::OptVariable, nodes::OptVariable) - tab=CSV.read(joinpath(data_path,"costs.csv"),allowmissing=:none) + tab=CSV.read(joinpath(data_path,"costs.csv");allowmissing=:none) check_column(tab,[:tech, :location, :year, :account]) impacts=String.(names(tab)[findfirst(names(tab).==Symbol("|"))+1:end]) #Create empty OptVariable