Commit Graph

1889 Commits

Author SHA1 Message Date
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
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
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
Kyle Sunden
17b1b82ae9 Handle case of 0-d array in infinite line setPos 2021-02-10 13:59:37 -06: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
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
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
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
c85c62deda getargspec -> getfullargspec
former is deprecated since Python 3.0
2021-02-06 17:08:32 +08:00
Drew
e7ceebd867
LegendItem: fix docs & minor bugs (#1437)
* LegendItem: fix spelling mistake

* LegendItem: remove unused curRow variable

* LegendItem: correct calculation of rowCount

Previously, rowCount would never be updated unless setColumnCount()
was called. This fixes that issue.
It also fixes that setColumnCount() rounded down (floored) the
number of rows, instead of providing an accurate number:
e.g. 4 items in 3 columns would yield rowCount=1, when it should be 2

* LegendItem: remove rowCount argument (not implemented)

Logic to actually use the rowCount argument was not implemented.
Users might expect rowCount to limit the number of rows to e.g. 1,
but that is not what the current code does (it only works with limiting
the number of columns).
Thus, we were exposing an unused/misleading parameter to users.

This can and should be reverted if the logic for limiting the number
of rows is added.

* LegendItem: add colCount docs

* test (LegendItem): remove unused curRow variable

* test (LegendItem): check increasing rowCount as add items

* Fixed logic in placement of items in legend with multiple columns

* Actual row count here should be 2, not 3

Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2021-02-05 23:00:34 -08:00
Dennis Göries
bac2ff5b4b
GraphIcons: Extend and deprecate previous pixmaps (#1534)
* GraphPixmaps: deprecate pixmaps

* Deprecation print

* More doc strings and deprecation warning
2021-02-05 21:09:59 -08:00
Ogi Moore
c2daa00714
Merge pull request #1546 from ixjlyons/imageview-init-keyevents
Guard against key events when there's no time axis in ImageView
2021-02-05 20:57:45 -08:00
Kenneth Lyons
f1999d9a2c Guard against key events when there's no time axis in ImageView 2021-02-05 20:23:15 -08:00
pijyoi
cd914495ec
get test_ref_cycles to pass (#1539)
* get test_ref_cycles to pass

let objects die without gc.collect()
if you don't have cyclic references, there should be no need to call
gc.collect()

the usage of gc.collect() was causing pytest running with coverage to
crash on Python 3.7 / PySide2 5.12 / {Linux, Windows}.

* remove imports used only by the removed code
2021-02-04 20:18:53 -08:00
Ogi Moore
f336ac2d91
Merge pull request #1541 from pijyoi/remove_qt4_qtest_shim
use qWaitForWindowExposed instead of qWaitForWindowShown
2021-02-04 16:15:39 -08:00
KIU Shueng Chuan
62ded33222 remove qtest shim for Qt5 too
not considered public API of pyqtgraph
2021-02-05 07:30:33 +08:00
Christoph Buchner
6974b25a5f
Fix typo 2021-02-04 08:07:01 +01:00
KIU Shueng Chuan
711dcd4d5a use qWaitForWindowExposed instead of qWaitForWindowShown
qWaitForWindowShown has been obsolete since Qt 5.6
2021-02-04 11:35:19 +08:00
Kenneth Lyons
15bdd89293 Add a few minor notes to docs on suffix/siPrefix 2021-02-03 17:27:41 -08:00
Kenneth Lyons
0e90e70e2a Update SpinBox tests for siPrefix without suffix 2021-02-03 17:18:13 -08:00
Kenneth Lyons
cd10719837 Support siPrefix with no suffix in SpinBox 2021-02-03 17:14:06 -08:00
Kenneth Lyons
66c77118dc
Support suffix for int parameters (#1528)
* Support suffix for int parameters

* Fix spinbox test for new int formatting

* Tune up SpinBox tests a bit
2021-02-03 12:30:05 -08:00
Ogi Moore
7abf7d36d0
Merge pull request #1462 from Ryytikki/patch-1
Added option to use "None" for adj in setData
2021-01-31 23:03:44 -08:00
Ogi Moore
89d20119fe Update docstring and error message 2021-01-31 22:36:59 -08:00
Ogi Moore
983a3769e7 Check for None first 2021-01-31 22:32:56 -08:00
Ogi Moore
f5a823bf38
Merge pull request #1533 from pijyoi/kill_qt4_shim
Remove scale rotate translate Qt4 shims
2021-01-31 22:12:11 -08:00
Ogi Moore
e02fc10a40 handle text flags like axisitem 2021-01-31 21:52:51 -08:00
Ogi Moore
d70a009c29 Address more PyQt6 enum type shenanigans 2021-01-31 21:17:44 -08:00
Ogi Moore
0495f1dcce Replace deprecated method with suggested one 2021-01-31 20:39:07 -08:00
KIU Shueng Chuan
ac4eaa6860 remove redundant shims 2021-02-01 09:12:42 +08:00
KIU Shueng Chuan
185f9c7dad remove scale, rotate and translate shims 2021-02-01 09:06:23 +08:00
Ogi Moore
7b3fdda1e4 Merge branch 'master' into ptree 2021-01-31 13:36:53 -08:00
KIU Shueng Chuan
7192df7032 remove setMargin and setResizeMode shims 2021-01-31 22:21:32 +08:00
KIU Shueng Chuan
97f5459573 regenerate plotConfigTemplate.ui for Qt5
the old ones were using obsoleted method "setMargin"
2021-01-31 22:12:55 +08:00
KIU Shueng Chuan
327581983f delete some more Qt4 generated templates 2021-01-31 22:11:49 +08:00
pijyoi
9d89d10bcf
some optimizations for rescaleData (#1518)
1) use float32 instead of float64 for low precision inputs
2) use in-place operations to avoid unnecessary copies
2021-01-30 14:38:34 -08:00
Ogi Moore
56ee690d58
Merge pull request #1527 from ixjlyons/improve-parameter-docs
Improve parametertree documentation coverage
2021-01-30 11:01:08 -08:00
Kenneth Lyons
c24d25bce3 Improve parametertree documentation
- Increase cross-referencing
- Give all built-in parameter and parameter items at least minimal
  docstring
- Start improving coverage of the special options available for some
  parameters
- Organize the built in parameters reference for easier navigation
2021-01-30 10:06:49 -08:00
pijyoi
ce8c3262f8
switch to use of QOpenGLWidget in GraphicsView.py (#1525)
* switch to use of QOpenGLWidget in GraphicsView.py

experimental plotting in PlotCurveItem gets broken by this. so we allow
Qt5 users to opt back to using QGLWidget with the enableExperimental
option.

* allow Qt6 users to turn on enableExperimental

to more easily allow users to see the broken-ness.

* drop QGLWidget, use only QOpenGLWidget
2021-01-30 08:59:29 -08:00
KIU Shueng Chuan
6b7afbf75c remove six module 2021-01-29 16:13:27 +08:00
Ogi Moore
961cdac51c
Infiniteline emits clicked signal event (#1522) 2021-01-28 22:02:51 -08:00
Dennis Göries
5bb3800adc
ItemSample: Allow toggle of visibility via mouse click in LegendItem (#1497)
* Legend toggle directly on ItemSample

* Add invisible Eye icon

* Include package data and remove username from svg

* Allow svg and png in the setup.py and cleanup sg
2021-01-28 21:14:41 -08:00
Sérgio Peixoto
3f02b30140
Bugfix/wrong translate implementation (#1520)
* Removes all translate call on the parameter name and moves them into the title instead allowing to decouple visualization from code logic

* Removes all translate calls from the Exporter class property Name and moves the translation logic when setting the QListWidgetItems for the formatList

* Adds missing call to translation function for the export action on GraphicsScene
2021-01-28 08:42:18 -08:00
KIU Shueng Chuan
2f4ceee1ce fix RemoteSpeedTest shutdown errors
fix BufferError: cannot close exported pointers exist
for some reason, even though the ctypes object falls out of function
scope, it causes a lingering reference.
in any case, the use of ctypes is no longer necessary.

Don't change temporary files mid-way for Darwin
This fixes the CI issues on Darwin.

close the remote process on app shutdown.
2021-01-28 07:19:54 +08:00
Ogi Moore
b54aa3914d
Attempt i18n localization (#1513)
* Trying translate on exporter strings

* Try translate on other misc context menu strings

* First f-string and I screw it up...

* add more translation calls
2021-01-27 11:34:32 -08:00
Ogi Moore
309195ceea
Fix windows hidpi (#1516)
* set environment variables before starting QApp

* fix-422

* Better support of hidpi

* Fix Typo in App-Name

* Remove fontScaleFactor bits

* Add documenation for hidpi displays

* Fix pg not defined
2021-01-27 10:59:07 -08:00
Ogi Moore
85773e4530
Revert "have mkQApp configure QApplication such that it handles HIDPI displays on Windows (#1509)" (#1515)
This reverts commit 98f6b2f1a5.
2021-01-27 10:42:38 -08:00
Martin
219f79947e maintain non-scaling behavior for parallel sides
make sure aspectLocked still gets checked
add example
2021-01-27 10:39:08 -08:00
Ogi Moore
98f6b2f1a5
have mkQApp configure QApplication such that it handles HIDPI displays on Windows (#1509)
* set environment variables before starting QApp

* fix-422

* Better support of hidpi

* Fix Typo in App-Name

* Remove fontScaleFactor bits

* Add documenation for hidpi displays
2021-01-27 10:05:56 -08:00
Valentin Valls
9456d07ae8 Fix scale-rotate ROI handler to allow to use a random scale axis and not only x/y
The code relative to scaleSnap is maybe broken
2021-01-27 09:52:50 -08:00
KIU Shueng Chuan
d96ec314be RemoteGraphicsView.py : fix mouse interactions for Qt 5.12
mouse interactions had previously only been tested on Qt 5.15 and
Qt 6.0, and found to be not working on Qt 5.12.
differences in Qt 5.12 and Qt 5.15 are documented in the comments.

an addition bug found (and fixed) was that right-click was drawing
the pop-up menu away from the mouse position.
2021-01-23 19:28:11 +08:00
KIU Shueng Chuan
5186cbd80b remove Qt4 generated template files 2021-01-23 12:12:20 +08:00
KIU Shueng Chuan
6c760f3de1 add PyQt6 to CI
skip tests that don't work for Qt6

add Qt6 and remove Qt4 from test_examples.py

update README.md

switch mouse tests to use QPointF

this eliminates all the special casing for different bindings
2021-01-23 08:31:00 +08:00
KIU Shueng Chuan
eec411a3c6 fixup Flowchart for PyQt6 2021-01-23 08:31:00 +08:00
KIU Shueng Chuan
d0c062d7e5 Revert "workaround missing setStops binding"
This reverts commit c4addbeaea.
2021-01-23 08:30:59 +08:00
KIU Shueng Chuan
2e688cf672 PySide6 : shim missing binding QGradient.setStops 2021-01-23 08:30:59 +08:00
KIU Shueng Chuan
3a9e81cc49 update RemoteGraphicsView.py for Qt6 2021-01-23 08:30:59 +08:00
KIU Shueng Chuan
c0336acc11 bug: style() should have been styleHint()
Style is enum for { StyleNormal, StyleItalic, StyleOblique }
2021-01-23 08:29:52 +08:00
KIU Shueng Chuan
6dbda78231 Container.py : fix RecursionError 2021-01-23 08:29:52 +08:00
KIU Shueng Chuan
8a091859f1 GradientWidget.py : workaround or-ing of enum flag values 2021-01-23 08:29:52 +08:00
KIU Shueng Chuan
0957735255 AxisItem.py : workaround or-ing of text flags 2021-01-23 08:29:52 +08:00
KIU Shueng Chuan
04e0a5e5af WidgetGroup.py : PyQt6 was taking PyQt4 codepath
we drop PyQt4 codepath
2021-01-23 08:29:51 +08:00
KIU Shueng Chuan
edea696bc3 ROI.py : pyqt6 has no KeyboardModifier class
the correct type to use is actually KeyboardModifiers
2021-01-23 08:29:51 +08:00
KIU Shueng Chuan
13d652c794 convert to QPointF mouse event position
DockDrop.py : use QPointF mouse coords
2021-01-23 08:29:45 +08:00
KIU Shueng Chuan
607db15949 call super() on virtual QWidget methods 2021-01-23 08:29:44 +08:00
KIU Shueng Chuan
0fa4557ad6 don't cast buttons, enums and flags to int 2021-01-23 08:29:44 +08:00
KIU Shueng Chuan
3ce7f58384 import sip from Qt.py 2021-01-23 08:29:43 +08:00
KIU Shueng Chuan
dcbddb0abf add PyQt6 support to Qt.py and functions.py 2021-01-23 08:29:43 +08:00
KIU Shueng Chuan
ab41c03358 generate _pyqt6.py files
VideoTemplate_pyside6.py : regenerate for cuda feature
2021-01-23 08:29:39 +08:00
Ogi Moore
4e070f40bc Fixed typo 2021-01-21 08:48:54 -08:00
Ogi Moore
b3a0051a99 Use os.getenv, not os.environ 2021-01-19 23:23:24 -08:00
Martin Chase
1654cb62ac
Small ImageItem-related improvements (#1501)
* Initial asv configuration

* makeARGB benchmarks are working

* Fix array type checking and allow making QImage in greyscale mode

* Performance improvements

* benchmark minor update

* Add CLI args to video speed test for easier / automated benchmarking

* udpate asv conf

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

this should improve performance under windows

* 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

* Merge branch 'cupy-rebase' into 'l/imageitem-performance'

Abundant conflicts; accept theirs in nearly every case.

* 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

* clean out some bits that no longer make sense; linty

* ignore airspeed velocity dir

* lint

* tidy up for merge

* lint

* lint, avoid shadowing

* specific import; run-as-script setup

Co-authored-by: Luke Campagnola <luke.campagnola@gmail.com>
Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2021-01-19 23:19:03 -08:00
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
ee623c0fa9 Get testdata using checkout action 2021-01-19 20:20:19 -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
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
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
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
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
Dennis Göries
b622e22877
LegendItem: Make ItemSample customizable (#1404)
* LegendItem: Introduce itemStyles and provide ToggleItem

Show example

* Minor cleanup of the legend item and test

* Make ItemSample customizable

* Remove example modifications

* Changes for sampleType according to review
2021-01-04 21:02:08 -08:00
Hanwant
e209be20e5
Use log modulus transform for y axis log scaling (#1476)
* Use log modulus transform for y axis log scaling

* Update log modulus to use eps and retain behaviour around -1 < x < 1

* Update setLogMode Dosctring

* Update setLogMode docString

Co-authored-by: Hanwant <admin@madigan.tech>
2021-01-04 19:27:03 -08:00
Martin Chase
1a71bb53c4
add unicode units (#1471)
* adds unicode units

* keep "u" and "Ohm" for compatibility
* add c, d, da and h
* lint

* py2 compatible u"" strings
2021-01-03 14:28:56 -08:00
Lee Tirrell
64e04e3120
Fix #798 (#1487) 2021-01-03 14:28:40 -08:00
Yoonyoung (Jamie) Cho
d8e4911fcd
Fixed GLViewWidget Gimbal Lock with Quaternion Parametrization (#909)
* Fixed GLViewWidget Gimbal Lock with Quaternion Parametrization

* fixed rotation name

* fixes extraneous pos argument and restore compatibility

* remove redundant getAxisAngle() in rotation (for Qt4 compatibility)

* GLViewWidget takes rotationMethod parameter

* Avoid merge conflict

* Fix docstring

Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2020-12-24 21:45:02 -08:00
Daniel Lidstrom
daafb1d801 Revert previous commit 2020-12-23 00:05:36 -08:00
Ogi Moore
cc6a4d200c Add analyze segment - thanks to @ksunden 2020-12-22 21:18:13 -08:00
Ogi Moore
b98216a2ea Use matplotlib qt5agg backend for pyside2 2020-12-22 10:27:15 -08:00
Ogi Moore
2689cdb5f6 Fix regex warning 2020-12-22 10:26:19 -08:00
Ogi Moore
3cd9f9ff63 skip test_reload 2020-12-22 10:26:19 -08:00
Kyle Sunden
3b1e55af1e
MAINT: Post 0.11.1 release, drop py2, qt4 (#1473)
* MAINT: Post 0.11.1 release, drop py2, qt4

This focuses on distribution, tests, and docs. This may not be comprehensive, but covers the cases I found by looking and a few greps

Noteably, this does not change any actual internal code yet, to avoid merge conflicts with pending PRs.

* NEP 29 language/versions
2020-12-22 10:25:06 -08:00
Daniel Lidstrom
c2f0de0471 Attempt at passing Qt 4 CI pipelines 2020-12-21 23:15:57 -08:00
Daniel Lidstrom
6a8f7779dc Add tool tip support to action and group parameters 2020-12-21 23:09:19 -08:00
Daniel Lidstrom
2260030845 Focus change bug fix 2020-12-21 22:34:12 -08:00
Daniel Lidstrom
acca19a1b3 Clearing selection on wheelEvent is buggy, so don't 2020-12-21 22:22:12 -08:00
Daniel Lidstrom
b164e54e15 Get parameter's item in a nicer way 2020-12-21 20:48:15 -08:00
Daniel Lidstrom
4618c705e2 Fixed bug where enabled opt is not respected 2020-12-21 20:40:34 -08:00
Daniel Lidstrom
4e8a609375 Fixed bugs with setting expanded and setExpanded 2020-12-21 17:34:43 -08:00
Daniel Lidstrom
fab7b20094 ColorButton sizeHint override unnecessary 2020-12-21 17:18:34 -08:00
Daniel Lidstrom
944b75ffcd Don't miss any widgets when updating readonly 2020-12-21 17:11:22 -08:00
Daniel Lidstrom
4561b18377 Consistently emit values with Parameter.sigValueChanging 2020-12-21 12:30:08 -08:00
Daniel Lidstrom
d737d80c52 Improved data race test 2020-12-20 23:08:38 -08:00
Daniel Lidstrom
bea0fc1135 No interaction with WidgetParameterItem.subItem 2020-12-20 22:41:47 -08:00
Daniel Lidstrom
8519efdd8d Changed my mind 2020-12-20 19:12:11 -08:00
Daniel Lidstrom
0703e3db9b Ensure synchronization of parameter and widget's values 2020-12-20 18:43:11 -08:00
Ogi Moore
195f609b31 Update __version__ 2020-12-19 09:17:23 -08:00
miranis
c5c41b9090
zero-step in np.arange (#1468) 2020-12-17 22:48:55 -08:00
Daniel Lidstrom
6313bb8ae3 Avoid deprecation warnings 2020-12-17 19:00:22 -08:00
Daniel Lidstrom
5a48b68795 Bugfix 2020-12-17 18:17:06 -08:00
Daniel Lidstrom
d9c6a2764a Removed pointless subclass method 2020-12-17 18:09:51 -08:00
Daniel Lidstrom
ba304faa05 Provide size hints for nicer looking trees that don't need to be manually sized 2020-12-17 17:45:04 -08:00
Daniel Lidstrom
db43c9447c Allow default button for text and colormap parameters 2020-12-17 09:53:39 -08:00
Daniel Lidstrom
edf42114f8 Show colormap as sub item 2020-12-17 01:08:46 -08:00
Daniel Lidstrom
02079aec8a Handle text with WidgetParameterItem and SimpleParameter 2020-12-17 01:07:49 -08:00
lidstrom83
3af23725ca
Scatter Plot Improvements (#1420)
* Added hovering demo to ScatterPlot example

* Use Qt's serialization for SymbolAtlas.symbolMap keys

Yields significant performance improvements when updating the scatter plot's options. See e.g. the plot hover example.

* Further optimized scatter plot picking

* Fix ScatterPlot example tool tip

* Clean up while I'm here

* Compatibility

* Some simple optimizations for ScatterPlotItem

Speedups for ScatterPlotSpeedTest.py:
~50% without pxMode
~ 0% pxMode with useCache
~30% pxMode without useCache

* ~3x speedup in scatter plot speed test with pxMode

* More optimization low-hanging fruit for the scatter plot

* Removed hover example to lazily pass tests

* Avoid segfault

* Re-add hover example to ScatterPlot.py

* Switch to id-based keying for scatter plot symbol atlas

- Use cases exist where serialization-based keying is a significant bottleneck, e.g. updating without atlas invalidation when a large variety pens or brushes are present.
- To avoid a performance hit, the onus is on the user to carefully reuse pen and brush objects.

* Optimized caching in scatter plot hovering example

* Fixed and optimized scatter plot hovering example

* Minor scatter plot optimization

* Cleanup

* Store hovered points in a set for the hovering example

* Keep a limited number symbol atlas entries around for future reuse

* Added a docstring note to remind the user to reuse QPen and QBrush objects for better performance

* Tidied up hovering example

* Typo

* Avoid unnecessary atlas rebuilds

* Refactored SymbolAtlas

* Efficient appending to SymbolAtlas

* SymbolAtlas rewrite

* Cleanup and profiling

* Add randomized brushes to speed test

* Add loc indexer to ScatterPlotItem

* Profile ScatterPlotItem.paint to identify bottlenecks

* Reuse targetRect to improve paint performance

* Readability improvements (opinionated)

* Only need to set x and y of targetRect

- w and h can stay set to 0 (not entirely sure why)
- this is a bit faster than setting all of x, y, w, h

* Minor renaming

* Strip off API changes and leave to another PR

* Renaming

* Compatibility

* Use drawPixmap(x, y, pm, sx, sy, sw, sh) signature to avoid needing to update QRectFs

* Use different drawing approaches for each Qt binding for performance reasons

* Fix a bug introduced two commits ago

Incidentally, I think there is a similar bug in the main branch currently.

* Minor performance and readability improvements

* Strip out source and target QRectF stuff

* Bring source and target QRectF stuff back in a less coupled way

* Leave deprecating getSpotOpts for another PR

* Compatibility fix

* Added docstrings and use SymbolAtlas__len__ where possible

* Fix export issue

* Add missing import

* Add deprecation warnings

* Avoid using deprecated methods

* Fix and cleanup max spot size measurements

* Make creation of style opts entries explicit

* Add hovering API to ScatterPlotItem

* Compatibility

* Marshal pen and brush lists in setPen and setBrush

* Fixed platform dependent bug
2020-12-16 11:07:39 -08:00
Marko Toplak
1847bfcf97
Remove ViewBox.childGroup ItemClipsChildrenToShape flag (#1458)
The flag was set on ItemClipsChildrenToShape to solve the issue of #316
"A GraphicsItem object overlaps the ViewBox border line" at Luke Campagnola's
suggestion to solve further issues that @espdev had. Luke wisely
commented that this approach needs extensive testing.

We tested it. It broke PDF export in Orange. :)

A solution to #316 was merged in PR #321, which was refined from the discussion
in #316. I am not sure that, given rest of #321, the ItemClipsChildrenToShape
was really needed. Even without modifications to ChildGroup I did not
see any border problems (but I could replicate them in pre-#321 pyqtgraph).

Removing this flag fixes (and unneeded supporting code) fixes PDF export
regression in Orange while borders still seem a-OK.
2020-12-09 22:45:21 -08:00
Tom Mudway
ca7b4580fa
Added option to use "None" for adj in setData
This allows you to easily create code to toggle lines on or off by setting to the appropriate array if on, or None if off. Currently you have to have 2 seperate setData calls, one with adj and one without
2020-12-07 17:55:51 -05:00
Marko Toplak
00fd63e859
arrayToPath: revert to old meaning of connect=ndarray parameter (#1461)
The i-th position of that array used to define if points (i) and (i+1)
were connected, but in master it defines whether points (i-1) and (i) are connected.
This commit reverts to (i) and (i+1) interpretation.
2020-11-27 07:57:26 -08:00
2xB
433b061e81
Fix TickSliderItem: Avoid ghost ticks | Improved customPlot.py code (#1459)
* Fix TickSliderItem: Avoid ghost ticks | Improved customPlot.py code

If `TickSliderItem.setTickValue` was called when a full repaint of the `TickSliderItem` was
not already scheduled, the tick was visible at the old and the new position. This could e.g. be seen
when using the autoscale button in the `customPlot.py` example.

Further, code from `customPlot.py` is improved to make use of `Tick.setVisible` instead of adding and
removing ticks based on their visibility.

* customPlot.py: Explain bool conversion

Co-authored-by: 2xB <2xB@users.noreply.github.com>
2020-11-26 22:28:03 -08:00
Ogi Moore
d2255228ba
resolve ordering of issues presented in #1322 (#1456) 2020-11-23 12:12:14 -08:00
Luke Campagnola
6c7bd87592
Fill in non-finite plot values for Qt versions >= 5.12.3 (#1287)
* Fill in non-finite plot values for Qt versions >= 5.12.3

* handle the case of all nan entries

Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2020-11-22 20:27:24 -08:00
Matt Liberty
a3fbd18239
Clipped AxisItem tick value labels to prevent drawing artifacts #732 (#1447) 2020-11-21 00:46:31 -08:00
Ogi Moore
71a92a6fd2
Fix autosize not taking to correct range with TextItem in view (#1435)
* Removing first call to updateMatrix in resizeEvent
2020-11-21 00:02:32 -08:00
Julius Juodakis
0e816f1dbe
InfiniteLine caching calls merged (fixes #1450) (#1452) 2020-11-20 21:27:55 -08:00
Nils Nemitz
6c14204682
Fix set empty (#1446)
* changes to setData and dataRect to handle setting empty data

* simplified named argument check

* tests for clearing PlotDataItem by setData() and setData([],[]), commented out vestigal xClean/yClean

* removed last remains of xClean/yClean
2020-11-18 09:31:28 -08:00
2xB
020b7077cb
TickSliderItem: allowRemove property added (#1442)
* TickSliderItem: allowRemove property added

Following #744, this PR suggests the addition of a property
`allowRemove` to `TickSliderItem` and therefore also to
`GradientEditorItem`. It sets the default of whether ticks can
be removed by the user and therefore contemplates `allowAdd`.

I would be interested in other opinions on this design decision,
as #744 suggests to reuse `allowAdd` for the prohibition of
tick removal.
I personally suggest this solution, since it does not change
the effect of the current API.

Fix #744

* customPlot.py: Added markers to example using TickSliderItem

* examples\GradientWidget.py: Demonstrate use of allowRemove

Co-authored-by: 2xB <2xB@users.noreply.github.com>
2020-11-16 16:18:26 -08:00
2xB
c359d5fad9
Fix ViewBox axis zoom in RectMode and examples/customPlot.py (#1443)
* Fix examples/customPlot.py: mouseDragEvent misses axis argument

Fixes #1277

* customPlot.py: Update methodolgy to disable menu

If there's an argument for this, we should use it

* customPlot.py: Show how to disable axis interaction

* Fix ViewBox: Moving axis in RectMode not implemented => use normal move mode

Grabbing an axis in RectMode leads to the zoom rectangle being displayed
in unreasonable positions. In this case, fall back to normal mode.

* customPlot.py: Only disable right-click zoom for demonstration

In cases where continuous zooming is not wished (e.g. in case of
complicated rebinning after zooming), this might come in handy
and there is no reason not to show it.

Co-authored-by: 2xB <2xB@users.noreply.github.com>
2020-11-16 14:27:40 -08:00
2xB
75048c473b
TickSliderItem: Use Tick.removeAllowed (#1441)
* Fix: TickSliderItem ignores Tick.removeAllowed

This prohibits removing ticks from a `TickSliderItem` if they were set to `tick.removeAllowed=False`.

Test code:
```python3
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore
import numpy as np

app = pg.mkQApp()

class CustomWidget(pg.GraphicsView):
    def __init__(self, parent=None, *args, **kargs):
        pg.GraphicsView.__init__(self, parent, useOpenGL=False, background=None)
        self.item = pg.TickSliderItem(*args, **kargs)

        for pos in (0, 0.5, 1):
            tick = self.item.addTick(pos)
            tick.removeAllowed = False # Possibility 1

        # Possibility 2
        for tick, value in self.item.listTicks():
            tick.removeAllowed = False

        self.setCentralItem(self.item)
        self.setFixedHeight(31)

w = CustomWidget()
w.show()

app.exec_()
```

* Make 'removeAllowed' regular property of 'Tick'

Co-authored-by: 2xB <2xB@users.noreply.github.com>
2020-11-16 11:54:46 -08:00
2xB
01aee93a16
Fix: TickSliderItem method uses function from subclass GradientEditorItem (#1439)
* Fix: TickSliderItem method uses function from subclass GradientEditorItem

* Improved code layout

Previously, creating a `GradientEditorItem` lead to 34 executions
of `updateGradient`, with these improvements, only 2 are needed.
Further, removed duplicate code and used signals whenever possible.

Co-authored-by: 2xB <2xB@users.noreply.github.com>
2020-11-16 10:56:58 -08:00
Stephanie Seeman
b21967d20d
default colors for enum ColorMap type (#1428)
* default colors for enum ColorMap type

* Update ColorMapWidget.py

if to elif

Co-authored-by: ALLENINST\stephanies <stephanies@alleninstitute.org>
2020-11-11 09:03:50 -08:00
Charles Brunet
4575decf6f
Prevent item duplication in Node context menu (#1361)
* Prevent item duplication in Node context menu

* Prevent duplicated items on Terminal context menu

* try better solution to prevent item duplication
2020-11-11 09:02:46 -08:00
Carlos Pascual
3aa3e9b991
Emit signal when GraphicScene.addItem() is used (#1388)
* Emit signal when GraphicScene.addItem() is used

Emit a signal (sigItemAdded) just after adding an item to a scene.
The item object is emited as the only signal argument.
This signal is useful for code that may want to react to newly added
items of a plot.

* Emit signal when GraphicScene.removeItem() is used

Emit a signal (sigItemRemoved) just after removing an item from a scene.
The item object is emited as the only signal argument.
This signal is useful for code that may want to react to removed
items in a plot.
2020-11-06 14:06:53 -08:00
ernierock
98c01a3667
Update GridItem.py (#1423)
Bug in GridItem.setTextPen() : on line 49 **kargs should be **kwargs. setTextPen does not work (until this simple fix is applied)
2020-11-06 14:04:34 -08:00
Gabriele Buondonno
cae1c66c78
Fix width, height and background in SVG exporter (#1401)
* [SVGExporter] Fix width and height

* [SVGExporter] Fix background color

* [SVGExporter] Remove f-strings

* [Exporter] Fix for QtGui.QGraphicsScene

* Revert "[Exporter] Fix for QtGui.QGraphicsScene"

This reverts commit 5bdd25ea40.

* [test_svg] Fix unit test
2020-10-27 21:27:31 -07:00
lidstrom83
0a7a54c3f6
Permit entry of non-finite values into float SpinBox (#1422)
* Permit nan, inf, and -inf for float SpinBox

Bounds are enforced against inf and -inf inputs, but not for nan.

* Ensure SpinBox text is updated when out-of-bounds value is entered

* Make inf and nan entry in SpinBox case-insensitive

* Make SpinBox example behave as advertised

* Make non-finite SpinBox values optionally allowed

* Python 2 compatibility
2020-10-27 21:26:05 -07:00
Toussaic
ae4522109e
User-defined keywords of getArrayRegion (#1416)
The three parameters "shape, vectors, origin" can't be passed as parameters because they are computed, which raise an error when kwds is passed to affineSlice.
2020-10-26 22:04:38 -07:00
Luke Campagnola
7d2fbe7596
Fix name/title handling (#1356)
- Parameters now respond to title change in setOpts
- Add Parameter.title()
- Action parameter uses default name/title handling in addition to setting button text (fixes #1320)
2020-10-26 21:56:26 -07:00
iam-git
451075b448
DataTreeWidget: sorting crashfix (#1419) 2020-10-24 16:58:51 -07:00
lidstrom83
0dacc57e02
Emit event with mouse clicks for some items (#1414)
Harmonizes behavior with PlotCurveItem.
2020-10-22 11:17:59 -07:00
Ogi Moore
27ca1747f1
Call GraphicsItem.viewTransformChanged() (#1413)
* Call GraphicsItem.viewTransformChanged()

* Needed to apply to labels too
2020-10-22 11:17:33 -07:00
lidstrom83
cff19f3271
Hide WidgetParameterItem.defaultBtn if param has no default (#1411)
Co-authored-by: Daniel Lidstrom <dlidstrom@russelltech.com>
2020-10-22 08:28:03 -07:00
Ogi Moore
1b89c47cc2
Add fontSize kwarg (taken from PR #129) (#1410) 2020-10-21 22:18:36 -07:00
lidstrom83
b44dcc135f
Fixed mouse interaction issues with DockLabel (#1408)
Co-authored-by: Daniel Lidstrom <dlidstrom@russelltech.com>
2020-10-21 20:52:44 -07:00
Dennis Göries
55a9e19e43
ScatterItem: Fix name setting (#1405) 2020-10-20 20:02:53 -07:00
Ogi Moore
7e57e07068
example app now works with Qt4 and Python2 again (#1302)
* example app now workw with Qt4 and Python2 again

* Example App is now part of the test suite

* Add initExample

* No scary warning when launching examples

* Fix scary examples.__main__ warning

* Use courier new font as its on all platforms

* Remove commented out code

* Add newline

* Updated docs, example app now tested

* Non-relative import for example app

* Proper importing now
2020-10-19 11:51:12 -07:00
Nils Nemitz
65e90faec5
dynamic range limiting in PlotDataItem (#1140)
* dynamic range limiting in PlotDataItem

* revised version of cynamic range limiting

* replaced == with is operator

* removed unicode +- character, converted to ascii

* code/docstring cleanup

* clean state with changes

* silenced numpy all-NaN warnings

* reverted PlotWidget.py to original

* reverted PlotWidget.py to original

* reverted PlotWidget.py to original

* rewrapped/reformated setDynamicRangeLimits docstring

Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2020-10-18 22:34:41 -07:00
Julius Juodakis
39f9c6a6aa
caching for viewRect of LinearRegionItem to reduce CPU load (#1391)
* caching for boundaryRect of LinearRegionItem

* caching viewRect at GraphicsItem
2020-10-18 16:42:40 -07:00
Ogi Moore
2c02d58134
Do not apply transparent background in Qt4 (#1403)
* Do not apply transparent background in Qt4

* Tests need to reflect this change too
2020-10-17 23:01:16 -07:00
Dennis Göries
b5de577c28
LegendItem: Enable customization of label text size and tests (#1397)
* LegendItem: Enable customization of label text size and tests

* One more CI

* Remove deleteLater of QAPP in legend item test

* Remove assert statement in setLabelTextSize

* Modify legend test without assertion
2020-10-15 10:56:34 -07:00
Ogi Moore
5eb671217c
Docs should have no warnings on pcolormeshitem (#1400) 2020-10-15 10:12:36 -07:00
Kenneth Lyons
1f76ac0e2c
Add a docs build job to CI (#1328)
* Add a docs build job to CI

* Add sphinxopts to fail on warning

* Test sphinx warning

* Redid ci stage conditionals

* update conf.py to remove deprecation warning

* introduce 3rd stage for proper conditionals

* Attempt to fix malformed table

Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2020-10-15 08:43:23 -07:00
Dennis Göries
3b6eb02520
AxisItem: Account for empty strings in the visibility of text and units (#1367)
* Rebase

* make the tests work

* add test and rather more cleanup

* Cleanup for axisitem visibility test

* Another cleanup in test axis item
2020-10-14 20:40:54 -07:00
Mitchel Paulin
e7b11cb39a
Fixed bug where removeTempArea would be called on home even if it was not defined (#1349)
* Fixed bug where removeTempArea would be called on home even if it was not defined

* Made the check for whether or not home is defined more explicit
2020-10-14 10:07:12 -07:00
Ogi Moore
9413dc8005
Disable mouse rate limiting (#1399) 2020-10-13 22:33:00 -07:00
Allard Hendriksen
9d99a3e7b0
Fix incorrect rendering of overlapping object in renderToArray() (#1306)
This commit adds a depth buffer in renderToArray().

This fixes the issue that overlapping objects are rendered incorrectly
when using renderToArray() on a GLViewWidget.

This might be related to issue #743.
2020-10-13 19:47:49 -07:00
Dennis Göries
287d564d7d
GraphicsView: Add basic tests ... (#1396) 2020-10-13 09:06:34 -07:00
Carlos Pascual
23a46b5fb9
Add "left" and "right" step Modes (#1360)
* Add "lstep" and "rstep" step Modes

stepMode is currently either True or False. If it is True,
it requires the user to make len(x) = len(y)+1. This is
inconvenient because it makes it difficult to change the
stepMode on a given curve (just as one would change, e.g.,
its color).

This commit extends the current situation by introducing
two more step modes: "lstep" and "rstep", which do not require
passing an extra x value. In turn, this modes associate each
y value to either the left or the right boundary of the step.

For example, the "rstep" mode is handy when plotting "life"
digital signals in which x,y data pairs are appended as they
are read.

This commit does not modify the behaviour in case of stepMode=True

* Replace step mode names: lstep,rstep -> left,right

* Improve docs for stepMode

Reword docstring and add it to PlotDataItem class too

* Document left and right stepModes as added in v 0.12.0

TODO: confirm the exact version number to use here

* Add comments stress the need for "is True"

Some conditional statements in the code regarding stepMode are
done with "is True". This is actually required since other
possible values such as "left" also evaluate as true but should
not be caught.

* Deprecate boolean API for stepMode

Introduce stepMode="mid" as a replacement of stepMode=True,
but keeping full backwards compatibility with the old API.
Adapt docs, examples and tests accordingly.

* Raise ValueError on unsupported stepMode values

* Rename "mid" step mode to "center"

* Remove "added in 0.12.0" note

See https://github.com/pyqtgraph/pyqtgraph/pull/1360#discussion_r502746919

* Add deprecation warning when stepMode=True

Issue a DeprecationWarning if stepMode=True is being passed to the
constructor or setData() of PlotDataItem or PlotCurveItem.

Note: warnings module is imported locally so that it is esier to
remove once this check is no longer needed.

* Fix wrong syntax in last commit

Fix usage of "default" kwarg in dict.get()
2020-10-13 08:52:07 -07:00
Dennis Göries
325a15a6ef
SignalProxy: Correct initialization without slot argument and tests (#1392)
* SignalProxy: Correct initialization without slot argument and provide tests

* Add missing slot is None case on disconnect

* Start new tests

* Exception block

* Test no module

* Different signal

* Debugging the signal connect

* Re initialize proxy after disconnect

* Add more test cases for blockSignal

* Change test case for signal count

* Give up for python 2 and pyside

* Exclude for Python 2.7 and PySide

* Convert float to integers in timer start period
2020-10-13 08:50:22 -07:00
Ogi Moore
4946a57987
Merge pull request #1382 from dgoeries/code-quality-legend
LegendItem: A bit auto flake8
2020-10-12 22:28:00 -07:00
Ogi Moore
539394e20c
Merge pull request #1362 from bruchar1/make-terminal-sortable
DataTreeWidget exception with multivalue Terminal (flowchart)
2020-10-12 21:46:28 -07:00
Ogi Moore
2955b26fb2
Merge pull request #1383 from dgoeries/transparent-palette
GraphicsView: Set a transparent background palette
2020-10-12 19:44:53 -07:00
Ogi Moore
3f7a9bb642
Merge pull request #1273 from edumur/develop
Implemented pColorMeshItem
2020-10-12 09:24:10 -07:00
Etienne Dumur
5ab0cef017 Solve artifacts issues
Add a parameter "antialiasing".
Remove profiler
Add pyqtgraph mkPen
2020-10-12 12:45:13 +02:00
rafael
fbf1a2fe18
ScatterPlotItem: Make + and x symbols thicker
This is something we're overriding in Orange3 (biolab/orange3#5007), as we change the symbols' alpha_value to show selected symbols. The default + and x symbols are too thin to show a noticeable change in alpha_value.

But I thought you might agree that the symbols look nicer this way.
2020-10-01 12:57:04 +02:00
Dominik Kutra
5842f42632
fix typo in documentation
found a tiny typo when reading the docs...

thank you guys for this awesome library 🚀
2020-09-29 17:29:52 +02:00
Dennis Goeries
9a51fc3662 GraphicsView: Set a trnasparent background palette 2020-09-26 14:36:43 +02:00
Dennis Goeries
6dc0b2c16d LegendItem: A bit auf auto flake8 2020-09-26 14:09:21 +02:00
Etienne Dumur
bd51fa7c87 Clean code, improve boundingRect 2020-09-23 09:27:23 +02:00
Kenneth Lyons
a90c443b7a
Fix PlotItem.setAxisItems (#1376)
* Fix PlotItem.setAxisItems

- Use extend so visibleAxes remains a flat list.
- More robust logic for detecting adding an AxisItem instance to
  mulitple plots and suggest a workaround in the error message.

* Simplify membership check

* Add test for PlotItem setAxisitem logic
2020-09-22 20:25:02 -07:00
Kenneth Lyons
e78e9c256d Consolidate and fix downsample factor computation in ImageItem 2020-09-20 22:06:00 -07:00
Ogi Moore
043b6b47ea
Merge pull request #1375 from ixjlyons/test-vector
Add targeted Vector test coverage
2020-09-20 14:54:47 -07:00
Kenneth Lyons
3ea32ff447
Merge pull request #1374 from ixjlyons/test-warnings-cleanup
Test warnings cleanup
2020-09-20 14:52:49 -07:00
Kenneth Lyons
fc957bbc4b Add targeted Vector test coverage 2020-09-20 09:19:39 -07:00
Kenneth Lyons
f1d0ea99b6
Merge pull request #1364 from meganbkratz/logScaleBugFix
fix for log scaling being broken
2020-09-16 22:27:04 -07:00
Kenneth Lyons
9e76f22750
Merge pull request #1368 from bruchar1/wrong-disconnect-receiver
Fix disconnect() in Flowchart with wrong receiver slot
2020-09-16 22:04:17 -07:00
Jens Hedegaard Nielsen
1d10561974 fix deprecation warning
the argument to qtimer.start should be an int not a float

the current code raises a deprecation warning with python 3.8
2020-09-16 10:48:37 +02:00
Charles Brunet
b2ceb8d053 Fix disconnect() in Flowchart with wrong receiver slot 2020-09-14 13:42:16 -04:00
Megan Kratz
46f8f1633f fix for log scaling being broken -- log was being taken twice, resulting in nan. Now it's only being taken once 2020-09-10 19:20:12 -04:00
Charles Brunet
a8417b6478 fix exception in DataTreeWidget when clicking on a node with multivalue Terminal connected 2020-09-10 08:59:17 -04:00
Kenneth Lyons
9fdaffaf7d
Merge pull request #1336 from ales-erjavec/fixes/arrow-item-parent-arg
Fix an error in ArrowItem constructor when passed a parent=... argument
2020-08-17 21:07:18 -07:00
Ales Erjavec
3d391d46e3 Add parent to ArrowItem's constructor signature 2020-08-17 09:27:23 +02:00
Ales Erjavec
52717fa8b7 Rename test 2020-08-17 09:25:37 +02:00
Kenneth Lyons
11b76a1a6f
Merge pull request #1339 from outofculture/vector-init-qt5
Vector init in qt5
2020-08-16 08:40:06 -07:00
Martin
7bf4e597d9 improve docstring formatting and wording 2020-08-15 22:15:58 -07:00
Kenneth Lyons
ab13cd450e
Merge pull request #1331 from LocutusOfBorg/new-sip
sip: switch to new PyQt5 api import, with fallback to the old impleme…
2020-08-15 12:45:05 -07:00
Martin
75899f0c4e conform to docstring format 2020-08-11 12:34:53 -07:00
Martin
817753bd82 right, we're camels here 2020-08-11 12:34:53 -07:00
Martin
9f996d041c Vector.__init__ improvements
* added docstring
* fixed handling of QVector3D args (cannot list() them)
* refactor to no longer need return statements
2020-08-11 12:34:53 -07:00
Kenneth Lyons
c8fc221e81
Merge pull request #1334 from termim/PlotCurveItem
More data validity checks in PlotCurveItem
2020-08-03 15:14:07 -07:00
Kenneth Lyons
7504f2ba27
Merge pull request #1326 from ixjlyons/doc-multiplotitem
Improve docs for MultiPlotWidget and MultiPlotItem
2020-08-01 17:19:18 -07:00
Ales Erjavec
a9049f1d4d Pop the 'parent' arg from ArrowItem opts parameter dict
If not, then an `KeyError: 'Invalid arrow style option "parent"'`
 is raised in setStyle.
2020-07-28 10:01:15 +02:00
Mikhail Terekhov
471d7415ee PlotCurveItem.dataBounds: more checks for empty range 2020-07-27 15:50:34 -04:00
Mikhail Terekhov
1ad3eacb78 PlotCurveItem.boundingRect: check for None returned from self.dataBounds 2020-07-27 15:50:26 -04:00