Commit Graph

38 Commits

Author SHA1 Message Date
Ogi Moore
d396d33799
Remove the use of pyqtgraph.ptime (#1914)
* Remove the use of pyqtgraph.ptime

With us supporting python3.7+, we have no more need for the ptime module
and can instead safely use perf_counter for everything.

* Address small issues PR turned up

* Reword comment in ImageView
2021-07-22 20:57:50 -07:00
KIU Shueng Chuan
21296cd4f3 change all examples to use pg.exec() 2021-05-14 06:16:21 +08:00
KIU Shueng Chuan
09ce81655d VideoSpeedTest.py : Add numba checkbox 2021-05-07 15:35:27 +08:00
KIU Shueng Chuan
de85a23ae0 switch to row-major order 2021-03-26 04:07:19 +08:00
KIU Shueng Chuan
fda8731dab reduce memory usage during data generation
random.normal() generates as float64 and gets converted to a smaller
dtype. generating all the needed data in a single call thus uses a lot
more memory than is necessary.

this changes it such that smaller chunks are generated.
data clipping is also changed to be in-place.

the gaussian filtering which gave the video a washed-out look is also
removed. this also contributed to data generation time.
2021-03-26 04:07:19 +08:00
KIU Shueng Chuan
cbafc773f5 fix: max value of uint16 is 65535 2021-03-26 04:07:19 +08: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
d8e826e379 disable opengl vsync for benchmarking 2021-02-22 21:15:57 +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
Ogi Moore
3bfe2d81ba Do not use numpy deprecated type aliases 2021-02-13 10:57:38 -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
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
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
92016d3d5a add imports of _pyside6 files 2021-01-15 08:25:06 +08:00
Elliott Sales de Andrade
d726a9693e Fix UnboundLocalError in VideoSpeedTest. 2019-09-13 01:07:57 -04:00
Luke Campagnola
82afad8366 Fix up Qt.py and deprecate USE_XX variables 2018-02-16 20:42:34 -08:00
Luke Campagnola
46f10f24f8 Merge branch 'develop' of https://github.com/maxpeng/pyqtgraph into maxpeng-develop 2018-02-15 18:30:12 -08:00
Luke Campagnola
a0e4301b38 Fix VideoSpeedTest to disable RawImageGLWidget when openGL is unavailable 2016-10-26 09:26:01 -07:00
Max Peng
8bdc19be75 update to support pyside2 2016-09-25 00:16:36 +08:00
Luke Campagnola
bee5878915 Added imageAxisOrder config option
Added global config documentation
ROIs don't exactly work yet..
2016-08-23 09:06:43 -07:00
Luke Campagnola
7e40b329e9 more examples working under pyqt5 2015-02-28 11:05:57 -05:00
Luke Campagnola
5f7e4dc644 Removed extra image window from VideoSpeedTest 2014-03-14 18:49:34 -04:00
Luke Campagnola
1edf1375ed Removed all dependencies on scipy.
Merge branch 'make_scipy_optional' into develop
2014-03-11 19:05:30 -04:00
Luke Campagnola
34802c8aec Added pg.gaussianFilter, removed all dependency on gaussian_filter 2014-03-11 19:01:34 -04:00
Luke Campagnola
7d32ef85be Added automatic image downsampling (disabled by default)
- Reduces aliasing when zoomed out
  - Improves performance and memory usage for large images
Merge branch 'image_downsampling' into develop

Conflicts:
	pyqtgraph/graphicsItems/ImageItem.py
2014-02-17 20:48:22 -05:00
Luke Campagnola
8d7ab108fd Fixed PySide issues by removing itemChange methods from GraphicsWidget and ViewBox;
Workaround is for ViewBox to see whether its scene has changed every time it paints.

Fixes: 12
2013-11-16 20:23:41 -05:00
Luke Campagnola
7cd3e663f9 experimental GL video widget
temporary fix for text parameter ignoring expanded option
Don't use os.EX_OK in pg.exit()
2013-07-10 00:02:16 -04:00
Luke Campagnola
491aee0fe2 python3 fixes
cleaned up examples
2013-02-24 23:09:03 -05:00
Luke Campagnola
3de5719011 Merged testing code from Kratz
Numerous fixes for python 3 compatibility
2012-12-05 00:25:45 -05:00
Luke Campagnola
e5f383fbb5 Bugfixes and updates to functions.py:
- generalized makeARGB API: can now process arrays of arbitrary shape.
  - affineSlice automatically converts vector arguments to array
  - new function applyLookupTable taken from makeARGB
  - isosurface function returns array
Updated VideoSpeedTest example to follow new makeARGB API

LayoutWidget: row argument now accepts 'next' as value
ParameterTree bugfix: avoid infinite recursion when accessing non-existent attributes
ViewBox: avoid exit error caused when cleanup callback is invoked while python is shutting down
2012-11-23 16:01:25 -05:00
Luke Campagnola
32311351f1 Now detects and switches between PyQt / PySide automatically; no need to distribute different versions of the library anymore. 2012-09-09 19:07:36 -04:00
Luke Campagnola
bdb6ff88a2 Updates to IsocurveItem, added isocurve example
minor updates for other examples
2012-04-04 12:22:43 -04:00
Luke Campagnola
78d4bc0838 Performance enhancements
- HistogramLUTItem avoids using lookup table if possible
 - GradientEditorItem has a method to ask whether the gradient is trivial (can be applied without the use of a lookup table)
 - ROI, LinearRegionItem, InfiniteLine no longer redraw for every mouse movement
2012-04-04 09:29:35 -04:00
Luke Campagnola
dc597ac584 fixes for pyside compatibility 2012-03-01 22:53:52 -05:00
Luke Campagnola
d4e8e2b883 Imported major changes from acq4 project. 2012-03-01 21:55:32 -05:00