Skip to content

Commit

Permalink
Merge pull request #18 from YoungFaithful/CSV
Browse files Browse the repository at this point in the history
Csv.jl allowmissing depreciated
  • Loading branch information
holgerteichgraeber authored Jun 26, 2019
2 parents 983d339 + f5a07d7 commit d23ffab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ keywords = ["energy", "capacity", "JuMP", "optimization"]
license = "MIT"
desc = "Capacity Expansion Problem Formulation for Julia"
author = ["Elias Kuepper <[email protected]>"]
version = "0.1.4"
version = "0.1.5"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
8 changes: 4 additions & 4 deletions src/utils/load_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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");strict=true)
#Check existance of necessary column
:tech in names(tab) || throw(@error "No column called `tech` in `techs.csv`")
#Build empty OptVariable
Expand Down Expand Up @@ -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");strict=true)
# Check exisistance of columns
check_column(tab,[:node, :infrastruct])
#Create empty OptVariable
Expand Down Expand Up @@ -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");strict=true)
#Check existance of necessary column
check_column(tab, [:line])

Expand Down Expand Up @@ -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");strict=true)
check_column(tab,[:tech, :location, :year, :account])
impacts=String.(names(tab)[findfirst(names(tab).==Symbol("|"))+1:end])
#Create empty OptVariable
Expand Down

2 comments on commit d23ffab

@holgerteichgraeber
Copy link
Collaborator 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/1592

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 Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.5 -m "<description of version>" d23ffab3f915d6f02e128774b6d2ae82d1c358f0
git push origin v0.1.5

Please sign in to comment.