Commit Graph

3023 Commits

Author SHA1 Message Date
Ogi Moore 0d8eba36a6
Merge pull request #1957 from j9ac9k/bump-numpy-per-nep29
Bump minimum numpy up per NEP-29 schedule
2021-08-07 10:13:49 -07:00
Ogi Moore 690a416d5d Bump minimum numpy up per NEP-29 schedule 2021-08-07 09:37:19 -07:00
Ogi Moore a537bc2b23
Merge pull request #1956 from pijyoi/zerocopy_qba
arrayToQPath: use QByteArray as backing store
2021-08-06 22:22:09 -07:00
KIU Shueng Chuan 287ec9fbea arrayToQPath: use QByteArray as backing store
this avoids:
1) allocation and zero-ing of bytearray
2) copy of bytearray to QByteArray
2021-08-07 08:56:11 +08:00
Nathan Jessurun 503507ba50 Don't specify a version for deprecation 2021-08-06 08:04:51 -04:00
Nathan Jessurun 3d15ca1038 Catch remaining 'values' usages 2021-08-06 08:04:51 -04:00
Nathan Jessurun 6f44d27f2d Deprecate `values` opt for list parameter 2021-08-05 15:48:09 -04:00
Ogi Moore f16125c378
Merge pull request #1951 from timgates42/bugfix_typos
docs: Fix a few typos
2021-08-04 22:01:50 -07:00
Tim Gates a2078f8a87
docs: Fix a few typos
There are small typos in:
- doc/source/how_to_use.rst
- doc/source/region_of_interest.rst
- examples/ViewBox.py
- pyqtgraph/flowchart/Node.py
- pyqtgraph/graphicsItems/AxisItem.py
- pyqtgraph/graphicsItems/PColorMeshItem.py
- pyqtgraph/graphicsItems/PlotDataItem.py
- pyqtgraph/graphicsItems/TargetItem.py
- pyqtgraph/graphicsItems/ViewBox/ViewBox.py
- pyqtgraph/widgets/RawImageWidget.py

Fixes:
- Should read `mapped` rather than `maped`.
- Should read `vector` rather than `vetctor`.
- Should read `value` rather than `vaule`.
- Should read `preferable` rather than `preferrable`.
- Should read `output` rather than `ouptut`.
- Should read `information` rather than `inforation`.
- Should read `information` rather than `infomation`.
- Should read `exempt` rather than `excempt`.
- Should read `emphasizing` rather than `emphacizing`.
- Should read `construction` rather than `constrution`.
2021-08-05 06:47:08 +10:00
Ogi Moore 239e15a6f8
Merge pull request #1944 from pijyoi/getset_color_nih
use more of QColor functions / methods
2021-08-03 22:53:53 -07:00
KIU Shueng Chuan 178e693a4d add SVG named color support 2021-08-04 09:19:46 +08:00
KIU Shueng Chuan 371facb17f SVGExporter.py : fix background color
1) blue and green were swapped
2) %f used for integer rgb components
3) %d used for float opacity component
2021-08-04 09:19:46 +08:00
KIU Shueng Chuan 482b92d700 GLGradientLegendItem: remove opengl code
change fontColor to take a mkColor() argument

