Repository navigation
Drive the AVIS Academy web Sandbox - #19
Open
AmirmohammadZarif wants to merge 1 commit into
Open
AmirmohammadZarif wants to merge 1 commit into
AmirmohammadZarif wants to merge 1 commit into
Conversation
- Package layout matching the published avisengine wheel; version 0.2.0 with pyproject.toml (the 0.1.x build files were never committed). - Web Sandbox support: `python -m avisengine my_driver.py` runs the same setup()/loop() code as the Sandbox editor; `car.connectSandbox()` lets classic while-loop scripts drive it, one getData() per control step. - The Sandbox API (_api.py) is generated from the Sandbox's own module. - Local only: 127.0.0.1, Academy origins, six-digit pairing code. - Modern dependency floors; unused ones dropped. - Tests for the Sandbox link and the desktop protocol; CI fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What this adds
The API can now drive the AVIS Academy web Sandbox (the simulator in the browser) from Python on the learner's own computer, in two styles:
python -m avisengine my_driver.pyruns a script withsetup()andloop(). ThecarAPI is generated from the Sandbox's own module, so code moves between the browser and a laptop unchanged.car.connectSandbox()instead ofcar.connect(ip, port). EachgetData()is one simulation step;getSpeed()stays in km/h.The command prints a port and a six-digit pairing code. In the Sandbox, open Laptop Python, enter them and press Connect, then Run. The simulator waits for the script at every control step, so results do not depend on the computer's speed.
Desktop simulator use is unchanged (
from avisengine import Car,car.connect(...)).Security
The script listens on 127.0.0.1 only, accepts only AVIS Academy page origins, needs the pairing code, and serves one tab at a time. Graded practices always run in the browser.
Packaging
avisengine0.1.3 wheel, now versioned 0.2.0 with apyproject.toml(the 0.1.x build files were never committed).Tests and CI
loop()running on the serving thread (needed forcv2.imshowon macOS), and the desktop protocol against a fake simulator.tests/folder that did not exist; it now installs the package and runs the tests on Python 3.9 to 3.13.Checked
cv2.imshowinsideloop()works on macOS (it failed beforeloop()moved to the main thread).After merging
Publish 0.2.0 to PyPI, then the Sandbox's Laptop Python panel can switch to
pip install avisengine.🤖 Generated with Claude Code