Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some python files have python2 type style statements #49

Open
ekluzek opened this issue Dec 11, 2021 · 2 comments
Open

Some python files have python2 type style statements #49

ekluzek opened this issue Dec 11, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@ekluzek
Copy link
Contributor

ekluzek commented Dec 11, 2021

I found this running the python reformatter "black" on all of CTSM telling it to target python-3.7 and it pointed out the following files have python 2 type print statements so wouldn't work with python-3. Fixing it would be simple just changing lines
with

print "thing"

to

print( "thing" )

so the fix is straight-forward.

components/cism/source_cism/tests/dome/netCDF.py:
components/cism/source_cism/tests/halfar/halfar_results.py:
components/cism/source_cism/tests/halfar/netCDF.py:
components/cism/source_cism/tests/ismip-hom/netCDF.py:
components/cism/source_cism/tests/ismip-hom/plotISMIP_HOM.py:
components/cism/source_cism/tests/MISMIP3d/mismip3d.code/mismip3dRun.py:
components/cism/source_cism/tests/MISMIP3d/mismip3d.code/mismip3dSetup.py:
components/cism/source_cism/tests/MISMIP3d/mismip3d.code/mismip3dWriteGL.py:
components/cism/source_cism/tests/MISMIP/mismip.code/mismipPlotGL.py:
components/cism/source_cism/tests/MISMIP/mismip.code/mismipRun.py:
components/cism/source_cism/tests/MISMIP/mismip.code/mismipSetup.py:
components/cism/source_cism/tests/MISMIP/mismip.code/mismipWriteGL.py:
components/cism/source_cism/tests/MISOMIP/mismip+/mismip+Run.py:
components/cism/source_cism/tests/MISOMIP/mismip+/mismip+Setup.py:
components/cism/source_cism/tests/MISOMIP/mismip+/mismip+WriteGL.py:
components/cism/source_cism/tests/netCDF.py:
components/cism/source_cism/tests/new/netCDF.py:
components/cism/source_cism/tests/ross/netCDF.py:
components/cism/source_cism/tests/ross/plotRoss.py:
components/cism/source_cism/tests/shelf/netCDF.py:
components/cism/source_cism/tests/slab/netCDF.py:
components/cism/source_cism/tests/slab/plotSlab.py:
components/cism/source_cism/tests/stream/netCDF.py:
components/cism/source_cism/tests/unsupported/exact-isothermal/scripts/create_test.py:
components/cism/source_cism/tests/unsupported/exact-isothermal/scripts/plot_verif.py:
components/cism/source_cism/tests/unsupported/exact-isothermal/scripts/run_verif.py:
components/cism/source_cism/tests/viewNetCDF.py:
components/cism/source_cism/utils/f90_dependency_tool/f90_dependencies.py:

@ekluzek ekluzek added the enhancement New feature or request label Dec 11, 2021
@gunterl
Copy link
Contributor

gunterl commented Dec 12, 2021 via email

@ekluzek
Copy link
Contributor Author

ekluzek commented Dec 12, 2021

@gunterl OK I assigned it to you as asked. From my perspective this isn't a pressing issue as I know of no problems with this. If any of this python code is run with python3 it will fail, so it could be important for that reason. It looks like most of these are for tests so might not be regularly run. python2 is no longer supported, it's still around on some machines however, so you can sometimes work around that.

Being able to easily catch this does make me want to recommend the use of the black python formatter though. I will add that.

So bottom line -- no not pressing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants