-
-
Notifications
You must be signed in to change notification settings - Fork 330
Clean up a few Python 2-isms #586
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
Clean up a few Python 2-isms #586
Conversation
Hello @rahulporuri! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-09-18 19:27:16 UTC |
Could you also remove the references to python <3 in the requirements files? I was going to make my own PR but it should just go here. Patch file was
|
@clbarnes I've addressed your comment about the requirements files. |
modified: zarr/indexing.py modified: zarr/n5.py modified: zarr/storage.py modified: zarr/tests/test_convenience.py
utf-8 is the default source code file encoding on python 3
the string prefixes dont do anything on python 3 and are visual noise modified: zarr/tests/test_core.py modified: zarr/tests/test_creation.py modified: zarr/tests/test_filters.py modified: zarr/tests/test_hierarchy.py modified: zarr/util.py
The conditional always evaluates to True on Python 3 so the rest of the if/elif/else conditional has been removed modified: zarr/storage.py
modified: docs/release.rst
Rebased to fix conflicts. |
remove the import entirely and use os.replace instead of replace modified: zarr/storage.py
I believe the coverage failure is due the the decrease in number of LOC infiles that are not 100% covered. As the total number of lines decrease, if the number of uncovered lines decrease we get a relative change of percentage, leading to failure, even if no actual code get un-covered. +1 |
Thanks @Carreau for the fixes. I noticed in the middle of the week that there were conflicts and I was hoping to make time to address them this weekend :D |
No worries, I was on other things so it was relatively straightforward. Still like to get other more senior core dev approval on this. |
This PR removes a few remaining Python 2-isms from the codebase, namely :
super
i.e. instead ofsuper(ClassName, self)
, we just usesuper()
,coding
cookies from the top of files because on Python 3, utf-8 is the default source code file encoding,Note to reviewer : Each commit in this PR makes one and only one kind of change (listed above) so reviewing this PR commit-by-commit will be straightforward.
TODO:
Add unit tests and/or doctests in docstringsAdd docstrings and API docs for any new/modified user-facing classes and functionsNew/modified features documented in docs/tutorial.rst