Skip to content
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

chore: use _util.native_to_byteorder function in ak.from_buffers #3354

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/awkward/operations/ak_from_buffers.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,7 @@ def _from_buffer(
return array[:count]
else:
array = nplike.frombuffer(buffer, dtype=dtype, count=count)
if byteorder != ak._util.native_byteorder:
return array.byteswap(inplace=False)
else:
return array
return ak._util.native_to_byteorder(array, byteorder)


def _reconstitute(
Expand Down
Loading