sisl / ngsim_env

Learning human driver models from NGSIM data with imitation learning.
https://arxiv.org/abs/1803.01044
MIT License
172 stars 80 forks source link

julia convert_raw_ngsim_to_trajdatas() got error "no method matching rename!(::DataFrames.Index, ::Symbol, ::Symbol)" #13

Closed ViviXiang closed 5 years ago

ViviXiang commented 5 years ago

I follow the instrcutions in https://github.com/sisl/ngsim_env/blob/0.7fixes_in_progress/docs/install_env_gail_full.md

and I got an error when executing :

Create trajectories from the data

$julia julia> using NGSIM julia> convert_raw_ngsim_to_trajdatas()

The output is: converting i101_trajectories-0750am-0805am.txt loading from file: ┌ Warning: readtable is deprecated, use CSV.read from the CSV package instead │ caller = ip:0x0 └ @ Core :-1 ERROR: MethodError: no method matching rename!(::DataFrames.Index, ::Symbol, ::Symbol) Closest candidates are: rename!(::DataFrames.Index, ::Any) at /home/vivi/.julia/packages/DataFrames/m9gd9/src/other/index.jl:49 rename!(::DataFrames.AbstractDataFrame, ::Any...) at /home/vivi/.julia/packages/DataFrames/m9gd9/src/abstractdataframe/abstractdataframe.jl:127 rename!(::DataFrames.Index, ::Pair{Symbol,Symbol}...) at /home/vivi/.julia/packages/DataFrames/m9gd9/src/other/index.jl:60 Stacktrace: [1] rename!(::DataFrames.DataFrame, ::Symbol, ::Symbol) at /home/vivi/.julia/packages/DataFrames/m9gd9/src/abstractdataframe/abstractdataframe.jl:127 [2] NGSIMTrajdata(::String) at /home/vivi/.julia/packages/NGSIM/OPF1x/src/ngsim_trajdata.jl:37 [3] #load_ngsim_trajdata#35(::Bool, ::Function, ::String) at /home/vivi/.julia/packages/NGSIM/OPF1x/src/trajdata.jl:146 [4] load_ngsim_trajdata at /home/vivi/.julia/packages/NGSIM/OPF1x/src/trajdata.jl:145 [inlined] [5] convert_raw_ngsim_to_trajdatas() at /home/vivi/.julia/packages/NGSIM/OPF1x/src/trajdata.jl:200 [6] top-level scope at none:0

It seems like there exists no such rename fnuctions from the loaded modules. Can somebody help me with this issue?

djp42 commented 5 years ago

Hi ViviXiang,

Thanks for the question! Which version of Julia are you using? Alternatively, there might be a broken dependency in the DataFrames / NGSIM package.

The most up-to-date DataFrames has a different renaming function than the one NGSIM seems to call, according to julia wikibooks. It seems like it should be rename!(df, :old => :new) instead of rename!(df, :old, :new) at ngsim_trajdata.jl:37. The NGSIM package lives here: . Please start an issue there if we know it isn't ngsim_env specific.

Action items for you:

CC: @MaximeBouton - does the above sound reasonable?

ViviXiang commented 5 years ago

@djp42 Using rename!(df, :old => :new) instead of rename!(df, :old, :new) at [ngsim_trajdata.jl:37] really helps, thanks very much for your help.

MaximeBouton commented 5 years ago

Could you maybe submit a PR or restrict the version of dataframes?