-
Notifications
You must be signed in to change notification settings - Fork 99
Refactor and use more buffer view coercion #121
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
Closed
Closed
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
37f34fa
Add alias to `buffer` on Python 2/3
jakirkham a2f667f
Add `to_buffer` function
jakirkham 290581a
Use `to_buffer` to implement `buffer_tobytes`
jakirkham aa25a3f
Use `to_buffer` in `BZ2` to avoid a copy
jakirkham f17767d
Use `to_buffer` in `GZip` encoding and decoding
jakirkham 987087f
Use `to_buffer` in `LZMA` to avoid a copy
jakirkham c2841af
Use `to_buffer` in `Zlib` encoding and decoding
jakirkham d50b664
Drop `handle_datetime` as `to_buffer` handles this
jakirkham 9b51e4f
Only cast datetime/timedeltas in `to_buffer`
jakirkham f585c63
Flip Python 2/3 cases in `to_buffer`, fix pragmas
jakirkham bf5638e
Raise in `to_buffer` if `object` array is provided
jakirkham 4425833
Use `buffer_tobytes` on non-`object` types in test
jakirkham d03f4c6
Check `buffer_tobytes` raises on `object` arrays
jakirkham c2ae1c4
Drop object checks from BZ2, GZip, LZMA, and Zlib
jakirkham c7b3f35
Cast datetime/timedelta arrays to uint64
jakirkham 1052108
Revert "Use `buffer_tobytes` on non-`object` types in test"
jakirkham 2764be8
Merge branch 'master' into use_more_buffers
jakirkham 732fac7
Simply catch all non-`memoryview` coercible types
jakirkham 7368f07
Test coercing `mmap`'s to `bytes` as well
jakirkham 923d354
Tests `to_buffer` alongside `buffer_tobytes`
jakirkham 1477dff
Breakup array handling, object check, & Python 2/3
jakirkham 7fbb4d6
Use `try...except...else` with `memoryview`
jakirkham ddfbaee
Reshape all `memoryview`s using NumPy
jakirkham 8b8d93e
Use `b` instead of `m`
jakirkham 27b6ce3
Move reshape into `else`
jakirkham 43ba708
Swap `object` array cases
jakirkham 33bb8a3
Mark `to_buffer`'s NumPy array as readonly
jakirkham f934c85
Test `to_buffer` returns readonly buffers
jakirkham ce5bce1
Coerce `memoryview`s and `buffer`s to `ndarray`s
jakirkham 32721f6
Use `np.getbuffer` instead of `buffer`
jakirkham 30b63d2
Fix-up some codecs to handle `ndarray`
jakirkham 98a7860
Check that `to_buffer` returns an `ndarray`
jakirkham c046a72
Ensure `array` has the correct type on Python 2
jakirkham 5fb505d
State `arange` type in `test_buffer_coercion`
jakirkham efc7552
Test that `to_buffer` maintains types
jakirkham 230da21
Drop the cast to `memoryview` in `to_buffer`
jakirkham af0946d
Use to_buffer directly instead of buffer_tobytes
jakirkham a0d299d
Drop `buffer_tobytes`
jakirkham dc58d20
Check that the buffer and the ndarray share memory
jakirkham d6bac35
Test type matches against `ndarray`
jakirkham cd550a6
Drop tests of `ndarray` coercion
jakirkham ad90e70
Skip coercion of `ndarray`s
jakirkham ab159bf
Join type checks after coercing non-`ndarray`s
jakirkham 5b780d3
Limit casting of `array` to Python 2
jakirkham 18f2f33
Drop disabling writing in `to_buffer`
jakirkham 3aea13f
Move array coercion to `ndarray_from_buffer`
jakirkham 398a3e9
Handle casting outside of `ndarray_from_buffer`
jakirkham 592be49
Drop `ndarray_from_buffer`'s `dtype` argument
jakirkham fa92401
Handle reshaping outside of `ndarray_from_buffer`
jakirkham 16701a8
Rewrite `buffer_copy` using `to_buffer`
jakirkham 7a2b3b7
Raise for unicode `array` in `ndarray_from_buffer`
jakirkham 074bf31
Check that unicode `array`'s raise an error
jakirkham de0a947
Revert "Check that unicode `array`'s raise an error"
jakirkham eacfdd7
Revert "Raise for unicode `array` in `ndarray_from_buffer`"
jakirkham 9d43a3b
Cast around unicode array
jakirkham d0b0ef7
Test handling of unicode `array`s
jakirkham a789c4d
Add utility `getbuffer` function
jakirkham e01195c
Use `getbuffer` for checking shared memory
jakirkham 94fcc37
Preserve `memoryview` of `array`'s `itemsize`
jakirkham 5aa7b89
Re-raise `TypeError` on Python 3
jakirkham f0b5508
Test that non-buffer types raise errors
jakirkham 78d39a2
Merge 'zarr-developers/master' into 'jakirkham/use_more_buffers'
jakirkham 96625e8
Drop PY2K/PY3K `buffer` assignment
jakirkham ae0434f
Inline `getbuffer`
jakirkham 3ed988b
Cast `memoryview` to `uint8` for `shares_memory`
jakirkham 1f1f9f4
Add no cover pragmas for shared memory test
jakirkham 95f38a5
Merge 'zarr-developers/master' into 'jakirkham/use_more_buffers'
jakirkham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.