-
Notifications
You must be signed in to change notification settings - Fork 14
updating python to python3 #23
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates tutorials/tutorial1/gen_Uijkl.py from Python 2 to Python 3 syntax. The changes modernize the code to be compatible with Python 3 by replacing deprecated Python 2 constructs with their Python 3 equivalents. However, this appears to be a partial migration as other Python files in the same tutorial directory (gen_hopping.py, gen_hyb.py, plot.py) still use Python 2 syntax.
Key changes:
- Replaced all
xrange()calls withrange()(Python 3 equivalent) - Converted
print >>f, ...statements toprint(..., file=f)function calls
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for k in range(nf): | ||
| if j==k: | ||
| print >>f, i, j, k, g_tau[i].real, g_tau[i].imag | ||
| print(i, j, k, g_tau[i].real, g_tau[i].imag,file=f) |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space before file=f parameter. Should be print(i, j, k, g_tau[i].real, g_tau[i].imag, file=f) with a space after the comma preceding file=f for consistency with PEP 8 style guidelines.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Hiroshi, could you please have a brief look that you approve?
Thanks!
Emanuel