Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PySide6.QtGraphs.QSurfaceDataProxy.resetArrayNp called with wrong argument types:

PySide6.QtGraphs.QSurfaceDataProxy.resetArrayNp called with wrong argument types:

Scheduled Pinned Locked Moved Solved Qt for Python
7 Posts 3 Posters 407 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    G4IXT
    wrote on last edited by
    #1

    I am attempting to migrate a surface graph in a python App from Pyqtgraph/PyQt5 to pyside6/QtGraphs.

    pyside 6.9.3
    python 3.14

    This simple test code (qsurfacedataproxy and qsurface3dseries imported from pyside6 QtGraphs and defined):

        arry = np.array([[1.0, 2.0, 3.0],[4.0, 5.0, 6.0],[7.0, 8.0, 9.0]])
        self._dataProxy.resetArrayNp(0.0, 1.0, 0.0, 1.0, arry)
    

    I get the errors below. I cannot see what I am doing wrong, is this a bug in the new QtGraphs module?

    FIXME qt_isinstance([[1. 2. 3.]
    [4. 5. 6.]
    [7. 8. 9.]], collections.abc.Sequence[typing.Any]): isinstance() argument 2 cannot be a parameterized generic"

    and

    TypeError: 'PySide6.QtGraphs.QSurfaceDataProxy.resetArrayNp' called with wrong argument types:
    PySide6.QtGraphs.QSurfaceDataProxy.resetArrayNp(float, float, float, float, ndarray)
    Supported signatures:
    PySide6.QtGraphs.QSurfaceDataProxy.resetArrayNp(x: float, deltaX: float, z: float, deltaZ: float, data: collections.abc.Sequence[typing.Any], /)

    I have tried everything I can think of to make it work and simplified my previous code to the test example ablove.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Can you provide a minimal runnable script that shows this issue ?
      Did you also try with a more recent version of PySide6 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        G4IXT
        wrote on last edited by G4IXT
        #3

        No, I haven't tried a more recent version of PySide6 as it's not available in conda-forge that I used for my env.

        Copyright (C) 2023 The Qt Company Ltd.

        SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

        from future import annotations

        import sys
        import numpy as np
        from PySide6.QtCore import QSize
        from PySide6.QtGraphs import QSurface3DSeries
        from PySide6.QtGraphsWidgets import Q3DSurfaceWidgetItem
        from PySide6.QtQuickWidgets import QQuickWidget
        from PySide6.QtWidgets import QApplication
        """Based on the Minimal Qt Graphs Surface Example"""

        if name == 'main':
        app = QApplication(sys.argv)

        window = QQuickWidget()
        surface = Q3DSurfaceWidgetItem()
        surface.setWidget(window)
        axis = surface.axisX()
        axis.setTitle("X")
        axis.setTitleVisible(True)
        axis = surface.axisY()
        axis.setTitle("Y")
        axis.setTitleVisible(True)
        axis = surface.axisZ()
        axis.setTitle("Z")
        axis.setTitleVisible(True)
        
        data = np.array([[0, 1], [0, 2], [1, 3], [1, 4]])
        series = QSurface3DSeries()
        series.dataProxy().resetArrayNp(0.0, 1.0, 0.0, 1.0, data)
        
        surface.addSeries(series)
        
        available_height = app.primaryScreen().availableGeometry().height()
        width = available_height * 4 / 5
        window.resize(QSize(width, width))
        window.show()
        
        exit_code = app.exec()
        surface = None
        del window
        sys.exit(exit_code)
        
        1 Reply Last reply
        0
        • F Offline
          F Offline
          friedemannkleint
          wrote on last edited by
          #4

          The example works fine using a standard PySide6 package (pip install PySide6-Addons). This probably means that Conda builds PySide6 without numpy support.

          G 1 Reply Last reply
          0
          • F friedemannkleint

            The example works fine using a standard PySide6 package (pip install PySide6-Addons). This probably means that Conda builds PySide6 without numpy support.

            G Offline
            G Offline
            G4IXT
            wrote on last edited by
            #5

            @friedemannkleint thank you, I will investigate

            1 Reply Last reply
            0
            • G Offline
              G Offline
              G4IXT
              wrote on last edited by
              #6

              I created another environment using venv instead, and the test code works. I didn't realise that there could be problems like that using conda environments, I thought that I was making a "wholesome" system to work in. Every day is a school day, even at 65 years old. Thanks again for the help.

              SGaistS 1 Reply Last reply
              0
              • G G4IXT has marked this topic as solved on
              • G G4IXT

                I created another environment using venv instead, and the test code works. I didn't realise that there could be problems like that using conda environments, I thought that I was making a "wholesome" system to work in. Every day is a school day, even at 65 years old. Thanks again for the help.

                SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @G4IXT Hi,

                As an alternative you can very well install PySide6 in your conda environment using pip.

                That way you can use conda to manage your environments.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved