-
Notifications
You must be signed in to change notification settings - Fork 96
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
Switch Buffer
s to memoryview
s
#656
base: main
Are you sure you want to change the base?
Conversation
923df20
to
e7afaa2
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #656 +/- ##
=======================================
Coverage 99.92% 99.92%
=======================================
Files 62 62
Lines 2721 2721
=======================================
Hits 2719 2719
Misses 2 2
|
7255767
to
2a942ad
Compare
When this was written in the code, Python's Buffer Protocol support was inconsistent across Python versions (specifically on Python 2.7). Since Python 2.7 reached EOL and it was dropped from Numcodecs, the Python Buffer Protocol support has become more consistent. At this stage the `memoryview` object, which Cython also supports, does all the same things that `Buffer` would do for us. Plus it is builtin to the Python standard library. It behaves similarly in a lot of ways. Given this, switch the code over to `memoryview`s internally and drop `Buffer`.
Planning to merge end of week if no comments |
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.
This seems like a great improvement. Thanks so much @jakirkham!
Unfortunately my Cython isn't really good enough to provide a useful review. But the tests pass! 😆 And we are reducing LoC and simplifying many functions. So seems like a great direction.
Someone who actually groks Cython should review this for real.
@jakirkham any interest in pushing this forward? |
When this was written in the code, Python's Buffer Protocol support was inconsistent across Python versions (specifically on Python 2.7). Since Python 2.7 reached EOL and it was dropped from Numcodecs, the Python Buffer Protocol support has become more consistent.
At this stage the
memoryview
object, which Cython also supports, does all the same things thatBuffer
would do for us. Plus it is builtin to the Python standard library. It behaves similarly in a lot of ways.Given this, switch the code over to
memoryview
s internally and dropBuffer
.TODO: