-
Notifications
You must be signed in to change notification settings - Fork 11
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
Updating print statements for Python 3 compatibility #101
Conversation
Hi @smmaurer, your separate PRs and testing for the Python3 updates are great. Is this import line so the updates will work in Python2 as well? If so, does baus.py also need it? |
Hi @theocharides - Yes, the import line is the official way to support Incidentally, I think Python 2.7 supports print statements with parentheses even without the special import, but including it makes things more reliable. The model log formatting didn't look quite right until we included it. |
Identical TAZ 2050 files using Windows, with and without PR. Tested Python 2 (numpy 1.10.0), but am unable to test Python 3 at this juncture since the rest of the Python 3 updates aren't in place. |
This PR updates print statements throughout
bayarea_urbansim
to support Python 2.7 and 3.x concurrently. This is the first part of a larger set of cross-compatibility updates, described in https://github.com/urbansim/mtc-planning/issues/4.Thanks to @alephcero for all the work on this!
Testing
No reason to expect any model logic to change, but we set a random seed and checked
runXX_taz_summaries_2015.csv
just in case -- identical output.Notes about merging
This PR includes the fixes to support NumPy 1.16, from PR #99, because we'd already merged them into the master branch of our fork.
So it will probably go smoother if you merge #99 before merging this one. If you decide not to merge #99, we can revert those commits from this PR -- it's the first 5, from June 8 and June 17, and it's easiest to revert things in reverse order!