Commit Graph

40 Commits

Author SHA1 Message Date
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
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
njessurun c0ebf8a432 Fix #1814 2021-06-02 11:03:22 -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 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 ff71b6be6b Add actual deprecation warnings 2021-02-11 21:34:02 -08:00
Ogi Moore 7b3fdda1e4 Merge branch 'master' into ptree 2021-01-31 13:36:53 -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
Daniel Lidstrom 0703e3db9b Ensure synchronization of parameter and widget's values 2020-12-20 18:43:11 -08:00
Luke Campagnola 7d2fbe7596
Fix name/title handling (#1356)
- Parameters now respond to title change in setOpts
- Add Parameter.title()
- Action parameter uses default name/title handling in addition to setting button text (fixes #1320)
2020-10-26 21:56:26 -07:00
Kenneth Lyons b41c4a71e5
Fix Parameter.hasDefault (#1275)
When a default value is not set, hasDefault returns False. If
default=None is passed, hasDefault still returns False.
2020-06-24 21:35:05 -07:00
2xB 7672b5b725
Fix: Parameter tree ignores user-set 'expanded' state (#1175)
* Fix: Parameter tree ignores user-set 'expanded' state

When setting the 'expanded' state of parameters, this change is not applied
in the graphically visible tree. This commit changes that behaviour by
adding a clause in `ParameterItem.optsChanged` to react to that.

Fixes #1130

* ParameterTree: Add option to synchronize "expanded" state

As seen in #1130, there is interest in synchronizing the "expanded" state
of `Parameter`s in `ParameterTree`s. As a default, this would lead to
users being forced to always have multiple `ParameterTree`s to be
expanded in the exact same way. Since that might not be desirable, this
commit adds an option to customize whether synchronization
of the "expanded" state should happen.

* Fix: Sync Parameter options "renamable" and "removable" with ParameterTrees

Currently, `Parameter` options `renamable` and `removable` are only considered
when building a new `ParameterTree`. This commit makes changes in those
options reflected in the corresponding `ParameterItem`s.

* ParameterTree: Reflect changes in Parameter option 'tip'

* Parameter: When setting "syncExpanded", update "expanded" state directly

Co-authored-by: 2xB <2xB@users.noreply.github.com>
2020-05-30 13:01:39 -07:00
Marko Bausch 4052f0dd11 Added context menu option to paramtree 2020-05-22 16:05:52 +02:00
Matt Liberty c52382c3b9 Moved emits after all method state updates since PySide2 immediately executes signals.
Pull request #907 addressed a specific case where a signal was emitted before a state update.
If an application's slot then calls back into the instance, the instance was in an inconsistent
state.  This commit audits and fixes similar issues throughout the pyqtgraph library.  This
commit fixes several latent issues:

* SignalProxy: flush -> sigDelayed -> signalReceived would have incorrectly resulted in timer.stop().
* ViewBox: resizeEvent -> sigStateChange -> background state
* ViewBox: setRange -> sigStateChange -> autoranging not updated correctly
* ViewBox: updateMatrix -> sigTransformChanged -> any _matrixNeedsUpdate = True -> ignored
* Parameter: Child may have missed state tree messages on insert or received extra on remove
* GraphicsView: updateMatrix -> sigDeviceRangeChanged/sigDeviceTransformChange -> before propagated to locked viewports.
2019-06-01 16:28:23 -04:00
Thomas A Caswell da1bf54ec8
MNT: use raw for regular expression 2019-02-14 16:41:54 -05:00
Luke Campagnola 937e3420e2 Don't store `children` key in Parameter.opts (closes #494, fixes #493) 2018-06-05 15:20:15 -07:00
Luke Campagnola bf31a5ba99 Parameter.child raises KeyError if requested child name does not exist 2017-09-29 08:55:36 -07:00
Luke Campagnola 0f910c45d1 Make parameter name,value inint args go through setValue and setName 2017-09-29 08:54:33 -07:00
Luke Campagnola 7761b9a23c Add basic type checking to parameters 2017-05-01 17:09:15 -07:00
Luke Campagnola c7923d3f95 Fix parameters sending 'children' key to setOpts on restoreState (fixes error seen in relativity demo)
Add debug replacement for sys.excepthook that prints full stack trace
2016-10-14 18:38:35 -07: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 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
tommy3001 ddaa07afb1 "Arguments" added again (copy/paste issue) 2014-02-12 20:49:53 +01:00
tommy3001 f99fdaf2ce Merge remote-tracking branch 'remotes/upstream/develop' into develop 2014-02-08 08:50:17 +01:00
Luke Campagnola 193367a56b Signal cleanup:
- Renamed GraphicsView signals to avoid collision with ViewBox signals that
  are wrapped in PlotWidget: sigRangeChanged => sigDeviceRangeChanged and
  sigTransformChanged => sigDeviceTransformChanged.
- All signal disconnections that catch TypeError now also catch RuntimeError
  for pyside compatibility.
2014-02-07 10:38:41 -05:00
tommy3001 2a13994a2a Bugfix: Malformed tables.
All argument lists with `**Arguments:**`
2014-02-05 21:04:33 +01:00
tommy3001 8b6ff6b06a Bugfix: Malformed tables. 2014-02-05 20:03:25 +01:00
tommy3001 92d7bbe18e In list tables "**Arguments**", "Arguments:" changed to **Arguments:** 2014-02-03 21:13:10 +01:00
Luke Campagnola a2e8290d8e console, graphicsscene, and 2nd-level graphicsitems 2013-12-23 07:51:33 -05:00
Luke Campagnola 4dbc411d19 minor fixes 2013-02-12 23:10:25 -05:00
Luke Campagnola 4c887c8f50 Merge new fixes and features from acq4 2013-02-10 14:10:30 -05:00
Luke Campagnola 18d5c6644b Added more documentation for parametertree and AxisItem
Fixed linearRegionItem hilight when not movable
2013-01-19 07:48:31 -05:00
Luke Campagnola af59296231 Reorganized directory structure to be more standard
Started new SVG exporter
Merged updates from ACQ4
2012-12-25 00:43:31 -05:00