Repository navigation
Started work on the #902, .lower function call and "None" checking added - #904
Closed
alexermolovich wants to merge 1 commit into
Closed
alexermolovich wants to merge 1 commit into
alexermolovich wants to merge 1 commit into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
petercorke
added a commit
that referenced
this pull request
Nov 18, 2026
* feat(backends): a registry of backends by name load_backend() was an if/elif over three names. The names are now entries in a registry, and register_backend() adds more: a lazy "module:Class" string, which is imported only when the backend is chosen, or a callable that returns one. Names are not case sensitive. An unknown name lists the registered ones, and a missing package names the pip extra. This is groundwork for #886, so a backend can be developed and used outside the Toolbox. Part of #902. No change to what the built-in backends do. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * refactor(robot): backend names are not case sensitive, and are plain strings robot.default_backend = "Swift" was kept as given and failed with ValueError at plot time. The name is now normalised where it is set (default_backend and set_default_backend) and where it is given (plot and teach), by one function in the registry. A name that is not a string is a TypeError where it is set. The backend argument of plot() and teach() was Literal["swift", "pyplot", "pyplot2"], which would reject a registered backend; it is now str, checked at runtime against the registry. Part of #902. Supersedes the lower-casing in #904. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * refactor(robot): plot() asks a backend what it can do, not what class it is plot() recognised Swift by type(env).__name__ == "Swift" and PyPlot by isinstance, so a new backend could not be a web page shown in a notebook, or make a movie, without being named or derived like one of them. Two flags on Connector, both False by default, replace the checks: - embeds_in_notebook: the backend is a web page that can be shown in the cell of a notebook (set by Swift), which plot() asks for in a notebook, and paces an animation in real time - supports_movie: the backend has getframe() (set by PyPlot) They are read with getattr, as supports_teach and supports_ellipse are, so a backend that does not inherit from Connector, as Swift does not, need not define them. Behaviour of the built-in backends is unchanged. Part of #902. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * docs(backends): document the backend registry and the capability flags Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
4 of 11 tasks
Owner
|
Thank you, Alex, for starting this. Your PR pointed at exactly the right place: the backend name handling in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for contributing to RTB!
Summary
Related issue
Checklist
Only the first item below is checked automatically — the rest are a self-check for you before requesting review, nothing currently verifies them for you.
type: description) — checked automatically, see the "Check PR title" statuspytest)X | Y,list[X], notUnion/Optional/List):param:,:returns:; type hints in the signature cover types now,:type:/:rtype:are rarely needed)assertin tests as "high" security), onlyAll tests passedand the PR title check are required — see CONTRIBUTING