GenXProject / GenX.jl

GenX: a configurable power system capacity expansion model for studying low-carbon energy futures. More details at : https://genx.mit.edu
https://genxproject.github.io/GenX.jl/
GNU General Public License v2.0
270 stars 115 forks source link

Reading Input CSV Files ERROR: LoadError: BoundsError #38

Closed ASamarkRoth closed 3 years ago

ASamarkRoth commented 3 years ago

Attempting to run GenX example from commit 884844420438ee08eb8970b221b4f0eba80fe3ca on the main branch I get an error when reading input files.

Excerpt of the run:

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.3.1 (2019-12-30)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(GenX) pkg> activate .
Activating environment at `~/Documents/qvist/GenXProject/GenX/Project.toml`

(GenX) pkg> instantiate
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed SentinelArrays ─ v1.3.5
  Updating `~/Documents/qvist/GenXProject/GenX/Project.toml`
  [6e4b80f9] + BenchmarkTools v1.1.1
  [336ed68f] + CSV v0.8.5
  [9961bab8] + Cbc v0.8.0
  [e2554f3b] + Clp v0.8.4
  [aaaa29a8] + Clustering v0.14.2
  [861a8166] + Combinatorics v1.0.2
  [a93c6f00] + DataFrames v1.2.1
  [864edb3b] + DataStructures v0.17.20
  [41bf760c] + DiffEqSensitivity v6.33.0
  [b4f34e82] + Distances v0.10.3
  [e30172f5] + Documenter v0.27.4
  [35a29f4d] + DocumenterTools v0.1.13
  [60bf3e95] + GLPK v0.14.12
  [2e9cd046] + Gurobi v0.9.14
  [b6b21f68] + Ipopt v0.7.0
  [4076af6c] + JuMP v0.21.4
  [fdba3010] + MathProgBase v0.7.8
  [1dea7af3] + OrdinaryDiffEq v5.42.3
  [8a4e6c94] + QuasiMonteCarlo v0.2.3
  [2913bbd2] + StatsBase v0.33.8
  [ddb6d928] + YAML v0.4.7
  [ade2ca70] + Dates 
  [37e2e46d] + LinearAlgebra 
  [10745b16] + Statistics 
  Updating `~/Documents/qvist/GenXProject/GenX/Manifest.toml`
  [a4c015fc] + ANSIColoredPrinters v0.0.1
  [ae81ac8f] + ASL_jll v0.1.2+0
  [621f4979] + AbstractFFTs v1.0.1
  [1520ce14] + AbstractTrees v0.3.4
  [79e6a3ab] + Adapt v2.4.0
  [ec485272] + ArnoldiMethod v0.1.0
  [4fba245c] + ArrayInterface v2.14.17
  [4c555306] + ArrayLayouts v0.1.5
  [56f22d72] + Artifacts v1.3.0
  [6e4b80f9] + BenchmarkTools v1.1.1
  [b99e7846] + BinaryProvider v0.5.10
  [6e34b625] + Bzip2_jll v1.0.7+0
  [fa961155] + CEnum v0.4.1
  [336ed68f] + CSV v0.8.5
  [49dc2e85] + Calculus v0.5.1
  [9961bab8] + Cbc v0.8.0
  [38041ee0] + Cbc_jll v2.10.5+2
  [3830e938] + Cgl_jll v0.60.2+6
  [d360d2e6] + ChainRulesCore v0.9.45
  [e2554f3b] + Clp v0.8.4
  [06985876] + Clp_jll v1.17.6+7
  [aaaa29a8] + Clustering v0.14.2
  [523fee87] + CodecBzip2 v0.7.2
  [944b1d66] + CodecZlib v0.7.0
  [be027038] + CoinUtils_jll v2.11.3+4
  [861a8166] + Combinatorics v1.0.2
  [38540f10] + CommonSolve v0.2.0
  [bbf7d656] + CommonSubexpressions v0.3.0
  [34da2185] + Compat v3.31.0
  [e66e0078] + CompilerSupportLibraries_jll v0.3.4+0
  [88cd18e8] + ConsoleProgressMonitor v0.1.2
  [adafc99b] + CpuId v0.2.2
  [a8cc5b0e] + Crayons v4.0.4
  [9a962f9c] + DataAPI v1.7.0
  [a93c6f00] + DataFrames v1.2.1
  [864edb3b] + DataStructures v0.17.20
  [e2d170a0] + DataValueInterfaces v1.0.0
  [2b5f629d] + DiffEqBase v6.44.3
  [459566f4] + DiffEqCallbacks v2.13.5
  [c894b116] + DiffEqJump v6.10.0
  [77a26b50] + DiffEqNoiseProcess v5.8.0
  [41bf760c] + DiffEqSensitivity v6.33.0
  [163ba53b] + DiffResults v1.0.3
  [b552c78f] + DiffRules v1.0.2
  [b4f34e82] + Distances v0.10.3
  [31c24e10] + Distributions v0.23.8
  [ffbed154] + DocStringExtensions v0.8.5
  [e30172f5] + Documenter v0.27.4
  [35a29f4d] + DocumenterTools v0.1.13
  [d4d017d3] + ExponentialUtilities v1.8.2
  [7a1cc6ca] + FFTW v1.3.2
  [f5851436] + FFTW_jll v3.3.9+8
  [9aa1b823] + FastClosures v0.3.2
  [1a297f60] + FillArrays v0.8.14
  [6a86dc24] + FiniteDiff v2.8.1
  [59287772] + Formatting v0.4.2
  [f6369f11] + ForwardDiff v0.10.18
  [069b7b12] + FunctionWrappers v1.1.2
  [60bf3e95] + GLPK v0.14.12
  [e8aa6df9] + GLPK_jll v5.0.0+0
  [781609d7] + GMP_jll v6.1.2+6
  [01680d73] + GenericSVD v0.3.0
  [708ec375] + Gumbo v0.8.0
  [528830af] + Gumbo_jll v0.10.1+1
  [2e9cd046] + Gurobi v0.9.14
  [cd3eb016] + HTTP v0.9.12
  [b5f81e59] + IOCapture v0.2.2
  [7869d1d1] + IRTools v0.3.3
  [d25df0c9] + Inflate v0.1.2
  [83e8ac13] + IniFile v0.5.0
  [1d5cc7b8] + IntelOpenMP_jll v2018.0.3+2
  [41ab1584] + InvertedIndices v1.0.0
  [b6b21f68] + Ipopt v0.7.0
  [9cc047cb] + Ipopt_jll v3.13.4+2
  [42fd0dbc] + IterativeSolvers v0.8.5
  [82899510] + IteratorInterfaceExtensions v1.0.0
  [692b3bcd] + JLLWrappers v1.3.0
  [682c06a0] + JSON v0.21.1
  [7d188eb4] + JSONSchema v0.3.3
  [4076af6c] + JuMP v0.21.4
  [2ee39098] + LabelledArrays v1.6.2
  [a5e1c1ea] + LatinHypercubeSampling v1.8.0
  [73f95e8e] + LatticeRules v0.0.1
  [4af54fe1] + LazyArtifacts v1.3.0
  [1d6d02ad] + LeftChildRightSiblingTrees v0.1.2
  [94ce4f54] + Libiconv_jll v1.16.0+8
  [093fc24a] + LightGraphs v1.3.5
  [d3d80556] + LineSearches v7.1.1
  [2ab3a3ac] + LogExpFunctions v0.2.5
  [e6f89c97] + LoggingExtras v0.4.7
  [bdcacae8] + LoopVectorization v0.8.26
  [d00139f3] + METIS_jll v5.1.0+5
  [856f044c] + MKL_jll v2021.1.1+1
  [d7ed1dd3] + MUMPS_seq_jll v5.2.1+4
  [1914dd2f] + MacroTools v0.5.6
  [b8f27783] + MathOptInterface v0.9.22
  [fdba3010] + MathProgBase v0.7.8
  [739be429] + MbedTLS v1.0.3
  [c8ffd9c3] + MbedTLS_jll v2.16.8+1
  [e1d29d7a] + Missings v1.0.0
  [46d2c3a1] + MuladdMacro v0.2.2
  [d8a4904e] + MutableArithmetics v0.2.20
  [d41bc354] + NLSolversBase v7.7.1
  [2774e3e8] + NLsolve v4.5.1
  [872c559c] + NNlib v0.6.6
  [77ba4419] + NaNMath v0.3.5
  [b8a86587] + NearestNeighbors v0.4.9
  [ca575930] + NetworkOptions v1.2.0
  [6fe1bfb0] + OffsetArrays v1.10.3
  [656ef2d0] + OpenBLAS32_jll v0.3.9+4
  [efe28fd5] + OpenSpecFun_jll v0.5.3+4
  [429524aa] + Optim v1.2.4
  [bac558e1] + OrderedCollections v1.4.1
  [1dea7af3] + OrdinaryDiffEq v5.42.3
  [7da25872] + Osi_jll v0.108.5+4
  [90014a1f] + PDMats v0.10.1
  [d96e819e] + Parameters v0.12.2
  [69de0a69] + Parsers v1.1.0
  [e409e4f3] + PoissonRandom v0.4.0
  [2dfb63ee] + PooledArrays v1.2.1
  [85a6dd25] + PositiveFactorizations v0.2.4
  [21216c6a] + Preferences v1.2.2
  [08abe8d2] + PrettyTables v1.1.0
  [33c8b6b6] + ProgressLogging v0.1.4
  [92933f4c] + ProgressMeter v1.7.1
  [1fd47b50] + QuadGK v2.4.1
  [8a4e6c94] + QuasiMonteCarlo v0.2.3
  [74087812] + Random123 v1.3.1
  [e6cf234a] + RandomNumbers v1.4.0
  [3cdcf5f2] + RecipesBase v1.1.1
  [731186ca] + RecursiveArrayTools v2.11.4
  [f2c3362d] + RecursiveFactorization v0.1.8
  [189a3867] + Reexport v0.2.0
  [ae029012] + Requires v1.1.3
  [ae5879a3] + ResettableStacks v1.1.1
  [37e2e3b7] + ReverseDiff v1.9.0
  [79098fc4] + Rmath v0.6.1
  [f50d1b31] + Rmath_jll v0.2.2+2
  [f2b01f46] + Roots v1.0.11
  [21efa798] + SIMDPirates v0.8.26
  [476501e8] + SLEEFPirates v0.5.5
  [322a6be2] + Sass v0.2.0
  [91c51154] + SentinelArrays v1.3.5
  [699a6c99] + SimpleTraits v0.9.4
  [ed01d8cd] + Sobol v1.5.0
  [a2af1166] + SortingAlgorithms v1.0.1
  [47a9eef4] + SparseDiffTools v1.9.1
  [276daf66] + SpecialFunctions v0.10.3
  [860ef19b] + StableRNGs v1.0.0
  [90137ffa] + StaticArrays v0.12.5
  [82ae8749] + StatsAPI v1.0.0
  [2913bbd2] + StatsBase v0.33.8
  [4c63d2b9] + StatsFuns v0.9.8
  [789caeaf] + StochasticDiffEq v6.25.0
  [69024149] + StringEncodings v0.3.5
  [fa267f1f] + TOML v1.0.3
  [3783bdb8] + TableTraits v1.0.1
  [bd369af6] + Tables v1.4.4
  [5d786b92] + TerminalLoggers v0.1.4
  [9f7883ad] + Tracker v0.2.16
  [3bb67fe8] + TranscodingStreams v0.9.5
  [a2a6695c] + TreeViews v0.3.0
  [5c2747f8] + URIs v1.3.0
  [3a884ed6] + UnPack v1.0.2
  [3d5dd08c] + VectorizationBase v0.12.33
  [19fa3120] + VertexSafeGraphs v0.1.2
  [ddb6d928] + YAML v0.4.7
  [a5390f91] + ZipFile v0.9.3
  [83775a58] + Zlib_jll v1.2.11+18
  [e88e6eb3] + Zygote v0.4.12
  [700de1a5] + ZygoteRules v0.2.1
  [47bcb7c8] + libsass_jll v3.5.5+0
  [2a0f44e3] + Base64 
  [ade2ca70] + Dates 
  [8bb1440f] + DelimitedFiles 
  [8ba89e20] + Distributed 
  [7b1f6079] + FileWatching 
  [9fa8497b] + Future 
  [b77e0a4c] + InteractiveUtils 
  [76f85450] + LibGit2 
  [8f399da3] + Libdl 
  [37e2e46d] + LinearAlgebra 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [a63ad114] + Mmap 
  [44cfe95a] + Pkg 
  [de0858da] + Printf 
  [3fa0cd96] + REPL 
  [9a3f8284] + Random 
  [ea8e919c] + SHA 
  [9e88b42a] + Serialization 
  [1a1011a3] + SharedArrays 
  [6462fe0b] + Sockets 
  [2f01184e] + SparseArrays 
  [10745b16] + Statistics 
  [4607b0f0] + SuiteSparse 
  [8dfed614] + Test 
  [cf7118a7] + UUIDs 
  [4ec0a83e] + Unicode 

