Skip to content

Commit 8cd1327

Browse files
committed
Replace to/fromstring by to/frombytes
1 parent 27b69ac commit 8cd1327

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

components/tools/OmeroPy/test/integration/tablestest/test_backwards_compatibility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def checkMaskCol(self, test):
8181
def arr(x):
8282
import numpy
8383
import tables
84-
return numpy.fromstring(x, count=len(x), dtype=tables.UInt8Atom())
84+
return numpy.frombytes(x, count=len(x), dtype=tables.UInt8Atom())
8585

8686
assert 1 == test.imageId[0]
8787
assert 3 == test.theZ[0]

components/tools/OmeroPy/test/integration/tablestest/test_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def checkMaskCol(self, test):
5151
def arr(x):
5252
import numpy
5353
import tables
54-
return numpy.fromstring(x, count=len(x), dtype=tables.UInt8Atom())
54+
return numpy.frombytes(x, count=len(x), dtype=tables.UInt8Atom())
5555

5656
assert 1 == test.imageId[0]
5757
assert 3 == test.theZ[0]

components/tools/OmeroPy/test/integration/tablestest/test_tables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def checkMaskCol(self, test):
5252
def arr(x):
5353
import numpy
5454
import tables
55-
return numpy.fromstring(x, count=len(x), dtype=tables.UInt8Atom())
55+
return numpy.frombytes(x, count=len(x), dtype=tables.UInt8Atom())
5656

5757
assert 1 == test.imageId[0]
5858
assert 3 == test.theZ[0]

examples/Training/python/ROIs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def create_mask(mask_bytes, bytes_per_pixel=1):
147147
# Set correct number of bytes per value
148148
mask_array = mask_array.astype(numpy.uint8)
149149
# Convert the mask to bytes
150-
mask_array = mask_array.tostring()
150+
mask_array = mask_array.tobytes()
151151
# Pack the bytes to a bit mask
152152
mask_packed = create_mask(mask_array, 1)
153153

0 commit comments

Comments
 (0)