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

Update after NumPy 2.0+ removal of ndarray.newbyteorder #55

Merged
merged 1 commit into from
Nov 18, 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
4 changes: 2 additions & 2 deletions pyspod/utils/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _blockdist(N, size, rank):
def allreduce(data, comm):
if comm is not None:
MPI = _get_module_MPI(comm)
data = data.newbyteorder('=')
data = data.view(data.dtype.newbyteorder('='))
data_reduced = np.zeros_like(data)
comm.Barrier()
comm.Allreduce(data, data_reduced, op=MPI.SUM)
Expand All @@ -187,7 +187,7 @@ def npy_save(comm, filename, array, axis=0):
if comm is not None:
MPI = _get_module_MPI(comm)
dtlib = _get_module_dtlib(comm)
array = array.newbyteorder('=')
array = array.view(array.dtype.newbyteorder('='))
array = np.asarray(array)
dtype = array.dtype
shape = array.shape
Expand Down
Loading