Skip to content

Regression

OmeroPy.test.integration.gatewaytest.test_chgrp.testPDIChgrp (from pytest)

Failing for the past 1 build (Since #412 )
Took 0.83 sec.

Error Message

AttributeError: 'numpy.ndarray' object has no attribute 'tostring'

Stacktrace

gatewaywrapper = <omero.gateway.pytest_fixtures.GatewayWrapper object at 0x7fe00f195ed0>

    def testPDIChgrp(gatewaywrapper):
        """
        Create a new group with the User as member. Test move the
        Project/Dataset/Image to new group.
        """
        gatewaywrapper.loginAsAuthor()
        link = gatewaywrapper.createPDTree(project="testPDIChgrp",
                                           dataset="testPDIChgrp")
        dataset = link.getChild()   # DatasetWrapper
        # omero.model.ProjectI - link.getParent() overwritten - returns None
        project = link.parent
>       image = gatewaywrapper.createTestImage(dataset=dataset)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

test/integration/gatewaytest/test_chgrp.py:139: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../../.venv3/lib64/python3.11/site-packages/omero/gateway/scripts/testdb_create.py:273: in createTestImage
    image = self.gateway.createImageFromNumpySeq(
../../../../.venv3/lib64/python3.11/site-packages/omero/gateway/__init__.py:3876: in createImageFromNumpySeq
    raise exc
../../../../.venv3/lib64/python3.11/site-packages/omero/gateway/__init__.py:3852: in createImageFromNumpySeq
    uploadPlane(plane, theZ, theC, theT, dtype)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

plane = array([[ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
       [ 1,  1,  1,  1,  1,  1,  1,  1,  1,  ..., 14, 14, 14, 14, 14, 14],
       [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15]],
      dtype=int16)
z = 0, c = 0, t = 0, convertToType = None

    def uploadPlane(plane, z, c, t, convertToType):
        # if we're given a numpy dtype, need to convert plane to that dtype
        if convertToType is not None:
            p = numpy.zeros(plane.shape, dtype=convertToType)
            p += plane
            plane = p
        byteSwappedPlane = plane.byteswap()
>       convertedPlane = byteSwappedPlane.tostring()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
E       AttributeError: 'numpy.ndarray' object has no attribute 'tostring'

../../../../.venv3/lib64/python3.11/site-packages/omero/gateway/__init__.py:3833: AttributeError