autodiscover opmodes + opmode example#260
Open
virtuald wants to merge 8 commits into
Open
Conversation
virtuald
commented
May 8, 2026
|
|
||
|
|
||
| @overload | ||
| def autonomous(cls: _OpModeType, /) -> _OpModeType: ... |
Member
Author
There was a problem hiding this comment.
need docstrings for these decorators, should also document them in OpModeRobot
| return False | ||
|
|
||
|
|
||
| def _iter_scan_files(root: Path): |
Member
Author
There was a problem hiding this comment.
This doesnt really need to be a separate function -- but also, should we only scan the current directory, or maybe a specified directory?
If the user creates a .venv next to robot.py, then it will scan that entire thing and load any opmodes found. That seems bad.
|
|
||
| def __init__(self): | ||
| super().__init__() | ||
| _discover_decorated_opmodes(self) |
Member
Author
There was a problem hiding this comment.
All of the associated code with this seems a bit messy, need to reorg it a bit
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.
This is purely vibe-coded, but this is at least an initial look at what this will look like