use hyperlink when referring to other functions
2021-08-04 09:19:46 +08:00
KIU Shueng Chuan efa662415e use QColor methods and functions 2021-08-04 09:19:34 +08:00
ntjess 4bf1866c2a
Organize paramtypes (#1919)
* Registered parameter types go in their own files

* Moves [int, float] item definitions outside `WidgetParameterItem`

* Moves [int, float] parameter definitions outside `WidgetParameterItem`

* Allow registering ParameterItems for easy parameter defs

* Finalizes moving simple parameters to their own files

* removes accidentally committed file

* Provides class qualnames in rst

* Address docstring build issues

* Address recent review comments
- `registerParameterItemType`:
  * added to docs and parametertree.__init__
  * Remove unsed PARAM_TYPES global
  * Hyperlink to `registerParameterType`
- parameter tree rst:
  * Alphabetize entries
  * Rebuild RST without fully qualified class name
  * Add note at file header that it is auto generated

* Remove spurious space during rst doc creation

* Ensure created/modified files end with newline

* Address CodeQL warnings

* toPlainText also returns str

* `QTreeWidgetItem.text` returns str
2021-08-02 10:47:55 -07:00
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
ntjess e18d1fb1f2
arrayToQPath can handle empty paths (#1920)
* Fixes #1888

* Improve test coverage of arrayToQPath

* Use early exit to solve empty path instead of slice manipulation

* address codeql qualms: Unused import, uneven tuple
2021-08-02 10:18:25 -07:00
Ogi Moore d0961cc320
Merge pull request #1942 from ntjess/add-newlines
Adds EOF newline to files missing it
2021-08-02 09:09:27 -07:00
njessurun c0eb3267d2 Remove python 2 code paths 2021-08-02 12:07:25 -04:00
Ogi Moore b0bcec1ff2
Merge pull request #1941 from ntjess/more-rm-py2_3
Remove unnecessary casting of `toPlainText` to str
2021-08-02 09:01:22 -07: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
Nathan Jessurun 84b491fb9b toPlainText also returns str
Note: intentionally leaves out instance in parametertypes.py to avoid merge conflict with #1919
2021-08-02 11:23:04 -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
Ogi Moore 1ddbfc8321
Merge pull request #1940 from pijyoi/fix_logmode
fix log mode by reverting to previous formulation
2021-07-31 20:50:36 -07:00
KIU Shueng Chuan aebc66dcaa fix log mode by reverting to previous formulation
this formulation is in the documentation for setLogMode()
2021-08-01 11:11:41 +08: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 2d90e54441
Merge pull request #1936 from pijyoi/empty_qpolygonf
Handle empty QPolygonF
2021-07-31 07:30:20 -07:00
KIU Shueng Chuan 04673ac98b rename: qimage_to_ndarray -> ndarray_from_qimage 2021-07-31 21:10:34 +08:00
KIU Shueng Chuan f64290be9e test that binding provides a write-thru QImage 2021-07-31 21:00:54 +08:00
KIU Shueng Chuan 9355ecf469 support padded QImage 2021-07-31 20:58:51 +08:00
KIU Shueng Chuan 75654b8495 handle zero-sized QPolygonF
depending on the implementation, a zero-sized QPolygonF may not
have any underlying buffer allocated and may return a null pointer when
queried for its "data()"

this null pointer is returned to Python as a "None" which breaks code
not expecting it.
2021-07-31 17:25:03 +08:00
KIU Shueng Chuan 9913f7c1e7 import shiboken{2,6} as shiboken 2021-07-31 15:58:56 +08:00
Ogi Moore 7aa5d0cbf4
Merge pull request #1910 from pijyoi/paramtree_plotspeed
PlotSpeedTest: add param tree control panel
2021-07-30 22:51:36 -07:00
KIU Shueng Chuan 643dd87800 add option to allow useOpenGL toggle 2021-07-31 13:01:40 +08:00
Ogi Moore fe10b5e8dc
Merge pull request #1711 from j9ac9k/test-feature-merge
Add GLGradientLegendItem (Reimplement #663)
2021-07-30 20:37:29 -07:00
Ogi Moore 0cfc9cd440 Add GLGradientLegendItem to pyqtgraph
Huge thank you to @feketeimre for the initial PR for this feature
Thank you to @pijyoi for re-implementing with no changes needed to
GLViewWidget and supporting QOpenGLWidget vs. QGLWidget.
2021-07-30 20:19:27 -07:00
Ogi Moore d3755520d0
Merge pull request #1892 from pijyoi/glpainteritem 2021-07-30 18:23:51 -07:00
KIU Shueng Chuan 0afd8adcd8 add Big Sur conditional examples from utils.py 2021-07-31 08:28:45 +08:00
Martin Schulz 96cccd96ec
make antialiasing optional for paintGL in PlotCurveItem (#1932)
* make antialiasing optional for paintGL in PlotCurveItem

* reversion to standard values if aa is disabled

* remove unnecessary lines
2021-07-30 12:19:02 -07:00
Nils Nemitz 5084d9b537
Reduce ColorMap inefficiencies (#1927)
* Avoid regenerating QColor lists, speed up generation where unavoidable

* whitespace and typo reduction
2021-07-29 20:50:10 -07:00
Martin Chase eb8965c2f4
Restore previous signature on TargetItem.setPos() (#1928)
* Restore previous signature on TargetItem.setPos()

* star means something to sphinx

Co-authored-by: Luke Campagnola <luke.campagnola@gmail.com>
2021-07-27 18:04:24 -07:00
KIU Shueng Chuan 1a34c8857f PlotSpeedTest: add param tree control panel
inspired by ScatterPlotSpeedTest.
2021-07-24 07:41:25 +08:00
Nils Nemitz 7009084e4c
more readable names for color map references in ColorBarItem API (#1908)
* more readable names for color map references

* changed example code

* activated deprecation warnings

* added accessor methods for cmap/colorMap
2021-07-23 14:45:57 -07:00
ntjess 81823768c0
feature More parameter item types (#1844)
* feature More parameter item types

Pen: Pops up a dialouge that allows the user to customize a pen. Setting pen value is not working yet.
Progress bar: For indication things.
Slider: Easier way to set values that dont require precision.
Fonts: Picking font types. Next thing could be a Font dialog.
Calendar: For picking dates or intervals
Open/save file/files/directory: Pops up an open/save file/directory dialog to select a file/directory. Filter string and caption can be defined too.

A PenSelectorDialog widget was created for the pen parameter item too.

Also added these parameter items to the example.

* PyQt/Side6 compatibility fixup

* Revisions from intial PR

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialog.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/parametertree/parameterTypes.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/parametertree/parameterTypes.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialog.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

* Bugfix: module instead of class import on param tree example

* Enrich the slider parameter

* Address pijyoi comments on pen style parameter

* Different file picker for easier porting

* Better organization and formatting, minor refactoring

* PyQt6/PySide6 fixup for file dialog

* Minor adjustment to file picker

* Bugfix: for 'None' sigChanged

'None' is explicitly allowed for a WidgetParameterItem's `sigChanged` value. However, this raises an error on a changed value unless the commit's fix is applied

* Calendar works better as sub item

* Fixes bugs in pen parameter's dialog + makes it resizable

* more bugfixes and recommended changes, lets pen serialize its options

* better pen save state

* Fixes file parameter qualms

* Fixes font parameter qualms

* Fixes calendar parameter qualms

* Fixes multiply-defined slider optsChanged

* Fixes pen parameter qualms

* ptree example minor bugfix

* Pen dialog bugfixes

* File dialog bugfixes / mild improvements

* unto ptree save state regression

* file fixup

* Adds parameter descriptions to docstrings

* Improved parameter documentation

* adds 'relativeTo' option for file parameter

* Less abuse of Qt enums during or-operations

* More uniform handling of relative paths

* More cleanup of enum setting

* better name for window title (matches qt name)

* Favor os.path over pathlib

* Exposes 'directory', 'windowTitle' to file parameter

* Fixup and add comparison to parameter tree state restoration

* Exposes "cosmetic" in pen parameter

* Indicate defaults in parameter documentation

* QtEnumParameter works for enums outside QtCore.Qt

* see if altering pytest report fixes ci bug

* Cleanup unused import and redundant `self.widget` assignments

Co-authored-by: Fekete Imre <feketeimre87@gmail.com>
Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>
2021-07-23 14:40:49 -07:00
Nils Nemitz 8f96c78715
Extend ColorMap with HSL cycles and subset generation (#1911)
* Extend ColorMap with HSL cycles and subset generation

* relaxed color palette data

* added hex to be installed in colors/maps/
2021-07-23 14:38:17 -07:00
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
Martin Chase 1d40d50b89
push bullet lists over 2 spaces to get them to show up as such in the… (#1912)
* push bullet lists over 2 spaces to get them to show up as such in the docs

* separate the literal block from the bullet list
2021-07-21 07:12:35 -07:00
KIU Shueng Chuan 1184e3fcce avoid converting dict to set 2021-07-19 08:31:54 +08:00
KIU Shueng Chuan 394b0dd75c implement set/get for cameraParams 2021-07-19 06:57:07 +08:00
KIU Shueng Chuan 8a6640c419 treat self.opts as private. provide accessors 2021-07-19 04:52:49 +08:00