Various places in the library attempt to check if scalars are finite
via numpy methods, which are intended to be used on numpy arrays. Using
the math module equivalent functions on scalars is significantly faster.
In a few places, I also use numpy methods explicitly (np.all vs. all)
Significant performance issues have been identified with np.clip
and thus clip_array was created to speed up the operation. In addition
clip_scalar was created to clip a scalar value between two other values
this commit replaces many uses of np.clip from operating on scalars to
using clip_scalar instead
PyQt6 can serialize / deserialize enums and flags w/o us manually
casting them to int.
In PyQt6 6.0, it was okay to pass the already deserialized flag
back to the class constructor.
In PyQt6 6.1, the flags MouseButtons and KeyboardModifiers have
been renamed to MouseButton and KeyboardModifier respectively.
skipping the reconstruction allows it to work on both PyQt6 6.0 and 6.1.
note that this was already done in deserialize_mouse_event()
Qt5 docs specify differences between QGLWidget and QOpenGLWidget:
"...when invoking paintGL().
QOpenGLWidget sets up the viewport via glViewport().
It does not perform any clearing."
* 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
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_()
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
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
* 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
* 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
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.
* 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
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.
* 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>
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.
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()