Commit Graph

2512 Commits

Author SHA1 Message Date
Martin Chase
5210c55e67
Equilateral Triangle ROI (#1581)
* feature TriangleROI

Added equilateral  TriangleROI.
getArrayRegion is not working yet

* show off (and implicitly test) our new TriangleROI

* the PolyLineROI.getArrayRegion can be used by TriangleROI

refactor the actual logic to live on ROI

* refactors for readability

* variable names
* lint
* docstring type and purpose

Co-authored-by: Fekete Imre <feketeimre87@gmail.com>
2021-02-15 06:06:55 -08:00
Kyle Sunden
a5a41cf8eb
Merge pull request #1577 from j9ac9k/cleanup-1573
Remove duplicate import and remove whitespace
2021-02-14 21:36:31 -06:00
Ogi Moore
825286066a only cast to float32 when safe to do so 2021-02-14 17:43:32 -08:00
Ogi Moore
4ac8e39aea Remove duplicate import and remove whitespace 2021-02-14 12:05:22 -08:00
Ogi Moore
5bfe8d5a46
Merge pull request #1572 from outofculture/arbitrary-scale-center
Arbitrary scale center ROI
2021-02-14 08:49:03 -08:00
Ogi Moore
a04ff546e0
Merge pull request #1573 from j9ac9k/add-deprecation-warnings
Add deprecation warnings, Use non-deprecated upstream methods
2021-02-13 14:59:17 -08:00
Ogi Moore
6c5c0b590f Skip test_reload on python 3.10+ 2021-02-13 10:57:38 -08:00
Ogi Moore
dce2288a18 Fix most errors... 2021-02-13 10:57:38 -08:00
Ogi Moore
3bfe2d81ba Do not use numpy deprecated type aliases 2021-02-13 10:57:38 -08:00
Ogi Moore
955f1c37a6 Use QPointF instead of QPoint for float input 2021-02-13 10:57:38 -08:00
Ogi Moore
f853d8b520 Replace float type to QTimer.start() with int 2021-02-13 09:07:54 -08:00
Ogi Moore
fc550aab86 keep testing deprecated objects, catch warnings 2021-02-12 13:08:00 -08:00
Ogi Moore
36d89fa3a5 Have test_PlotCurveItem use GraphicsLayoutWidget and not the deprecated GraphicsWindow 2021-02-12 13:08:00 -08:00
Ogi Moore
d14a90112c Have test_svg use GraphicsLayoutWidget not the Deprecated GraphicsWindow 2021-02-12 13:08:00 -08:00
Ogi Moore
4fcea2762f Have NonUniformImage test use GraphicsLayoutWidget not deprecated GraphicsWindow 2021-02-12 13:08:00 -08:00
Ogi Moore
45329aac51 Remove unneeded pytest.skipif decorator 2021-02-12 13:08:00 -08:00
Ogi Moore
b45386ebc5 Have __init__.plot() use PlotWidget, not deprecated PlotWindow 2021-02-12 13:08:00 -08:00
Ogi Moore
ff71b6be6b Add actual deprecation warnings 2021-02-11 21:34:02 -08:00
Ogi Moore
bd548e00c9 Restore shimmed Qt4 methods, with deprecation warnings 2021-02-11 20:06:38 -08:00
lidstrom83
d7668f91b3
Fix ScatterPlotItem performance regression (#1569)
* Fix ScatterPlotItem performance regression

* Add hover benchmark to ScatterPlotSpeedTest.py

* Removed a performance regression from GraphicsView

* Removed some tests failing due to the last commit
2021-02-11 08:36:52 -08:00
Ogi Moore
344348441a
Merge pull request #1568 from pijyoi/pyqt_qimage
Change image tests to not rely on non-const QImage
2021-02-10 19:57:22 -08:00
KIU Shueng Chuan
659392d4bb don't rely on QImage being non-const
the previous formulation creates an ndarray and then creates an QImage
over it w/o copying. this relies on the QImage thus created being
non-const.

if the QImage was (unintentionally) created as const, the subsequent
QPainter render on the const QImage would trigger a COW. i.e. the
original underlying ndarray wouldn't be updated.

this is only an issue for PyQt bindings where const QImages can be
created.
2021-02-11 10:38:19 +08:00
KIU Shueng Chuan
6c8e07c377 use 64-bits qimage size for PyQt5 5.15
PyQt5 5.15 has both methods sizeInBytes() (64-bits) and byteCount()
(32-bits)
the previous formulation would use 32-bits qimage size for PyQt5 5.15.
2021-02-11 10:38:19 +08:00
Ogi Moore
87b03b5a2a
Merge pull request #1567 from ksunden/inf_line_0d
Handle case of 0-d array in infinite line setPos
2021-02-10 12:29:28 -08:00
Kyle Sunden
17b1b82ae9 Handle case of 0-d array in infinite line setPos 2021-02-10 13:59:37 -06:00
lidstrom83
389dff4250
Add more options to ScatterPlotSpeedTest (#1566)
* Add more options to ScatterPlotSpeedTest

* Fixed poor choice of variable names

* Add simulated pan/zoom

* Multilingual support
2021-02-10 09:25:31 -08:00
Ogi Moore
28e7d4d12c
Fix Small Heights in ErrorBarItem (#1558)
* Add arrayToQPath bit

* No more moveTo or lineTo

* Use better names than 'partial'

* Implement feedback from reviewer
2021-02-09 20:42:39 -08:00
Nils Nemitz
33365fb730
Reduce reallocation in dynamic range limiter (#1556)
* change imports in cupy module to be local

* reduced re-allocation in dynamic range limiter, part 1

* minor cleanup
2021-02-09 20:36:31 -08:00
lidstrom83
aed2382e38
Correct id-based keying of scatter plot pixmap cache (#1564)
* Correct id-based keying of scatter plot pixmap cache

Note: naively using the id function results in non-unique keys.

Alternatively, we could serialize the Qt objects and use these in the key. This would provide protection from the user mutating these later, but at a cost to performance.

* Make id attribute private

* Access class variable instead of instance
2021-02-09 13:58:15 -08:00
Ogi Moore
44454358f6
Merge pull request #1561 from pijyoi/no_deletelater
remove app.deleteLater() from tests
2021-02-09 08:27:00 -08:00
Ogi Moore
ca1ce7aa90
Merge pull request #1563 from RubendeBruin/fix_flowchart_docs
Flowchart documentation fix
2021-02-09 08:21:22 -08:00
Ruben de Bruin
77db5a868b
Flowchart documentation fix
the widget() method should be used to display the flowchart in a window rather than the ctrlWidget().
2021-02-09 15:20:14 +01:00
KIU Shueng Chuan
c9dcc0c0ed remove app.deleteLater() from tests
Multiple tests are executed by pytest with the same Python process.
The QApplication instance is a global object that will be used by
subsequent tests.

The Qt documentation says that the object will only be deleted while
running in an event loop. In addition, the Qt docs also specifically
say that processEvents() does not process DeferredDelete events.

i.e. calling processEvents() in a loop is not equivalent to calling
QApplication.instance().exec_()
2021-02-09 16:37:19 +08:00
Ogi Moore
ade6a844e7
Merge pull request #1559 from pijyoi/pyqt6_evbug
restrict PyQt6 QEvent.type() monkey patching to 6.0.0
2021-02-08 22:44:50 -08:00
Ogi Moore
2e1514d711
Cache scatter-plot items by hashable properties (#1560)
* Cache scatter-plot items by hashable properties

* use qpainterpath boundingRect+elementCount for key
2021-02-08 10:59:51 -08:00
KIU Shueng Chuan
665988dc4f remove spinbox return key workaround
the code being removed was committed in 2012.
the reason for the workaround no longer exists.

the reason this code is under scrutiny is because while porting to
PyQt6, calling ev.type() triggered a bug in PyQt6 6.0
2021-02-08 22:10:33 +08:00
KIU Shueng Chuan
d5e516ad52 restrict PyQt6 QEvent.type() monkey patching to 6.0.0
The bug that this workaround was for has been fixed in PyQt6 6.0.1.

However our feature test for the bug was faulty and triggers positive
for PyQt6 6.0.1. In other words, we would be needlessly monkey patching
where it wasn't needed.
2021-02-08 08:22:19 +08:00
Ogi Moore
6d3de52773
Merge pull request #1555 from pijyoi/pyqt6_remote_mouse
PyQt6 6.0.1 QEvent.Type needs to be explicitly deserialized
2021-02-06 21:43:06 -08:00
Ogi Moore
d1bcbf8ec0
Merge pull request #1554 from ixjlyons/glscatterplotitem-nodata
Disable paint in GLScatterPlotItem if it has no data
2021-02-06 16:30:24 -08:00
KIU Shueng Chuan
030c49e659 PyQt6 6.0.1 QEvent.Type needs to be explicitly deserialized
in PyQt6 6.0.0, QEvent.Type was automatically pickled / unpickled.

in PyQt6 6.0.1, QEvent.Type is now pickled to be an int, so needs to be
recreated back explicitly (like the other bindings)

this change is backwards compatible with PyQt6 6.0.0
2021-02-07 07:47:50 +08:00
Ogi Moore
4274e33486
Merge pull request #1553 from pijyoi/pyqt6_qimage_api_change 2021-02-06 15:36:04 -08:00
Kenneth Lyons
a1064345d3 Disable paint in GLScatterPlotItem if it has no data 2021-02-06 15:31:54 -08:00
KIU Shueng Chuan
54d7c591b5 PyQt6 6.0.1 changes QImage constructor api 2021-02-07 07:14:24 +08:00
Ogi Moore
feaa8fe5fb
Merge pull request #1547 from pijyoi/cleanup_ci
remove ProgressDialog from CI test
2021-02-06 12:05:03 -08:00
Nils Nemitz
194941dfb2
change imports in cupy module to be local (#1548) 2021-02-06 09:21:24 -08:00
Kenneth Lyons
f1cfdc302d
Merge pull request #1549 from ixjlyons/pr1437-rmprint
Remove leftover print calls from PR 1437
2021-02-06 08:07:53 -08:00
Kenneth Lyons
8332f2cda0 Remove leftover print calls from PR 1437 2021-02-06 08:04:11 -08:00
KIU Shueng Chuan
310afebe56 fix svg.setResolution(int) deprecation warning
triggered only for PyQt binding, Python 3.8, 3.9

there is a mismatch in API:
- QScreen.logicalDotsPerInchX() -> float
- QSvgGenerator.setResolution(int)
2021-02-06 17:43:12 +08:00
KIU Shueng Chuan
321b5e627a remove ProgressDialog from CI testing 2021-02-06 17:08:32 +08:00
KIU Shueng Chuan
c85c62deda getargspec -> getfullargspec
former is deprecated since Python 3.0
2021-02-06 17:08:32 +08:00