Skip to content

Minor improvements to InteractiveFunction ecosystem#2521

Merged
ntjess merged 6 commits intopyqtgraph:masterfrom
ntjess:interactive-refactoring
Nov 10, 2022
Merged

Minor improvements to InteractiveFunction ecosystem#2521
ntjess merged 6 commits intopyqtgraph:masterfrom
ntjess:interactive-refactoring

Conversation

@ntjess
Copy link
Copy Markdown
Contributor

@ntjess ntjess commented Nov 5, 2022

  • Previously, subclasses of InteractiveFunction would still declare themselves to be InteractiveFuntion objects when str() was called. This no longer happens
  • Minor formatting of repr key (param -> parameters)
  • (the main reason for PR) allow better customization of resolveAndHookupParameterChild. It may be desirable to subclass Interactor and optionally ignore some children depending on a criteria (i.e., not a valid parameter type). In these cases, a simple change of allowing a None return value accommodates this. See the additional test case for an example. I considered making this default behavior for Interactor, but I wasn't sure if it was more sensible to fail (the current behavior), add to extra, or ignore. It is easy enough for users to customize for their needed behavior through a subclass, so I left the normal interactAndHookupParameterChild behavior for now.
  • Handle interacting when ActionGroup already exists in parent. See new test case for details. Previously, the function group was created, had signals hooked up, and was added to the parent parameter. However, if an existing child was returned, this new group had no relation to the parent tree and its signals wouldn't matter. Fixed by overriding the function group with the return value of addChild, which preserves old behavior and works in the new test case.

…ons.

This is a hold-over from when a button was either added or removed from a tree depending on button options. Now, the button is always present and simply hidden/not hidden based on button options. Thus, the tree widget will never change as a result of button opts.
@ntjess ntjess merged commit 553287a into pyqtgraph:master Nov 10, 2022
@ntjess ntjess deleted the interactive-refactoring branch April 11, 2023 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant