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

Update Standalone MAPL Python to work with Python 2 and 3 #775

Merged
merged 4 commits into from
Mar 25, 2021

Conversation

mathomp4
Copy link
Member

Description

This PR updates 3 of the Python scripts in MAPL to work with Python 2 and 3 using 2to3 as well as hints from:

http://python-future.org/compatible_idioms.html

I was able to test both:

  • base/mapl_tree.py
  • base/mapl_vlist.py

and tree was zero diff, and vlist was...actually more accurate in Python 3. But the Python 2 output was not changed.

As for Apps/MAPL_GridCompSpecs_ACG.py, I wasn't sure how to test it, but the change 2to3 made was slight and I can't see how it could fail.

NOTE: This PR does not change the scripts in Python/MAPL as I'm not too sure how to test those.

Related Issue

Motivation and Context

Transition from Python 2 to 3 is needed soon.

How Has This Been Tested?

I ran each of the scripts to make sure it worked (save the ACG one which I can't imagine won't)

I also ran a 1-day c24 run of GEOS with MAPL develop versus this branch. It built and was zero-diff.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)

Checklist:

  • I have tested this change with a run of GEOSgcm (if non-trivial)
  • I have added one of the required labels (0 diff, 0 diff trivial, 0 diff structural, non 0-diff)
  • I have updated the CHANGELOG.md accordingly following the style of Keep a Changelog

@mathomp4 mathomp4 added the 0 Diff The changes in this pull request have verified to be zero-diff with the target branch. label Mar 25, 2021
@mathomp4 mathomp4 self-assigned this Mar 25, 2021
@mathomp4 mathomp4 requested review from a team as code owners March 25, 2021 13:49
@mathomp4 mathomp4 merged commit 00e1f89 into develop Mar 25, 2021
@mathomp4 mathomp4 deleted the feature/mathomp4/convert-mapl-python-to-py3 branch March 25, 2021 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 Diff The changes in this pull request have verified to be zero-diff with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants