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
* 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>
* 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
* 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>
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.
* 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
* 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: 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
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
* 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>
* 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>
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"
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.
* 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>
* 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
* Added hovering demo to ScatterPlot example
* Use Qt's serialization for SymbolAtlas.symbolMap keys
Yields significant performance improvements when updating the scatter plot's options. See e.g. the plot hover example.
* Further optimized scatter plot picking
* Fix ScatterPlot example tool tip
* Clean up while I'm here
* Compatibility
* Some simple optimizations for ScatterPlotItem
Speedups for ScatterPlotSpeedTest.py:
~50% without pxMode
~ 0% pxMode with useCache
~30% pxMode without useCache
* ~3x speedup in scatter plot speed test with pxMode
* More optimization low-hanging fruit for the scatter plot
* Removed hover example to lazily pass tests
* Avoid segfault
* Re-add hover example to ScatterPlot.py
* Switch to id-based keying for scatter plot symbol atlas
- Use cases exist where serialization-based keying is a significant bottleneck, e.g. updating without atlas invalidation when a large variety pens or brushes are present.
- To avoid a performance hit, the onus is on the user to carefully reuse pen and brush objects.
* Optimized caching in scatter plot hovering example
* Fixed and optimized scatter plot hovering example
* Minor scatter plot optimization
* Cleanup
* Store hovered points in a set for the hovering example
* Keep a limited number symbol atlas entries around for future reuse
* Added a docstring note to remind the user to reuse QPen and QBrush objects for better performance
* Tidied up hovering example
* Typo
* Avoid unnecessary atlas rebuilds
* Refactored SymbolAtlas
* Efficient appending to SymbolAtlas
* SymbolAtlas rewrite
* Cleanup and profiling
* Add randomized brushes to speed test
* Add loc indexer to ScatterPlotItem
* Profile ScatterPlotItem.paint to identify bottlenecks
* Reuse targetRect to improve paint performance
* Readability improvements (opinionated)
* Only need to set x and y of targetRect
- w and h can stay set to 0 (not entirely sure why)
- this is a bit faster than setting all of x, y, w, h
* Minor renaming
* Strip off API changes and leave to another PR
* Renaming
* Compatibility
* Use drawPixmap(x, y, pm, sx, sy, sw, sh) signature to avoid needing to update QRectFs
* Use different drawing approaches for each Qt binding for performance reasons
* Fix a bug introduced two commits ago
Incidentally, I think there is a similar bug in the main branch currently.
* Minor performance and readability improvements
* Strip out source and target QRectF stuff
* Bring source and target QRectF stuff back in a less coupled way
* Leave deprecating getSpotOpts for another PR
* Compatibility fix
* Added docstrings and use SymbolAtlas__len__ where possible
* Fix export issue
* Add missing import
* Add deprecation warnings
* Avoid using deprecated methods
* Fix and cleanup max spot size measurements
* Make creation of style opts entries explicit
* Add hovering API to ScatterPlotItem
* Compatibility
* Marshal pen and brush lists in setPen and setBrush
* Fixed platform dependent bug
* Fix TickSliderItem: Avoid ghost ticks | Improved customPlot.py code
If `TickSliderItem.setTickValue` was called when a full repaint of the `TickSliderItem` was
not already scheduled, the tick was visible at the old and the new position. This could e.g. be seen
when using the autoscale button in the `customPlot.py` example.
Further, code from `customPlot.py` is improved to make use of `Tick.setVisible` instead of adding and
removing ticks based on their visibility.
* customPlot.py: Explain bool conversion
Co-authored-by: 2xB <2xB@users.noreply.github.com>
* Fix examples\customPlot.py: Not object-oriented
Copy-paste error: I referenced a specific object instead of self. Fixed.
* Fix examples\customPlot.py: Allow calling setTicks more than once
This fixes a bug where TickSliderItem is expected to return ticks.keys() but while it returns ticks.items().
Also: Minor code correction.
* Fix examples\customPlot.py: Avoid scaling differences
Consider padding of TickSliderItem for link between ViewBox and ticks
Co-authored-by: 2xB <2xB@users.noreply.github.com>
* TickSliderItem: allowRemove property added
Following #744, this PR suggests the addition of a property
`allowRemove` to `TickSliderItem` and therefore also to
`GradientEditorItem`. It sets the default of whether ticks can
be removed by the user and therefore contemplates `allowAdd`.
I would be interested in other opinions on this design decision,
as #744 suggests to reuse `allowAdd` for the prohibition of
tick removal.
I personally suggest this solution, since it does not change
the effect of the current API.
Fix#744
* customPlot.py: Added markers to example using TickSliderItem
* examples\GradientWidget.py: Demonstrate use of allowRemove
Co-authored-by: 2xB <2xB@users.noreply.github.com>
* Fix examples/customPlot.py: mouseDragEvent misses axis argument
Fixes#1277
* customPlot.py: Update methodolgy to disable menu
If there's an argument for this, we should use it
* customPlot.py: Show how to disable axis interaction
* Fix ViewBox: Moving axis in RectMode not implemented => use normal move mode
Grabbing an axis in RectMode leads to the zoom rectangle being displayed
in unreasonable positions. In this case, fall back to normal mode.
* customPlot.py: Only disable right-click zoom for demonstration
In cases where continuous zooming is not wished (e.g. in case of
complicated rebinning after zooming), this might come in handy
and there is no reason not to show it.
Co-authored-by: 2xB <2xB@users.noreply.github.com>
* 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
* example app now workw with Qt4 and Python2 again
* Example App is now part of the test suite
* Add initExample
* No scary warning when launching examples
* Fix scary examples.__main__ warning
* Use courier new font as its on all platforms
* Remove commented out code
* Add newline
* Updated docs, example app now tested
* Non-relative import for example app
* Proper importing now