Commit Graph

132 Commits

Author SHA1 Message Date
Ogi Moore 9b67e51230 Switch to relative imports for some parameterTypes 2021-10-09 15:06:51 -07:00
Ogi Moore db74522003 Have parameter types imports use non __init__
When using isort, the order of parametertree/__init__.py imports broke many
of the parameter-types imports.  This commit modifies the import statement to
not use the imports from __init__.py but import the respective classes from the
the non-__init__ modules
2021-10-09 15:06:51 -07:00
ntjess 8d3e6cbd22
Better parameter tree testing (#1953)
* Allows values to be numpy arrays

* Bugfix: Slider now works when limits didn't change during `optsChanged`

* Improved testing + layout of param tree example

* Also fix numpy-like values in list `setValue`

* use proper hex formatting for  value

* Fix code warnings

* Avoids use of configfile in parametertree

* Avoid shadowing variable names

* Add explanatory comment to `makeAllParamTypes`

* Allow string options to be 'unset' in file, etc. parameters example

* Bugfix: unintunitive option unsetting for file window title

* don't use lambda in signal connect

* Remove unused import
2021-09-23 21:06:00 -07:00
ntjess babd037cf7
Adds checklist parameter (#1952)
* Alphabetize parameter registration

* Implements a checklist parameter

* Several checklist updates
- Correct indentation
- Allow dict-like setting + non-string values
- Fix several bugs associated with 'exclusive' behavior

* Add 'checklist' to param tree example

* Add documentation

* Removes unneeded code

* Forgot to rebuilt RST doc

* `exclusive` checklist uses radio buttons

* better checklist change logic

Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2021-09-07 21:25:17 -07:00
Nathan Jessurun 503507ba50 Don't specify a version for deprecation 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
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
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
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
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
Ogi Moore 195a1a6fa3 Remove Qt 6.0 support
Simplify some PyQt6 code branches
2021-06-08 21:23:49 -07:00
Ogi Moore d455da9aec Use Qt6 Enum Namespace
This namespace appears to be valid in PySide2/PyQt5 5.12+ so we may as
well migrate to the newer namespace ourselves.
2021-06-08 21:23:49 -07:00
Ogi Moore 31b4210f4e
Merge branch 'master' into merge-test-data 2021-06-02 22:15:46 -07:00
njessurun c0ebf8a432 Fix #1814 2021-06-02 11:03:22 -04: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
Ogi Moore 03ea368454 Clean up Errors for CodeQL analyzer
CodeQL identified some errors and warnings, which this commit cleans up.
2021-04-23 22:44:29 -07:00
Ogi Moore c4a1cf11a1 Use clip_array or clip_scalar instead of np.clip
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
2021-04-23 11:53:00 -07:00
Ogi Moore 85c726e49a Replace uses of np.log on scalers with math.log 2021-04-23 11:53:00 -07:00
Ogi Moore d4c5025289 Implement suggested changes from ixjlyons 2021-04-06 11:51:10 -07:00
Nathan Jessurun 58d126dcf3 fixes tests 2021-04-03 20:31:04 -04:00
Nathan Jessurun 4b002c06ba revert to old behavior: default created from value if not present 2021-04-03 17:07:02 -04:00
Ogi Moore bb5a179647
Add Deprecation Warning to Hex Strings That Do Not Start With "#" in mkColor (#1644)
* Add deprecation warning

* Incorporate changes to docs/warning

* correct input for no warnings

* Update docs examples in LabelItem
2021-03-23 11:35:06 -07:00
Ogi Moore fb6ae0ff2c
Merge pull request #1613 from chrismullins/parameter-unpacking
Add keys() method to Parameter class
2021-03-02 11:05:47 -08:00
Chris Mullins 9ed51cd1e2 Add keys() method to Parameter class
This returns the names attribute, allowing **unpacking of Parameter subclasses.
2021-02-28 03:00:19 +00:00
Martin af82858bc8 make these tiny methods with little excuse to exist private 2021-02-21 22:31:13 -08:00
Martin 68fa95686b fix typo 2021-02-21 07:05:24 -08:00
Martin 7f4f677ce1 lambdas which reference self prevent GC 2021-02-21 06:49:07 -08: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
Ogi Moore 3bfe2d81ba Do not use numpy deprecated type aliases 2021-02-13 10:57:38 -08:00
Ogi Moore ff71b6be6b Add actual deprecation warnings 2021-02-11 21:34:02 -08:00
Dennis Göries bac2ff5b4b
GraphIcons: Extend and deprecate previous pixmaps (#1534)
* GraphPixmaps: deprecate pixmaps

* Deprecation print

* More doc strings and deprecation warning
2021-02-05 21:09:59 -08:00
Kenneth Lyons 66c77118dc
Support suffix for int parameters (#1528)
* Support suffix for int parameters

* Fix spinbox test for new int formatting

* Tune up SpinBox tests a bit
2021-02-03 12:30:05 -08:00
Ogi Moore f5a823bf38
Merge pull request #1533 from pijyoi/kill_qt4_shim
Remove scale rotate translate Qt4 shims
2021-01-31 22:12:11 -08:00
Ogi Moore e02fc10a40 handle text flags like axisitem 2021-01-31 21:52:51 -08:00
Ogi Moore 0495f1dcce Replace deprecated method with suggested one 2021-01-31 20:39:07 -08:00
Ogi Moore 7b3fdda1e4 Merge branch 'master' into ptree 2021-01-31 13:36:53 -08:00
KIU Shueng Chuan 7192df7032 remove setMargin and setResizeMode shims 2021-01-31 22:21:32 +08:00
Kenneth Lyons c24d25bce3 Improve parametertree documentation
- Increase cross-referencing
- Give all built-in parameter and parameter items at least minimal
  docstring
- Start improving coverage of the special options available for some
  parameters
- Organize the built in parameters reference for easier navigation
2021-01-30 10:06:49 -08:00
Ogi Moore b54aa3914d
Attempt i18n localization (#1513)
* 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
2021-01-27 11:34:32 -08:00
KIU Shueng Chuan 607db15949 call super() on virtual QWidget methods 2021-01-23 08:29:44 +08:00
KIU Shueng Chuan 119c5fa3d0 convert QTreeWidget.setFirstItemColumnSpanned
convert QTreeWidget.setFirstItemColumnSpanned(item, True) to
item.setFirstColumnSpanned(True)

the former is deprecated since Qt 5.15.2 and removed in Qt 6.
2021-01-15 08:25:05 +08:00
Daniel Lidstrom daafb1d801 Revert previous commit 2020-12-23 00:05:36 -08:00
Daniel Lidstrom c2f0de0471 Attempt at passing Qt 4 CI pipelines 2020-12-21 23:15:57 -08:00
Daniel Lidstrom 6a8f7779dc Add tool tip support to action and group parameters 2020-12-21 23:09:19 -08:00
Daniel Lidstrom 2260030845 Focus change bug fix 2020-12-21 22:34:12 -08:00
Daniel Lidstrom acca19a1b3 Clearing selection on wheelEvent is buggy, so don't 2020-12-21 22:22:12 -08:00
Daniel Lidstrom b164e54e15 Get parameter's item in a nicer way 2020-12-21 20:48:15 -08:00
Daniel Lidstrom 4618c705e2 Fixed bug where enabled opt is not respected 2020-12-21 20:40:34 -08:00