danielkoll / PyRADS

A line-by-line longwave radiation code for planetary atmospheres.
MIT License
30 stars 9 forks source link

Add Python 2/3 compatibility #9

Closed brian-rose closed 5 years ago

brian-rose commented 5 years ago

Closes #7

Makes stuff work on both Python 2.7 and Python 3.x

Key changes:

Finally I included a .gitignore file in the repository to simplify the version control of code while excluding compiled objects.

brian-rose commented 5 years ago

@ddbkoll you should take a careful look before merging, I may easily have broken something.

I verified that the two test scripts in the repository will now both run (and seem to produce the same result) under Python 2.7 and 3.7.

But there is probably a lot of code that these test scripts do not touch.

brian-rose commented 5 years ago

Oh, I forgot one other change.

The string methods string.atof() and string.atoi() are replaced with simple built-in conversions float() and int().

Those methods were deprecated in Python 2 some time ago and totally absent from Python 3.