Support FIXEDSTR16 in NumPy imports - #1018
Open
Mango-Clark wants to merge 12 commits into
Open
Conversation
Refs daphne-project#986 - Fix NumPy shared-memory pointer extraction by moving extracting the raw data address after the dtype normalization and C-contiguity handling. NumPy dtype conversion and contiguous-layout conversion may allocate a new array, so the pointer must be taken only after the final array object is fixed. - Support FIXEDSTR16 imports for string-like NumPy arrays. - Values longer than 15 bytes are rejected - Byte-string dtype ('S') arrays are supported. Arrays with dtype width up to 15 bytes can be converted directly to S16. Wider byte-string arrays are scanned by actual value length before being narrowed to S16. - Unicode dtype ('U') arrays are encoded as UTF-8 before checking their byte length, since NumPy's Unicode itemsize is based on UTF-32 storage width and does not represent the UTF-8 payload size. - Object dtype ('O') arrays are supported only for explicit string-like, bytes-like, and common missing values: - None as b'None' - np.nan as b'np.nan' - pd.NA as b'pd.NA' - pd.NaT as b'pd.NaT' - str - np.str_ - bytes - np.bytes_ - bytearray - memoryview - Arbitrary mixed object values are rejected to avoid silent coercion.
Register FixedStr16 print support and assert received payloads.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refs #986
Supersedes #1008, which was closed to rename the source branch from
new-devto986-python-string-memshare.This PR restores the changes from #1008 without changing the original scope.