cedadev/cf-checker

Python 3 support?

Closed this issue ยท 10 comments

The package currently fails on Python 3.6:

Traceback (most recent call last):
  File "c:\users\xxxx\appdata\local\py3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\xxxx\appdata\local\py3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\xxxx\AppData\Local\py3\Scripts\cfchecks.exe\__main__.py", line 5, in <module>
  File "c:\users\xxxx\appdata\local\py3\lib\site-packages\cfchecker\cfchecks.py", line 322
    print "====================="
                                ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("=====================")?

Any particular reason for having the PR #44 pending since April?

Primarily because I have not had time. I'm now working on a couple of bug fixes which I need to get in ASAP. Once I've done that and have a few spare moments I'll sort out the python3 PR.

It would be great to have Python 3 support. Would it be an option to accept PR #44 ? There seem to be no conflicts.

I really need to get the bug fixes in first, which have turned out more complicated, before I ideally merge PR #44. However, I will try and do it the other way around next week, as I realise there are quite a few folks wanting python3.

@RosalynHatcher, how is this library different from the CF checks in https://github.com/ioos/compliance-checker?

They look a bit ahead on Python 3 support: ioos/compliance-checker#557

@giumas: As far as I am aware the ioos compliance checker only checks against a specific version of CF (i.e. CF-1.6) but can also check against other NetCDF conventions (e.g. NCEI Grid). This checker keeps up-to-date with the CF releases and can check against any version of NetCDF-CF from CF-1.0 up to and including the most recent release CF-1.8. Hope that helps.

Hi, thanks for the great package! Any news on this issue ? Major scientific libraries are starting dropping python 2 support, and we will do the same soon... Any way I can help ?

@mraspaud: There is a python3 branch on this repository which I'm very close to doing an initial release on. I'm just working on a couple of general bug fixes and will then release. If you would like to try it out before I cut a release please do.

Thanks for the update. I'll try out the python 3 branch and report back.

I just tested a couple of files, and find it's working as expected in python 3. The output is consistent with the python 2 version in my tests.

@mraspaud: Thank you for trying it out. I shall go ahead and do a first release candidate shortly.