Commit Graph

145 Commits

Author SHA1 Message Date
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
Ogi Moore
825286066a only cast to float32 when safe to do so 2021-02-14 17:43:32 -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
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
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
KIU Shueng Chuan
54d7c591b5 PyQt6 6.0.1 changes QImage constructor api 2021-02-07 07:14:24 +08:00
Nils Nemitz
194941dfb2
change imports in cupy module to be local (#1548) 2021-02-06 09:21:24 -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
cd10719837 Support siPrefix with no suffix in SpinBox 2021-02-03 17:14:06 -08:00
Ogi Moore
7b3fdda1e4 Merge branch 'master' into ptree 2021-01-31 13:36:53 -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
KIU Shueng Chuan
dcbddb0abf add PyQt6 support to Qt.py and functions.py 2021-01-23 08:29:43 +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
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
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
fd85076bb6 invert QTransform using adjoint() and determinant() 2021-01-10 13:58:31 +08:00
Ogi Moore
2689cdb5f6 Fix regex warning 2020-12-22 10:26:19 -08:00
Daniel Lidstrom
0703e3db9b Ensure synchronization of parameter and widget's values 2020-12-20 18:43:11 -08: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
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
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
Kenneth Lyons
b058d032d1 Fix some warnings 2020-07-13 21:09:31 -07:00
Luke Campagnola
ac417a6567 py3 fixes 2020-07-05 22:52:15 -07:00
zhujun98
b61c7c1e39 Fix the cases with connect being 'pairs' and 'finite' 2020-06-29 23:20:29 +02:00
zhujun98
7016d1c6c3 Fix arrayToPath
Use the correct format for streaming QByteArray to QPainterPath.
2020-06-28 21:23:06 +02:00
Ogi Moore
ecd0642ca9
Merge pull request #977 from campagnola/pseudoscatter-performance
Add a faster method for computing pseudoscatter
2020-06-13 21:08:33 -07:00
Maurice van der Pot
e18af48b8d
Implement headWidth parameter for arrows (#385)
Although the documentation used to say that specifying tipAngle would
override headWidth, headWidth was never used. The new behaviour is that
tipAngle will be used, with a default value of 25, unless headWidth is
specified.

Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2020-06-09 22:04:29 -07:00
alfon_news
fc7921100e
Fix siScale imprecision errors (#508)
* Fix siScale imprecision errors

* Implement 2xB suggested change

Co-authored-by: Alberto Fontán Correa <afontan@com.uvigo.es>
Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2020-06-08 22:51:14 -07:00
Ogi Moore
d282f8aba8
Remove workaround for memory leak in QImage (#1223)
Co-authored-by: Ognyan Moore <omoore@sensoryinc.com>
2020-06-05 20:57:20 -07:00
Jan Kotanski
6f34da586d remove second nanMask = np.isnan(data) 2020-04-03 17:56:38 -07:00
Jan Kotanski
daeacad71f Make nanMask compatible with 3D data 2020-04-03 17:56:11 -07:00
Jan Kotanski
61967bd7f7 add nanfix 2020-04-03 17:49:34 -07:00
Kenneth Lyons
db67a256a9
Miscellaneous doc fixups (#1142)
* Miscellaneous doc cleanup

* Moved dockarea up a level (like flowchart, parametertree). Removed extraneous parametertree doc
2020-04-03 10:06:25 -07:00
Jan Kotanski
65d2ac58e0 fix for nextafter 2020-01-08 21:19:09 +01:00
Ogi Moore
71c4807559 fix dict eq() checks 2019-11-20 21:54:56 -08:00
Luke Campagnola
a8529e48f3 faster keys comparison 2019-11-20 21:54:56 -08:00
Luke Campagnola
7cb27594a5 fix dict keys comparison 2019-11-20 21:54:56 -08:00
Luke Campagnola
542f4b446b Add eq() support for comparing dict, list, tuple 2019-11-20 21:54:56 -08:00
Mi!
071e429535 makeRGBA/ImageItem: Applying alpha mask on numpy.nan data values (#406)
* Applying alpha mask on numpy.nan data values

* Typesafe, checking for `data.dtype.kind`
2019-09-27 13:31:47 -07:00
Pepijn Kenter
3a863fff9a Fixes incorrect default value for scale parameter in makeARGB. (#793)
* Fix incorrect default value for scale paremter in makeARGB.

* update tests to pass with codebase change
2019-08-17 22:19:11 -07:00
2xB
8d2c16901b Merge master into develop (#981)
* Information is spelled with an r, even in comments
2019-08-16 20:16:01 -07:00
Luke Campagnola
dc9aa84ce3 Add a faster method for computing pseudoscatter 2019-07-01 18:30:00 -07:00
Kenneth Lyons
9653254094 Fix infinite scale in makeARGB (#955) 2019-06-23 09:38:48 -07:00
Ogi Moore
95d62cec6a
Merge pull request #876 from Dschoni/Fix-deprecated-boolean-substract
Typecast Levels to be float
2019-05-23 22:26:21 -07:00
dschoni
bac8080b0c Typecast Levels to be float
This circumvents cases in which "levels" is a boolean array and therefore the substraction fails due to deprecation.
2019-05-21 14:14:10 +02:00
dschoni
7f93e8205f Found one more instance of the same warning in functions.py 2019-05-21 13:38:46 +02:00
Luke Campagnola
66dcfc7c67 Merge branch 'develop' into pyside2 2018-05-22 15:22:54 -07:00
Luke Campagnola
60a48ed2e4 reload tests pass in python 3 2018-04-26 13:22:47 -07:00
Luke Campagnola
bc2c3232e2 Merge branch 'develop' into reload-updates 2018-04-26 11:08:33 -07:00