Updated enzo and test suite to be compatible with both python2 and python3

#363 Merged at 6e0abf5
  1. Brian OShea

This required a ton of changes, many of which are very simple.

  1. src/enzo/create_config_info.py now uses hglib to get version information
  2. Many tests in run/ have had print statements upgraded to be py3 compatible.
  3. One test in the run/ directory was removed because it used old and useless yt machinery (as per @ngoldbaum 's suggestion)
  4. run/test_runner.py has been converted (to the greatest extent possible) to use hglib instead of direct calls to mercurial.

This requires hglib to be installed (which is installable via pip in Python 3 and by hand in Python 2), and also requires sympy to be upgraded to version 1.0 or greater.

This is still labeled a Work In Progress (WIP) because the bisector() method does not work with Python 3 at this point - there's not an hglib equivalent to hg.bisector(). Right now I check for version (on line 161 or thereabouts) and if somebody tries to use it with Python3 it throws an error and exits. If somebody has an idea of how to fix this, great; if not, we'll just keep it as-is.

  • Commit status

Comments (5)

  1. Nathan Goldbaum

    Have the docs on how to run the test suite been updated? In particular, it would be good to note that we support python2 and python3 and that python-hglib needs to be installed.

      1. Brian OShea author

        This has now been done (see changes to doc/manual/source/user_guide/EnzoTestSuite.rst)

  2. Brian OShea author

    OK, at this point I think this is no longer a WIP. Updates since the original commit:

    • Documentation has been added
    • The one test problem that uses an assert() has been updated to not use outdated AssertWrapper tools in yt (as per conversation with Nathan)
    • Everything that accesses Mercurial now uses hglib
    • To the greatest extent possible, we use common commands for Python2 and 2 so we don't have to use sys.version checks (with one exception)
    • The bisection option has been removed because it's complicated, hard to update, and completely unused.
    • I have added a "CosmoSim" category, in preparation for a future PR where the test suite includes cosmology simulations.

    I have also verified that the test suite runs successfully, and in approximately the same amount of time, using both Python2 and Python3.