This PR provides Python 3 support and fixes a couple of small issues that were found along the way, mostly with scripts. Python 2 is still supported (same code).
The "port" consisted of:
Get the unit tests all working in 3 (and still in 2). In some cases tests failed not because the code was bad, but because the ordering of things was different in Python 3, for cases where ordering was not guaranteed. Relates to #69 and probably some issues @dnadeau-lanl was having.
Process all PSP/ISOIS 2018 data using the new dbprocessing, in both Python 2 and 3. Outputs were compared, no changes.
Every single script in the scripts directory was checked with 2to3 (although the output was not blindly accepted), then run and patched up if the output wasn't the same in 2 and 3. For a lot of these, there were issues where Python 3 shuts down the interpreter in a different order. If a DButils instance is still instantiated at shutdown, its __del__ method may be called after sqlalchemy is shut down, and so the CloseDB method fails. So many scripts were updated to explicitly delete the DButils instance if it didn't go out of scope before the end of the script.
PR Checklist
[X] Pull request has descriptive title
[X] Pull request gives overview of changes
[X] New code has inline comments where necessary
[X] Any new modules, functions or classes have docstrings consistent with dbprocessing style
[X] (N/A) Major new functionality has appropriate Sphinx documentation
[X] Added an entry to release notes if fixing a major bug or providing a major new feature
[X] New features and bug fixes should have unit tests
[X] (N/A) Relevant issues are linked in the description (use Closes # if this PR closes the issue, or some other reference, such as See # if it is related in some other way)
This PR provides Python 3 support and fixes a couple of small issues that were found along the way, mostly with scripts. Python 2 is still supported (same code).
The "port" consisted of:
scripts
directory was checked with 2to3 (although the output was not blindly accepted), then run and patched up if the output wasn't the same in 2 and 3. For a lot of these, there were issues where Python 3 shuts down the interpreter in a different order. If aDButils
instance is still instantiated at shutdown, its__del__
method may be called after sqlalchemy is shut down, and so theCloseDB
method fails. So many scripts were updated to explicitly delete theDButils
instance if it didn't go out of scope before the end of the script.PR Checklist
Closes #
if this PR closes the issue, or some other reference, such asSee #
if it is related in some other way)