TacHawkes / HITRAN.jl

Spectrum calculation using the HITRAN database for Julia
MIT License
7 stars 0 forks source link

ERROR: ArgumentError: invalid index: :name of type Symbol #16

Closed jtravs closed 2 years ago

jtravs commented 2 years ago

If I try to follow the quick start example I get an error:


julia> using HITRAN

julia> fetch!("StdAtm", iso_id(["N2", "O2", "CO2", "H2O", "CH4"]), 12900, 13200, [:standard, :ht_self])
[ Info: No custom HITRAN database specified, opening 'HITRAN.sqlite' (default)
ERROR: ArgumentError: invalid index: :name of type Symbol
Stacktrace:
 [1] to_index(i::Symbol)
   @ Base .\indices.jl:300
 [2] to_index(A::Vector{SQLite.DBTable}, i::Symbol)
   @ Base .\indices.jl:277
 [3] to_indices
   @ .\indices.jl:333 [inlined]
 [4] to_indices
   @ .\indices.jl:325 [inlined]
 [5] getindex(A::Vector{SQLite.DBTable}, I::Symbol)
   @ Base .\abstractarray.jl:1218
 [6] fetch!(db::SQLite.DB, name::String, global_ids::Vector{Int64}, ν_min::Int64, ν_max::Int64, parameters::Vector{String})
   @ HITRAN C:\Users\jt52\.julia\packages\HITRAN\KOVNJ\src\database.jl:79
 [7] fetch!(db::SQLite.DB, name::String, global_ids::Vector{Int64}, ν_min::Int64, ν_max::Int64, parameters::Vector{Symbol})
   @ HITRAN C:\Users\jt52\.julia\packages\HITRAN\KOVNJ\src\database.jl:125
 [8] fetch!(name::String, global_ids::Vector{Int64}, ν_min::Int64, ν_max::Int64, parameters::Vector{Symbol})
   @ HITRAN C:\Users\jt52\.julia\packages\HITRAN\KOVNJ\src\database.jl:134
 [9] top-level scope
   @ REPL[2]:1

Can you help me understand what is wrong? I am using

julia> versioninfo()
Julia Version 1.7.0
Commit 3bf9d17731 (2021-11-30 12:12 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Xeon(R) W-11955M CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, tigerlake)
TacHawkes commented 2 years ago

Woops... CI didn't catch that one. It is related to this issue: https://github.com/TacHawkes/HITRAN.jl/issues/15 My fix for that issue missed this line.

I will fix this ASAP.

TacHawkes commented 2 years ago

Fixed as of 0.2.13

jtravs commented 2 years ago

Thanks for the amazingly fast response! All works fine at my end too.