openPMD / openPMD-validator

:ballot_box_with_check: Validator and Example Scripts
ISC License
4 stars 8 forks source link

Add Python3 Compatibility #7

Closed PrometheusPi closed 8 years ago

PrometheusPi commented 8 years ago

In the current version branch for openPMD 1.0.0 the files are not working with python 3.

checkOpenPMD_h5.py causes the following error:

  File "./checkOpenPMD_h5.py", line 417
    except KeyError, TypeError :
                   ^
SyntaxError: invalid syntax

createExamples_h5.py causes the following error:

File "./createExamples_h5.py", line 553, in <module>
    setup_base_path(f, iteration=0)
  File "./createExamples_h5.py", line 53, in setup_base_path
    base_path = get_basePath(f, iteration)
  File "./createExamples_h5.py", line 38, in get_basePath
    return f.attrs["basePath"].replace("%T", str(iteration))
TypeError: 'str' does not support the buffer interface
ax3l commented 8 years ago

I know, discovered that already in the morning: https://github.com/openPMD/openPMD-validator/pull/6#issuecomment-168984455

needs some work, I will leave this issue open for it.

ax3l commented 8 years ago

implemented and CI tested against 2.7, 3.4 and 3.5