Commit Graph

28 Commits

Author SHA1 Message Date
Ogi Moore fb2e684f45
Merge pull request #1943 from ntjess/rm-py2-codepaths
Remove python 2 code paths
2021-08-02 10:19:29 -07:00
njessurun c0eb3267d2 Remove python 2 code paths 2021-08-02 12:07:25 -04:00
njessurun ef99d3fbf6 Adds EOF newline to files missing it.
Note: intentionally avoids files moved / already adjusted from #1919
2021-08-02 11:51:28 -04:00
Kyle Sunden a472f8c5de
Remove all usage of python2_3.py (#1939)
* Remove all usage of python2_3.py

Technically these functions were exported at the top level of the library, this removes them without warning... If we want to we can bring them back for there, but I honestly don't think its needed, as we are py3 only now and have been for multiple releases.

This may introduce a number of 'useless cast' or similar but those were always happening anyway

This PR brought to you by sed

* Update varname in hdf example to avoid collision with builtin

* Clean up some leftover comments surrounding imports of compat code

* Unnecessary string casts

* Additional unnecessary casts

* syntax error fix

* more unnecessary casts

* Yet more unnecessary casts
2021-08-01 21:43:32 -07:00
Kyle Sunden 6a59b7e5b5
Many unused import cleanups (#1935)
* Many unused import cleanups

Ignored some star imports, some vendored code in colorama, only looked within pyqtgraph the library, not e.g. examples

* SpinBox decimal imported with both import and from import
2021-07-31 07:35:23 -07:00
Ogi Moore a6971c768d Move and Update test-data repo into pyqtgraph repo
To reduce complexity, and make it easier to add more images and tests,
the images in the `test-data` repository should be merged with the main
repository.  Furthermore, we can remove a lot of the subprocess work in
the image_testing.py file, as we no longer need to have it interact with
git.

The images are not the same.  Images were regenerated with Qt6, and now
have proper big and little endian handling thanks to @pijyoi

Second commit is a slightly modified variant of
2e135ab282d6007b34a3854921be54d0e9efb241 authored by @pijyoi
it is to convert qimages to RGBA8888 for testing.  Image
files were regenerated images for the big/little handling

Fixed issue with bogus test from test_NonUniformImage and generated a
new image
2021-05-31 21:05:00 -07:00
Martin Chase 85e2574230
useCupy option should be settable after ImageItem init (#1749)
* do not cache the cupy so the config option can be set later

* getCupy will always return None if the option is not set

* test of failing behavior

* divorce skip from option; restore option after test
2021-04-30 10:41:11 -07:00
pijyoi 4d6a8e4998
add usage of numba (for rescale) (#1695)
* implement rescale using numba

* workaround to pass test_makeARGB.py

* key on (input, output) manually

* remove minimum version check

* signature needs to be a list of signatures

numba considers it a mistake for single-item non-list but works around
it internally

* add numba test to test_makeARGB.py

* add numba as dependency in CI

* handle properly the case where useNumba was already True

* restore useCupy setting after test

* filter numba nan warning

* don't make changes to test_cupy_makeARGB_...
2021-04-28 22:29:09 -07: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
Nils Nemitz 194941dfb2
change imports in cupy module to be local (#1548) 2021-02-06 09:21:24 -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 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
Ogi 5c44d51d6c remove resolution test, have display information printed during debug step 2019-06-09 16:25:22 -07:00
Ogi 2df71abfec We support pyside2 don't we? 2019-05-30 14:40:39 -07:00
Luke Campagnola c390c5cd98 fix lru_cache 2018-05-16 08:33:51 -07:00
Luke Campagnola 1f380c93c1 fix itervalues 2018-05-15 16:37:58 -07:00
Luke Campagnola a86ab30578 fix iteritems 2018-05-15 16:37:20 -07:00
Luke Campagnola 1911a26f84 Allow Mutex to be used as drop-in replacement for python's Lock 2017-09-13 22:14:29 -07:00
Eric Dill 934c2e437f MNT: Print function -> Print statement 2015-07-11 11:17:48 -05:00
Luke Campagnola 0976991efd Import from python2_3 for all uses of basestring, cmp, and xrange 2015-05-19 09:29:55 -04:00
Luke Campagnola 706fe92fdb Remove old PIL-fix files, replace with equivalent runtime-patching code. 2014-08-07 09:13:32 -04:00
Luke Campagnola 753ac9b4c4 Squashed commit of the following:
commit ca3fbe2ff9
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Thu Aug 7 08:41:30 2014 -0400

    Merged numerous updates from acq4:
    * Added HDF5 exporter
    * CSV exporter gets (x,y,y,y) export mode
    * Updates to SVG, Matplotlib exporter
    * Console can filter exceptions by string
    * Added tick context menu to GradientEditorItem
    * Added export feature to imageview
    * Parameter trees:
        - Option to save only user-editable values
        - Option to set visible title of parameters separately from name
        - Added experimental ParameterSystem for handling large systems of
            interdependent parameters
        - Auto-select editable portion of spinbox when editing
    * Added Vector.__abs__
    * Added replacement garbage collector for avoiding crashes on multithreaded Qt
    * Fixed "illegal instruction" caused by closing file handle 7 on OSX
    * configfile now reloads QtCore objects, Point, ColorMap, numpy arrays
    * Avoid triggering recursion issues in exception handler
    * Various bugfies and performance enhancements
2014-08-07 09:03:26 -04:00
Luke Campagnola 6b66edfd46 Added Travis CI support
Fixed bugs / style issues to please Lord Travis

Squashed commit of the following:

commit f25048a1e1
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Sun Mar 30 02:40:47 2014 -0400

    syntax

commit cc8b69695a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Sun Mar 30 02:36:49 2014 -0400

    add size check, diff style check

commit 5d5ea065a4
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Sun Mar 30 02:16:05 2014 -0400

    travis fix

commit b154c6d997
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Sun Mar 30 02:09:41 2014 -0400

    travis, flake colored output

commit 46921dcd87
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 12:37:54 2014 -0400

    fix pyside+py3 bugs to satisfy CI

commit 1d30f3c5c7
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 11:13:18 2014 -0400

    fix py3 tests

commit 426578fa4c
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 07:39:19 2014 -0400

    fix pytest install

commit 88a13c1a71
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 00:29:29 2014 -0400

    qt5 updates

commit 51995488cc
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 00:16:04 2014 -0400

    correct py.test command for py3

commit e2b02fbcbd
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 23:50:38 2014 -0400

    fix 2nd install test

commit 4b3e3ee04a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 23:31:31 2014 -0400

    syntax error

commit 250eabdb34
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 23:13:42 2014 -0400

    look for py.test3

commit 9f9bca47c1
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 22:54:19 2014 -0400

    fix syntax

commit 0a871c6f36
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 22:47:58 2014 -0400

    output pip build log

commit dbce58d8cd
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 22:38:55 2014 -0400

    no comments allowed between shall lines

commit b79c06121d
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 20:56:35 2014 -0400

    another pip try

commit 09f4f5d82a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 13:36:09 2014 -0400

    pip correction

commit 0eedb5c18e
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 13:29:00 2014 -0400

    correct py version output

commit d9fd039be2
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 11:55:43 2014 -0400

    apt checks

commit cf95ccef86
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 10:23:10 2014 -0400

    alternate pip install method

commit bee0bcddfe
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:51:45 2014 -0400

    correct deps install

commit 963a4211fc
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:47:30 2014 -0400

    fixes

commit 0c86cd1dc2
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:31:06 2014 -0400

    permission fix

commit 5d04ef53b8
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:30:19 2014 -0400

    Fix py.test version selection

commit b0e6c7cb94
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:25:34 2014 -0400

    try another pyqt5 install method

commit 422a792866
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:12:36 2014 -0400

    syntax error

commit 533133905a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:04:37 2014 -0400

    fixes

commit 8d65211ba4
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 22:40:18 2014 -0400

    Add Qt5 test
    minor fixes

commit 4484efaefe
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 22:31:56 2014 -0400

    use correct py.test for python version

commit 5d2441a29b
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 22:24:27 2014 -0400

    add setup tests

commit 9291db64f2
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 21:48:43 2014 -0400

    fix py3-pyqt install

commit a7aa675c5a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 21:31:33 2014 -0400

    travis tests

commit e71cd2b23a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 21:17:15 2014 -0400

    more corrections

commit 527df3bca8
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 20:56:01 2014 -0400

    travis corrections

commit 87d65cac4a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 20:48:02 2014 -0400

    Add flake tests
    Correct style in a few files to please Lord Travis

commit 537028f88f
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 17:36:24 2014 -0400

    minimize pyside package install
    correct line endings to satisfy Lord Travis

commit 1e3cc95e37
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 17:23:03 2014 -0400

    enable pyside, line ending check
    fix test

commit d7df4517f9
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 17:12:06 2014 -0400

    syntax fix

commit 1ad77a2155
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 17:00:30 2014 -0400

    alt. pytest install

commit 5edcc02072
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 16:52:33 2014 -0400

    Added initial travis.yml
2014-03-30 02:51:32 -04:00
Luke Campagnola 604ea49477 Fix for colorama bug:
https://code.google.com/p/colorama/issues/detail?id=47
2014-03-25 19:17:11 -04:00
Luke Campagnola 693df7030a Fixed multiprocess deadlock on windows
Added several utilities and debugging tools
Merge branch 'multiprocess-fix' into develop
2014-03-14 18:48:07 -04:00
Luke Campagnola 79cfd3601e Rename Mutex module 2014-03-14 18:00:29 -04:00
Luke Campagnola 89c04c8a81 Corrected bug in multiprocess causing deadlock at exit
Multiprocess debugging messages now use one color per process
Corrected RemoteGraphicsView not setting correct pg options on remote
process

New debugging tools:
* util.cprint for printing color on terminal (based on colorama)
* debug.ThreadColor causes each thread to print in a different color
* debug.PeriodicTrace used for debugging deadlocks
* Mutex for detecting deadlocks
2014-03-14 14:18:46 -04:00
Luke Campagnola dcb2c42179 Moved lru_cache to util, test to util/tests 2014-03-05 09:16:53 -05:00