Commit Graph

2735 Commits

Author SHA1 Message Date
Torsten Sommer
510626c15f
Add NonUniformImage, example and tests. (#509)
* Add NonUniformImage, example and tests.

* Use updated test-data tag

* Fix line ending, remove lut.setLevels keyword arguments call

Co-authored-by: Ogi <ognyan.moore@gmail.com>
2021-01-19 21:43:58 -08:00
Martin Chase
f2b4a15b2d
Performance enhancement: use CUDA in ImageItem (#1466)
* Add CLI args to video speed test for easier / automated benchmarking

* use a buffer-qimage so we can avoid allocing so much

this should improve performance under windows

* playing with numba

* oh, mins/maxes in the other order

* maybe put the cupy in here and see what happens

* pre-alloc for gpu and cpu

* handle possibility of not having cupy

* no numba in this branch

* organize imports

* name them after their use, not their expected device

* cupy.take does not support clip mode, so do it explicitly

* add CUDA option to the VideoSpeedTest

* rename private attr xp to _xp

* handle resizes at the last moment

* cupy is less accepting of lists as args

* or somehow range isn't allowed? what histogram is this?

* construct the array with python objects

* get the python value right away

* put LUT into cupy if needed

* docstring about cuda toolkit version

* better handling and display of missing cuda lib

* lint

* import need

* handle switching between cupy and numpy in a single ImageItem

* only use xp when necessary

we can now depend on numpy >= 1.17, which means __array_function__-implementing cupy can
seamlessly pass into numpy functions. the remaining uses of xp are for our functions which
need to allocate new data structures, an operation that has to be substrate-specific.

remove empty_cupy; just check if the import succeeded, instead.

* use an option to control use of cupy

* convert cupy.ceil array to int for easier mathing

* RawImageWidget gets to use the getCupy function now, too

* raise error to calm linters; rename for clarity

* Add Generated Template Files

* document things better

* cruft removal

* warnings to communicate when cupy is expected but somehow broken

* playing with settings to suss out timeout

* playing with more stuff to suss out timeout

* replace with empty list

* skip test_ExampleApp on linux+pyside2 only

Co-authored-by: Luke Campagnola <luke.campagnola@gmail.com>
Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2021-01-19 21:26:24 -08:00
Ogi Moore
78bc0fd3ca
Merge pull request #1495 from pijyoi/future_compat
some fixes for PySide6 future compatibility
2021-01-19 21:05:50 -08:00
Ogi Moore
dc17e2ef1c
Merge pull request #1503 from j9ac9k/fix-git-head-reference-in-ci
Fix git head reference in ci
2021-01-19 21:05:14 -08:00
KIU Shueng Chuan
54d25ffbcf README.md : update support matrix 2021-01-20 12:41:29 +08:00
Ogi Moore
0bf6cccd57 Up the faulthandler_timeout parameter to 30 2021-01-19 20:36:54 -08:00
Ogi Moore
ee623c0fa9 Get testdata using checkout action 2021-01-19 20:20:19 -08:00
Ogi Moore
c62838079b
Merge pull request #1500 from pijyoi/bug_aligncenter
bug: AlignCenter should have been AlignHCenter
2021-01-18 20:44:09 -08:00
KIU Shueng Chuan
b6e713c306 bug: AlignCenter should have been AlignHCenter
from the Qt documentation,
- "AlignCenter = AlignVCenter | AlignHCenter"
- "You can use at most one horizontal and one vertical flag at a time.
  Qt::AlignCenter counts as both horizontal and vertical"
- "Conflicting combinations of flags have undefined meanings"

for AxisItem.py, from the code structure, it would appear that the
intent was to use AlignHCenter.

for ROI.py, AlignCenter == AlignCenter | AlignVCenter
2021-01-19 09:45:56 +08:00
KIU Shueng Chuan
9f54baed0c test_reload.py: skip for PySide6 and Python 3.9 2021-01-16 14:37:21 +08:00
KIU Shueng Chuan
d0a7ceea2d relax image tolerance for PySide6 2021-01-16 14:37:21 +08:00
KIU Shueng Chuan
28c0ea4b33 test_ref_cycles.py : change skip criteria
test_ImageView()
- PySide6 fails the same as PySide2

test_PlotWidget() and test_GraphicsWindow()
- PySide6 succeeds.
- PySide2 also succeeds. (at least on Linux and on version 5.15.2)
2021-01-16 14:37:21 +08:00
Ogi Moore
901f772b5f Skip matplotlib qt6 tests 2021-01-16 14:37:21 +08:00
Ogi Moore
21c5627282 Adding PySide6 to CI
Install package for libopengl.so
Mandate the use of ubuntu 20.04
2021-01-16 14:36:38 +08:00
KIU Shueng Chuan
e03d4be767 fix: QComboBox::AdjustToMinimumContentsLength is no longer available
documentation for Qt 4.8 and Qt 5.12 have advised to "Use
AdjustToContents or AdjustToContentsOnFirstShow instead"

documentation in Qt 5.15 no longer shows AdjustToMinimumContentsLength.
2021-01-16 14:33:47 +08:00
KIU Shueng Chuan
f21dfd9d95 fix get_resolution.py to use QScreen
QDesktopWidget is deprecated in Qt5 and removed in Qt6
2021-01-16 14:33:47 +08:00
KIU Shueng Chuan
4b1a8fe6b4 call GraphicsView.enterEvent() with QEnterEvent
Qt5 prototype is QWidget::enterEvent(QEvent*)
Qt6 prototype is QWidget::enterEvent(QEnterEvent*)
where QEnterEvent inherits from QEvent

RemoteGraphicsView.enterEvent() is actually already called with a
QEnterEvent instance, so all we need to do is to be able to reconstruct
it in Renderer.enterEvent()
2021-01-16 00:16:28 +08:00
KIU Shueng Chuan
74683be68b GraphicsScene.py : check for C++ item live-ness
this gets triggered in PySide6 but not in PyQt5, PySide2.
2021-01-15 13:12:36 +08:00
KIU Shueng Chuan
10530568f0 ScatterPlotItem.py: use non _USE_QRECT codepath for PySide6
verified by using ScatterPlotSpeedTest.py that PySide6 benefits from this.
2021-01-15 12:47:13 +08:00
KIU Shueng Chuan
6c9b910c5c RemoteGraphicsView.py : include PySide6 in PySide family
this is only sufficient to make remote rendering work.

various errors still get triggered under PySide6 when we try remote plotting.
2021-01-15 10:25:24 +08:00
KIU Shueng Chuan
4f619bbb4c update glinfo.py to use QOpenGLWidget 2021-01-15 08:25:09 +08:00
KIU Shueng Chuan
9145d7f24d switch to usage of QOpenGLWidget
this drops support for Qt4
2021-01-15 08:25:09 +08:00
KIU Shueng Chuan
dc46812e5a Qt.py : provide QOpenGLWidget (Qt5,6) instead of QGLWidget (Qt4,5) 2021-01-15 08:25:08 +08:00
KIU Shueng Chuan
44da583511 bootstrap.py: use importlib to generically support all bindings 2021-01-15 08:25:08 +08:00
KIU Shueng Chuan
71e1ea34fd MatplotlibWidget.py: drop Qt4 support
PR for adding Qt6 support to matplotlib indicates that both Qt5 and Qt6
will use backend_qt5agg
2021-01-15 08:25:08 +08:00
KIU Shueng Chuan
cc2b811ed1 drop usage of QDesktopWidget
this drops support for Qt4
2021-01-15 08:25:08 +08:00
KIU Shueng Chuan
283e9eb563 drop lack of palette compatibility with Qt4 2021-01-15 08:25:08 +08:00
KIU Shueng Chuan
966ae7a3df import template files using importlib
this lets us support the various bindings w/o having to add binding
specific code.

it breaks PyQt4 support since PyQt4 template files are suffixed as
"_pyqt" rather than "_pyqt4"
2021-01-15 08:25:08 +08:00
KIU Shueng Chuan
5732ca8213 initExample.py: add PySide6 and PyQt6
drop PyQt4 and PySide
2021-01-15 08:25:07 +08:00
KIU Shueng Chuan
359f441973 ExampleApp.py : remove Qt4 paletteChanged signal compatibility 2021-01-15 08:25:07 +08:00
KIU Shueng Chuan
ca9f3f2d92 fix: glViewPort() takes integral arguments 2021-01-15 08:25:07 +08:00
KIU Shueng Chuan
3584736155 generate template files for pyside6 2021-01-15 08:25:07 +08:00
KIU Shueng Chuan
aa1f4e7547 add PySide6 and PyQt6 to rebuildUi.py 2021-01-15 08:25:07 +08:00
KIU Shueng Chuan
1a6918a241 replace QDesktopWidget() with QGuiApplication.primaryScreen()
the "try, except" could be dropped if we drop Qt4 support.

however, primaryScreen() may not be the right screen.
2021-01-15 08:25:07 +08:00
KIU Shueng Chuan
92016d3d5a add imports of _pyside6 files 2021-01-15 08:25:06 +08:00
KIU Shueng Chuan
6e2a28260a add QImage support for PySide6
also update for PySide2.QImage to take in ndarray directly.
2021-01-15 08:25:06 +08:00
KIU Shueng Chuan
6dc6cda0fc add PySide6 to Qt.py 2021-01-15 08:25:06 +08:00
KIU Shueng Chuan
da0a94643c change QPalette.Background to QPalette.Window
the former is obsolete in 5.15 and is removed in 6.0
2021-01-15 08:25:06 +08:00
KIU Shueng Chuan
c4addbeaea workaround missing setStops binding 2021-01-15 08:25:05 +08:00
KIU Shueng Chuan
b0f7dda102 QFont.setWeight(75) is redundant
QFont.setBold(True) calls QFont.setWeight(QFont.Weight.Bold)

in Qt 5, QFont.Weight.Bold == 75
in Qt 6, QFont.Weight.Bold == 700

in PySide6, QFont.setWeight() no longer accepts an integer value.
2021-01-15 08:25:05 +08:00
KIU Shueng Chuan
f863390409 change MidButton to MiddleButton
the former is no longer present in Qt 6 as an alias
2021-01-15 08:25:05 +08:00
KIU Shueng Chuan
119c5fa3d0 convert QTreeWidget.setFirstItemColumnSpanned
convert QTreeWidget.setFirstItemColumnSpanned(item, True) to
item.setFirstColumnSpanned(True)

the former is deprecated since Qt 5.15.2 and removed in Qt 6.
2021-01-15 08:25:05 +08:00
Ogi Moore
4abbc2d5cd
Merge pull request #1498 from jjuod/scrollingplotfix
PlotDataItem now signals on setPos (fix #1494)
2021-01-13 13:16:31 -08:00
jjuod
3cb1128bc2 PlotDataItem now signals on setPos (fix #1494) 2021-01-13 21:57:40 +13:00
Ogi Moore
45e0464163
Merge pull request #1493 from pijyoi/fastinv
invert QTransform using adjoint() and determinant()
2021-01-12 21:05:46 -08:00
KIU Shueng Chuan
3a342b50e2 Revert "Add cache for mapRectFromView"
This reverts commit 55e1f2c520.
2021-01-13 12:43:51 +08:00
Dennis Göries
2affe322ec
PlotItem: Fix enableMenu setting when passing a viewbox (#1496)
* PlotItem: enableMenu setting when passing a viewbox
2021-01-12 20:34:14 -08:00
KIU Shueng Chuan
fd85076bb6 invert QTransform using adjoint() and determinant() 2021-01-10 13:58:31 +08:00
Julius Juodakis
386dcf8180
setSpan broke LinearRegionItem (#1488) (#1491) 2021-01-06 14:54:33 -08:00
Nils Nemitz
85719fd8df
Colormap extension (#1424)
* extend ColorMap functionality for palette management

* manual merge with changes in master branch

* extend ColorMap functionality for palette management

* manual merge with changes in master branch

* light mode / dark mode swapping demo

* color map updates

* added ColorCET and Matplotlib import for color maps

* minor cleanup

* restored lost indent

* Code cleanup

* Add colorcet as optional dependency

Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2021-01-04 22:01:30 -08:00