-
Notifications
You must be signed in to change notification settings - Fork 141
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
python3 support for NEXUS and QMCPACK #1290
Comments
Yes, it does look like the time is indeed now: https://python3statement.org/. I am in favor of making a clean break to full Python 3 support and dropping Python 2 as this is less work and there is little benefit to continue Python 2 support in the transition. The changes are not small, e.g. the meaning of division changes and several core class functions (e.g. for dict's) have altered return types. The extensive use of Nexus' obj class rather than dict may blunt the impact of some of the changes, but I will just need to dig in and try it. The main work item, prior to full porting, is further rounding out the test set and then porting over the needed changes. I will edit the initial comment to list work items. |
I just tried this morning to port the core generic module to Python 3. This is a good starting point because extensive unit tests exist for this module. I was successful after a couple of hours, though some of the changes required were revealing. For example, Python 3 sorting is no longer generic (it now simply falls over when sorting a list containing, say integers and strings). This feature is relied upon heavily in some I/O and error reporting. I ended up finding a python2-like fall back sort online that I will try to use instead. Another change is in NumPy's class hierarchy (may or may not be linked with Python 3), i.e. numpy integers are no longer derived from Python integers which makes dynamic type checking more complicated. Perhaps there is a way to capture both without complicating the code, but it will take a little more searching. |
Anyone who is interested can follow developments in my Python 3 branch of Nexus: |
@prckent close this? I think we have more recent issues to track this. |
And we have transitioned! Closing. |
A transition is needed due to python 2.7 becoming unsupported soon. https://pythonclock.org/
How much work will it take?
See #158 (Nexus tests) for detailed breakdown of needed tests.
The text was updated successfully, but these errors were encountered: