-
Notifications
You must be signed in to change notification settings - Fork 130
Closed
Description
Describe the bug
Exception when running osi2read.py
Typo in the code
Describe how to reproduce the bug
Steps to reproduce the behavior:
- Download compressed OSI file. https://github.com/OpenSimulationInterface/open-simulation-interface/blob/250137581977f962acef6c2003c3d61fb55fb964/tests/data/small_test.txt.lzma
- Clone open-simulation-interface locally and install it as described in the official readme: https://github.com/OpenSimulationInterface/open-simulation-interface/tree/250137581977f962acef6c2003c3d61fb55fb964#install-for-python-usage
- go to
formatdirectory, copysmall_test.txt.lzmathere. python osi2read.py --data small_test.txt.lzma --output zaza.txt
Describe the expected behavior
Expected behavior: output text file is created.
Actual behavior: exception
/home/user/work/hackathon/open-simulation-interface/format/OSITrace.py:139: RuntimeWarning: Unexpected end-group tag: Not all data was converted
message.ParseFromString(serialized_message[i+INT_LENGTH:i+INT_LENGTH+message_length])
Error
Traceback (most recent call last):
File "/usr/lib/python3.6/unittest/case.py", line 59, in testPartExecutor
yield
File "/usr/lib/python3.6/unittest/case.py", line 605, in run
testMethod()
File "/home/user/work/hackathon/open-simulation-interface/tests/test_osi_trace.py", line 18, in test_osi_trace
trace.make_readable(path_output, index=1)
File "/home/user/work/hackathon/open-simulation-interface/format/OSITrace.py", line 239, in make_readable
f.write(str(scenario.get_message_by_index(0)))
NameError: name 'scenario' is not defined
Show some screenshots
see stacktrace above
Describe the OS you are using
- OS: Ubuntu 18.04
- Language: Python
- Version 3.6.9
Additional context
none
Metadata
Metadata
Assignees
Labels
No labels