Commit Graph

413 Commits

Author SHA1 Message Date
Ogi Moore
3b620836c4
Merge pull request #1651 from j9ac9k/Use_collections.abc
collections.abc not just collections
2021-03-23 11:56:02 -07:00
Ogi Moore
bb5a179647
Add Deprecation Warning to Hex Strings That Do Not Start With "#" in mkColor (#1644)
* Add deprecation warning

* Incorporate changes to docs/warning

* correct input for no warnings

* Update docs examples in LabelItem
2021-03-23 11:35:06 -07:00
Ogi Moore
bc7ca1beef Move Color Map Example To Main Section 2021-03-23 11:12:36 -07:00
Ogi Moore
4951bd743e
Replace main stanza with PyQt6 compatable variant (#1645)
* Replace main stanza with PyQt6 compatable variant

* Use fn.mkQApp instead

* remove needless comments
2021-03-22 11:17:12 -07:00
KIU Shueng Chuan
c49e471192 don't skip test_ExampleApp.py 2021-03-02 05:57:17 +08:00
KIU Shueng Chuan
85e894dd73 convert uses of QTimer.singleShot to QTimer instances
On macOS and Linux with PyQt bindings, QTimer.singleShot continues
to fire on python interpreter shutdown.
2021-03-02 05:57:17 +08:00
Kiu Shueng Chuan
1ad7d49908 de-duplicate Big Sur opengl skip testing 2021-03-02 05:57:17 +08:00
KIU Shueng Chuan
de11e6315c let examples have a chance to exit normally
cleanup imported module

1) instantiate MainWindow class if present
2) delete attributes from imported module when done
2021-03-01 21:24:43 +08:00
Martin Chase
2318f49bc4
include more color in the ImageView example (#1611)
* work taken from #312 (thanks, @ptweir !)
* turn on an ROI by default
2021-02-25 16:14:34 -08:00
KIU Shueng Chuan
d8e826e379 disable opengl vsync for benchmarking 2021-02-22 21:15:57 +08:00
KIU Shueng Chuan
fbd1e89950 regenerate templates 2021-02-22 19:17:53 +08:00
KIU Shueng Chuan
a657dea084 remove graphics system combobox 2021-02-22 19:17:53 +08:00
KIU Shueng Chuan
61616ffad9 remove calls to setGraphicsSystem
in fact all are no-ops
2021-02-22 19:17:53 +08:00
KIU Shueng Chuan
e09a397ebc modify environment to choose binding
the Example App allows the user to choose a binding and a graphics
system to use to execute an example.

issue 1: setGraphicsSystem is obsolete and the method no longer exists.
thus selecting a graphics system causes an error.

issue 2: the choice of binding to use is passed as an extra command
line argument to be parsed by initExample. this is problematic for
examples that use argparse, such as VideoSpeedTest.py

issue 3: if the user has set PYQTGRAPH_QT_LIB, that takes precedence
over the choice made in the Example App.

this patch fixes the above 3 issues by setting PYQTGRAPH_QT_LIB in
the child process' environment and removing the old parsing of the
command line arguments
2021-02-22 18:13:49 +08:00
Rafael Irgolic
ae54e27ff6 app.dark_mode => app.property('darkMode') 2021-02-18 19:02:18 +00:00
lidstrom83
6519734932
Deprecate unused/unnecessary modules (#1576)
* Deprecate ordereddict module

* Import OrderedDict from collections module instead of pgcollections

* Deprecate pgcollections module

* Deprecate lru_cache module

A simpler recipe exists from the standard library using OrderedDict.

* Deprecate pil_fix module

* Python 3.7 compatibility fix

* Avoid or suppress deprecation warnings in tests
2021-02-15 09:52:06 -08:00
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
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
3bfe2d81ba Do not use numpy deprecated type aliases 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
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
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
KIU Shueng Chuan
321b5e627a remove ProgressDialog from CI testing 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
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
f5a823bf38
Merge pull request #1533 from pijyoi/kill_qt4_shim
Remove scale rotate translate Qt4 shims
2021-01-31 22:12:11 -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
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
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
pijyoi
1044a7b6c4
Add almost all examples to ExampleApp (#1511)
* fix: delete generated designerExample_*.py files

designerExample.py loads designerExample.ui directly

* remove unused examples/utils.py

* add almost all examples in folder

* use mkQApp and don't set style nor palette

not needed for an example and also avoids a PyQt6 6.0 refcount bug in
app.setStyle()

* bold interesting examples

* test_examples.py needs to know about Namespace too

* Revert "remove unused examples/utils.py"

This reverts commit 2eddead459.

* categorize examples lists in utils.py
2021-01-26 13:45:53 -08:00
KIU Shueng Chuan
59fd72a3d1 exampleLoaderTemplate.ui : add Qt6 and remove Qt4 2021-01-23 11:43:34 +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
ab41c03358 generate _pyqt6.py files
VideoTemplate_pyside6.py : regenerate for cuda feature
2021-01-23 08:29:39 +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
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
3584736155 generate template files for pyside6 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
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
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
Ogi Moore
5d33ccff8d Cleanup ExamplesApp 2020-12-22 22:10:59 -08:00
Ogi Moore
6eace48663 Skip openGL tests on some macOS configs 2020-12-22 10:26:19 -08:00