Add QtGraphs-based analysis page to AdvancedPy example#39
Add QtGraphs-based analysis page to AdvancedPy example#39AndrewSazonov wants to merge 8 commits intodevelopfrom
Conversation
rozyczko
left a comment
There was a problem hiding this comment.
A few minor issues found. Please consider before merging.
|
|
||
| QtObject { | ||
|
|
||
| property int dataSize: 50 |
There was a problem hiding this comment.
the default dataSize in corresponding analysis.py is set to 10000. Why the difference?
| //visible: true | ||
| //gridVisible: false | ||
| //subGridVisible: true | ||
| //labelsVisible: true | ||
| //subTickCount: 1 |
There was a problem hiding this comment.
Lots of commented-out code in this file. Please either comment on why it needs to stay or remove.
| labelDelegate: TextEdit { | ||
| horizontalAlignment: TextInput.AlignHCenter |
There was a problem hiding this comment.
Is this supposed to be TextEdit? Are you expected to be able to edit axis labels?
I think you meant labelDelegate: Text
| mvx = memoryview(x) | ||
| mvy = memoryview(y) | ||
| return [QPointF(xi, yi) for xi, yi in zip(mvx, mvy)] |
There was a problem hiding this comment.
memoryview avoids copying indeed, but when you later iterate over it with zip, each element is still converted from the memoryview into a Python float object before being passed to QPointF.
You're still doing float conversion...
>>> a = np.array([1.0, 2.0])
>>> for x in memoryview(a):
... print(type(x))
<class 'float'>
<class 'float'>| x, y = self._generate_data(n_points=self.dataSize) | ||
| console.debug(" Data generation completed.") |
There was a problem hiding this comment.
No exception handling on results from _generate_data, which might throw.
This PR adds a new Analysis page to the AdvancedPy example and connects it to both mock QML and real Python backends.
Analysis page includes: