Error while running test.py

3 posts / 0 new
Last post
Yanchao Liu
Error while running test.py

Hello,

I tried running the evaluation script published at https://github.com/GOCompetition/Evaluation

without any modification, and got an error. Below is the run log containing the error message. Can someone help with this?

Thanks!

Yanchao

-------------------------

(C:\Users\gn0061\AppData\Local\Continuum\Anaconda3) C:\Users\gn0061\GoogleDrive\gamsdir\GridOpt\Evaluation-master\Evaluation-master>python test.py .\examples\case2\case.raw .\examples\case2\case.rop .\examples\case2\case.con .\examples\case2\case.inl .\examples\case2\sol1.txt .\examples\case2\sol2.txt .\examples\case2\summary.csv .\examples\case2\detail.csv 
read raw time: 0
read rop time: 0
read con time: 0
read inl time: 0
buses: 2
loads: 1
fixed_shunts: 0
generators: 1
nontransformer_branches: 1
transformers: 0
areas: 1
switched_shunts: 1
generator inl records: 1
generator dispatch records: 1
active power dispatch records: 1
piecewise linear cost functions: 1
contingencies: 2
read sol_base time: 0
set data time: 0
set params time: 0
set sol1 time: 0
eval base time: 0
exception in evaluation.run
Traceback (most recent call last):
  File "test.py", line 51, in <module>
    run()
  File "test.py", line 41, in run
    args.detail,
  File "C:\Users\gn0061\GoogleDrive\gamsdir\GridOpt\Evaluation-master\Evaluation-master\evaluation.py", line 2039, in run
    e.write_header(detail_name)
  File "C:\Users\gn0061\GoogleDrive\gamsdir\GridOpt\Evaluation-master\Evaluation-master\evaluation.py", line 736, in write_header
    'xfmrdmax-val',
TypeError: a bytes-like object is required, not 'str'

Total votes: 541
Dr. Stephen Elbert
Error while running test.py

This appears to be a Python 2 vs. Python 3 problem. The evaluation script was writen for Python 2. The Readme file has been updated to reflect this.

Dr. Stephen Elbert
Error while running test.py

https://github.com/GOCompetition/Evaluation has been rewritten to be compatible with Python 2 and Python 3.