(GenX) pkg> st
Project GenX v1.0.0
    Status `~/Documents/qvist/GenXProject/GenX/Project.toml`
  [6e4b80f9] BenchmarkTools v1.1.1
  [336ed68f] CSV v0.8.5
  [9961bab8] Cbc v0.8.0
  [e2554f3b] Clp v0.8.4
  [aaaa29a8] Clustering v0.14.2
  [861a8166] Combinatorics v1.0.2
  [a93c6f00] DataFrames v1.2.1
  [864edb3b] DataStructures v0.17.20
  [41bf760c] DiffEqSensitivity v6.33.0
  [b4f34e82] Distances v0.10.3
  [e30172f5] Documenter v0.27.4
  [35a29f4d] DocumenterTools v0.1.13
  [60bf3e95] GLPK v0.14.12
  [2e9cd046] Gurobi v0.9.14
  [b6b21f68] Ipopt v0.7.0
  [4076af6c] JuMP v0.21.4
  [fdba3010] MathProgBase v0.7.8
  [1dea7af3] OrdinaryDiffEq v5.42.3
  [8a4e6c94] QuasiMonteCarlo v0.2.3
  [2913bbd2] StatsBase v0.33.8
  [ddb6d928] YAML v0.4.7
  [ade2ca70] Dates 
  [37e2e46d] LinearAlgebra 
  [10745b16] Statistics 

