Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Question about xml2csv tool and plot_csv_timeline visualization

I can confirm that this is a python3-specific issue which is fixed by using open(file) instead of open(file, 'rb').
In the development version of sumo, the tool is now usable with python2 and python3.

regards,
Jakob

Am Fr., 14. Jan. 2022 um 16:23 Uhr schrieb Hriday Sanghvi via sumo-user <sumo-user@xxxxxxxxxxx>:
Hello,

I am trying to visualise certain behaviour in my bare bones SUMO simulation. Initially, I want to reuse as many visualisation tools as mentioned in https://sumo.dlr.de/docs/Tools/Visualization.html as required to gain an insight of the behaviour of vehicles. I did not find an example for plotting certain output files like lanechange outputs.

As mentioned on https://sumo.dlr.de/docs/Simulation/Output/index.html , I am using the python tool xml2csv.py to convert lanechange output to CSV and then attempting to use https://sumo.dlr.de/docs/Tools/Visualization.html#plot_csv_timelinepy but I get the following error:

_csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)

After googling the error and on inspecting the source code (https://github.com/eclipse/sumo/blob/v1_11_0/tools/visualization/plot_csv_timeline.py), the line
 
with open(file, 'rb') as f:
 
seems to be opening it in binary format (bytes) and should instead be opened with 'r' flag instead of 'rb'. Is this a necessary change or is there something I am missing to make this work?
 
Thank you.

Sincerely,
Hriday
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top