1. Nick Coghlan
  2. cpython_sandbox

Branches

memoryview

View source
memoryview
  • Contributors
    1. Loading...
Author Commit Message Date Builds
250+ commits behind default.
Stefan Krah
Remove unused variable.
Stefan Krah
Merge changes from default.
Stefan Krah
Make mbuf_copy_format a static function.
Stefan Krah
1) Remove "not implemented" passage in the tobytes() section. 2) State explicitly that suboffsets as purely informational.
Stefan Krah
Rewrite paragraph about format restrictions.
Stefan Krah
Change array order variable from 'fortran' to 'order'.
Stefan Krah
Issue #13411: Add hashable memoryviews.
Stefan Krah
Merge changes from default.
Stefan Krah
1) cmp_structure: Allow leading '@' in format comparison. 2) memory_item: Add comment. 3) is_multislice: Re-use size. 4) memory_subscript: a) Reformat comment. b) Rename variable. c) Remove unnecessary else clause. 5) memory_ass_sub: a) Use consistent form for return value check. b) Optimize init_len() for 1D. 6) memory_richcompare: a) Use consistent style for labels and return value check. b) Use cmp_structure() to…
Stefan Krah
cast_to_1D() now always sets ValueError.
Stefan Krah
1) Set the error messages in cast_to_1D() instead of in get_native_fmtchar(). 2) Since len is now calculated in copy_shape, use the value directly. 3) Consistent style.
Stefan Krah
Change memoryview 'len' attribute to 'nbytes'. 'len' was new in version 3.3, so no deprecation is needed.
Stefan Krah
Additional suppressions required for non-debug build.
Stefan Krah
Use 'order' instead of 'fort'.
Stefan Krah
1) Fix PyMemoryView_GetContiguous(). The following major changes were necessary: a) Add capability to the managed buffer to store and release a copy of the format of the original exporter. The original exporter may disappear if a new bytes object is used as the underlying object for a contiguous read-only copy. b) In the latter case, also copy shape, strides and suboffsets from the original object. Otherwise the new memoryview would use the incorrect …
Stefan Krah
Use (implicitly documented) fact that PyLong_AsVoidPtr() will always return NULL on error. See also issue #13522.
Stefan Krah
Use negative return value to detect an error.
Stefan Krah
More whitespace.
Stefan Krah
Whitespace.
Stefan Krah
Whitespace and comments.
Stefan Krah
Use parentheses consistently.
Stefan Krah
Remove redundant break statements.
Stefan Krah
Drop single instance of casting the return value of PyErr_Format().
Stefan Krah
Include the object name in the error message.
Stefan Krah
Replace tests that fail due to issue #13072.
Stefan Krah
Rename mv_alloc() to memory_alloc().
Stefan Krah
Fix grammar in comment.
Stefan Krah
Add parameter definitions to the cast() method.
Stefan Krah
Fix grammar.
Stefan Krah
Two examples are sufficient.
Stefan Krah
Add reminder that the internal field should be used to keep track of buffer-specific resources.
Stefan Krah
Use consistent spelling for "read-only".
Stefan Krah
Fix typo.
Stefan Krah
Spell out Py_DECREF() in full.
Stefan Krah
Stylistic improvement.
Stefan Krah
Fix typo.
Stefan Krah
Docs: use "provide" instead of "return".
Stefan Krah
Use '==' for equality in the docs.
Stefan Krah
Merge changes from default.
Stefan Krah
Fix typo in comment.
Stefan Krah
Merge changes from default.
Stefan Krah
Use changed exceptions.
Stefan Krah
o Test that memoryview and struct accept the same objects for all format specifiers. o Remove redundant generator loop.
Stefan Krah
o Also accept objects with an __index__() method for integer formats. o Improve exceptions and error messages.
Stefan Krah
Merge changes from default.
Stefan Krah
Check type of slice argument.
Stefan Krah
Merge changes from default.
Stefan Krah
Remove redundant check.
Stefan Krah
Remove unnecessary branches.
Stefan Krah
Update the memoryview documentation.
Stefan Krah
o Rename PyMemoryView_FromBytes() to PyMemoryView_FromMemory(). o Remove full buffer information requirement for PyMemoryView_FromBuffer(). memoryview now reconstructs all missing information.
Stefan Krah
o Clarify view.len. o Warn about possibly diverging itemsize if PyBUF_FORMAT is not requested. o PyBUF_FORMAT|PyBUF_SIMPLE does not make sense: A simple buffer already implies 'B'.
Stefan Krah
o Check format == NULL in cmp_structure() ,unpack_single() and getbuf(). o Disallow NULL format in tolist(). o Allow divergent itemsize for format == NULL: Use product(shape) * itemsize = len invariant instead of calcsize(fmt) = itemsize invariant. o Empty tuple indexing now returns an item instead of a full slice. o Add getoffset(). o Add tobytes(). o Add ndarray_memoryview_from_buffer() for testing PyMemoryView_FromBuffer(). o Align real arrays in init_s…
Stefan Krah
o Rename PyMemoryView_FromBytes() to PyMemoryView_FromMemory(). o Make PyMemoryViewObject a PyVarObject.
Stefan Krah
Use 'const Py_buffer' to provide optimization hints to the compiler.
Stefan Krah
Adapt size for new PyMemoryViewObject.
Stefan Krah
o Empty shape, strides and suboffsets are now represented by an empty tuple. o Issue #12851: PyCData_NewGetBuffer() is not a PEP-3118 compliant buffer provider (does not provide strides when requested).
Stefan Krah
o Indexing a memoryview with format 'B' (unsigned bytes) now returns an integer (in accordance with the struct module syntax). For returning a bytes object the view must be cast to 'c' first. o Distinguish between TypeError for invalid slices and NotImplementedError for multidimensional slices. o Empty suboffsets are now represented as ().
Stefan Krah
o Run most ndarray tests for memoryview as well. o Add many memoryview tests. All sections of memoryobject.c except the PyMemoryView_GetContiguous() section have 100% code coverage. With a special patch all error conditions are tested. o Use table driven design for generating format characters. o Move several memoryview construction tests into self.verify(). o Also test PyBuffer_GetPointer() for memoryview. o Test tobytes() in self.verif…
Stefan Krah
o Restructure file into sections. o Use struct hack in PyMemoryViewObject for the dynamic arrays. o Rework initialization. o Add a couple of invariants: A new memoryview will always have complete shape/stride/format information, unless ndim = 0. shape, stride and suboffsets (if present) are in the struct hack array of the PyMemoryViewObject. o Add buffer flags: A new memoryview will always have flag information whether …
Stefan Krah
Merge changes from default.
Stefan Krah
Fix using unary minus operator on an unsigned value.
Stefan Krah
Add missing test to get 100% code coverage.
Stefan Krah
Add tests for get_pointer() error conditions.
Stefan Krah
Merge changes from default.
Stefan Krah
Test all results against PyBuffer_GetPointer().
Stefan Krah
Adapt tests for new suboffsets conversion.
Stefan Krah
Add get_pointer() module function to test against PyBuffer_GetPointer().
Stefan Krah
Use the HAVE_PTR() and ADJUST_PTR() macros everywhere.
Stefan Krah
copy_buffer(): If any last array dimension has suboffsets, scratch space needs to be allocated.
Stefan Krah
Verify all array attributes against numpy.
Stefan Krah
Restructure format string and item list generating functions. The new functions also generate mode characters.
Stefan Krah
init_slice(): Add comment explaining the slicing scheme for both NumPy and PIL arrays.
Stefan Krah
init_suboffsets(): Add example how a discontiguous NumPy array is converted to a suboffsets representation.
Stefan Krah
init_suboffsets(): The previous scheme of converting NumPy arrays to a suboffset representation did not work for slicing discontiguous arrays with backward strides. This is fixed in this revision.
Stefan Krah
copy_rec(): Handle degenerate case where a buffer has suboffsets in the last dimension. This means that the array is wasting one pointer per item.
Stefan Krah
Fix the struct member count for complicated format strings.
Stefan Krah
Merge changes from default.
Stefan Krah
o Add tests for indexing, slicing and slice assignments. o Test random slicing and slice assignment against NumPy. o Reorganize for clarity. o Streamline format list generating functions. o Split format and index tests into separate functions. o Add tests for invalid indexing. o Add sequence tests. o Add tests for invalid slicing. o Add tests for redundant suboffsets. o Restore warnings filter that is changed during numpy import. o Indexing sca…
Stefan Krah
o Add support for indexing. o Add support for (multi-dimensional) slicing. o Add support for (multi-dimensional) slice assignment. o New method for adding redundant suboffsets.
Stefan Krah
o Add test for memory_clear(). o Add test for PyMemoryView_FromObject() failure.
Stefan Krah
o Document PyMemoryView_FromBytes(). o Document proposed restrictions for PyMemoryView_FromBuffer().
Stefan Krah
o Add PyMemoryView_FromBytes(). o Update comments. o Use the convention that only PyBUF_WRITABLE requests to a read-only exporter fail.
Stefan Krah
Add array verification tests (mostly bounds checks).
Stefan Krah
Mark code block as Python.
Stefan Krah
Various fixes in the verify_bounds() function.
Stefan Krah
Fix typeof expression.
Stefan Krah
o Clarify allowed ranges for shape and strides. o Make it clear that all fields of the returned buffer are strictly defined by the request type.
Stefan Krah
Fix reference leak if PyUnicode_FromString() fails.
Stefan Krah
Move ndarray_getbuf() flags to the top.
Stefan Krah
Remove comment (contents are covered by new documentation).
Stefan Krah
o Handle shape = NULL case in verification function. o New test_ndarray_getbuf() that should now deal with all combinations of base buffers and requests.
Stefan Krah
o Add flags for ND_SCALAR and ND_C to simplify contiguity testing. o Reconstruct strides in ndarray_as_list() if ndim > 1 and strides = NULL. o Mark one-dimensional contiguous buffers as both C and Fortran contiguous. o Allow empty strides list to specify strides = NULL. o Restructure ndarray_getbuf(): - Move writable and format tests up. - Enforce format request for non-uchar buffers. - Specifically check for ndim = 1 and format = "B" in PyBUF_SIM…
Stefan Krah
Add author. Fix incorrect use of xor in comment.
Stefan Krah
Major rewrite of the buffer protocol documentation.
Stefan Krah
Why does PyBuffer_FillInfo allow view == NULL?
Stefan Krah
Merge changes from default.
Stefan Krah
Handle empty string in struct format specifier.
Stefan Krah
Fix alignment issue on SPARC.
Stefan Krah
Fix struct sizes.
Stefan Krah
Allow release() of a memoryview if several views share the same managedbuffer.
Stefan Krah
Move test to test_buffer.py.
Stefan Krah
Add ndarray test object that largely implements PEP-3118. The ndarray is written completely from scratch in order to have a NumPy independent implementation. Functionality: o Full base object capabilities, including responding to flag specific requests. o Full re-exporter capability: The object obtains a buffer from another exporter and poses as a base object. o Optional capability to change layout while buffers are exported. o Full support for arbitrary format strings using the struct module. o Support for Fortran style arra…
Stefan Krah
Defer this issue.
Stefan Krah
Clarify reason for aborting in PyMemoryView_GetContiguous().
Stefan Krah
Increment the reference count of the managed buffer in memory_getbuf().
Stefan Krah
Create separate sections for managedbuffer and memoryview.
Stefan Krah
Revise comment.
Stefan Krah
Adjust refcounting so that it is always safe to pass a PyManagedBuffer to PyMemoryView_FromObject().
Stefan Krah
One reminder is enough.
Stefan Krah
Add comment for Py_MEMORYVIEW_MAXSTATIC.
Stefan Krah
Initial implementation of PyManagedBuffer.
Stefan Krah
Creating branch memoryview.