Skip to content

Commit df18f8c

Browse files
committed
Replace deprecated numpy function
1 parent af0bf52 commit df18f8c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

hsds/attr_sn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ async def PUT_AttributeValue(request):
10881088
msg += f"but got {len(binary_data)}"
10891089
log.warn(msg)
10901090
raise HTTPBadRequest(reason=msg)
1091-
arr = np.fromstring(binary_data, dtype=np_dtype)
1091+
arr = np.frombuffer(binary_data, dtype=np_dtype)
10921092
if attr_shape["class"] == "H5S_SCALAR":
10931093
arr = arr.reshape([])
10941094
else:

hsds/chunk_sn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ async def PUT_Value(request):
853853
log.warn(msg)
854854
raise HTTPBadRequest(reason=msg)
855855

856-
arr = np.fromstring(input_data, dtype=dset_dtype)
856+
arr = np.frombuffer(input_data, dtype=dset_dtype)
857857
log.debug(f"read fixed type array: {arr}")
858858

859859
if bc_shape:
@@ -1351,7 +1351,7 @@ async def POST_Value(request):
13511351
log.warn(msg)
13521352
raise HTTPBadRequest(reason=msg)
13531353
num_points = request.content_length // point_dt.itemsize
1354-
points = np.fromstring(binary_data, dtype=point_dt)
1354+
points = np.frombuffer(binary_data, dtype=point_dt)
13551355
# reshape the data based on the rank (num_points x rank)
13561356
if rank > 1:
13571357
if len(points) % rank != 0:

0 commit comments

Comments
 (0)