Skip to content

Bugfix: interact on decorated method that uses self.#2408

Merged
ntjess merged 2 commits intopyqtgraph:masterfrom
ntjess:interactive-refactoring
Sep 8, 2022
Merged

Bugfix: interact on decorated method that uses self.#2408
ntjess merged 2 commits intopyqtgraph:masterfrom
ntjess:interactive-refactoring

Conversation

@ntjess
Copy link
Copy Markdown
Contributor

@ntjess ntjess commented Sep 7, 2022

The modified example in tests/parametertree used to fail before this PR. A result of #2404 was that inspect.signature no longer realized that self was a bound variable in class-defined, outside-decorated functions. Fix this simply by calling functionToParameterDict on the original function, rather than the interactive version.

Also expands runOpts to runOptions to remain in keeping with fully-expanded argument names elsewhere. setOpts and related terms are now the only non-expanded items, since they match the already-present Parameter API

The new example used to fail before this PR. A result of pyqtgraph#2404 was that `inspect.signature` no longer realized that `self` was a bound variable in class-defined, outside-decorated functions. Fix this simply by calling `functionToParameterDict` on the original function, rather than the interactive version.
@ntjess ntjess force-pushed the interactive-refactoring branch from c023a8e to 98528d0 Compare September 7, 2022 19:24
- `runOpts` -> `runOptions`
- Don't pollute `RunOptions` namespace with `UNSET` sentinel indicator, since it isn't affiliated with the run button behavior
@ntjess ntjess force-pushed the interactive-refactoring branch from 98528d0 to 74aa920 Compare September 7, 2022 19:29
@ntjess ntjess merged commit 569fa4e into pyqtgraph:master Sep 8, 2022
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Sep 8, 2022

congratulations @ntjess for your first merge to the repo! ...while you're at it ... (kidding!) Thanks for the PR!

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.

2 participants