julia> include("Example_Systems/RealSystemExample/ISONE_Singlezone/Run.jl")
Loading packages
[ Info: Precompiling GenX [5d317b1e-30ec-4ed6-a8ce-8d2d88d7cfac]
Configuring Solver
Loading Inputs
Reading Input CSV Files
ERROR: LoadError: BoundsError: attempt to access 0-element Array{Int64,1} at index [1]
Stacktrace:
 [1] getindex at ./array.jl:744 [inlined]
 [2] load_load_data(::Dict{Any,Any}, ::String, ::String, ::Dict{Any,Any}) at /home/anton/Documents/qvist/GenXProject/GenX/src/load_inputs/load_load_data.jl:78
 [3] load_inputs(::Dict{Any,Any}, ::String) at /home/anton/Documents/qvist/GenXProject/GenX/src/load_inputs/load_inputs.jl:54
 [4] top-level scope at /home/anton/Documents/qvist/GenXProject/GenX/Example_Systems/RealSystemExample/ISONE_Singlezone/Run.jl:60
 [5] include at ./boot.jl:328 [inlined]
 [6] include_relative(::Module, ::String) at ./loading.jl:1105
 [7] include(::Module, ::String) at ./Base.jl:31
 [8] include(::String) at ./client.jl:424
 [9] top-level scope at REPL[5]:1
in expression starting at /home/anton/Documents/qvist/GenXProject/GenX/Example_Systems/RealSystemExample/ISONE_Singlezone/Run.jl:60

Potential solution? By changing the line in Project.toml from: CSV = "0.6.0, 0.8" to CSV = "0.6.0", I can run the example.

If it matters, I am running 64-bit Ubuntu 20.04.2 LTS.

Superb project! /Anton

sambuddhac commented 3 years ago

@ASamarkRoth thanks for pointing this out. However, we are in the process of upgrading GenX to match with Julia 1.5.x and 1.6.x series and have accordingly updated the dependency versions in the Project.toml and Manifest.toml too. The PR for this upgrade is currently under our internal review. Please check in a couple days by pulling from main and these issues should have been resolved. We will let you know after the merge. Please check back and let us know then.

ASamarkRoth commented 3 years ago

@sambuddhac The latest release b0ae69fe27b1d985f4bdc4c4025735cf12fe39c6 fixed it.

Thanks and keep up the good work!

sambuddhac commented 3 years ago

YAY !!!! Thanks for all the encouragement and support.