Skip to content

docs(client): correct affect() note on which commands run in simulation - #42

Open
rishabh-bansal wants to merge 1 commit into
cyberwave-os:mainfrom
rishabh-bansal:docs/affect-sim-support-note
Open

rishabh-bansal wants to merge 1 commit into
cyberwave-os:mainfrom
rishabh-bansal:docs/affect-sim-support-note

Conversation

@rishabh-bansal

Copy link
Copy Markdown

What changed and why?

The Cyberwave.affect() docstring says:

Locomotion, flight, and driver commands (twin.locomote.*, twin.flying.*, twin.commands.*) are live/driver-only and raise NotSimulatedError in any simulation runtime.

That doesn't match the code, and twin.locomote / twin.flying don't exist (they're twin.locomotion / twin.flight):

  • Locomotion and flight methods are decorated @simulation_level(SimLevel.PLAYGROUND), so Twin._ensure_simulation_support allows them in every sim runtime. twin.takeoff(), move_forward() and turn_left() on a dji/tello twin worked for me in both "playground" and MuJoCo.
  • A catalog command's sim level comes from its delegate or the controller policy (command_factory._catalog_command_sim_level), and only otherwise is UNSUPPORTED.
  • docs-mintlify/overview/features/simulation.mdx already says these work in any sim runtime.

The note now describes that behaviour. Docstring only; no code change.

How did you test it?

Checked against twin/simulation_support.py, Twin._ensure_simulation_support (twin/base.py) and twin/command_factory.py, and against real flights of a dji/tello twin in Playground and MuJoCo (cyberwave 0.7.5). No tests needed for a docstring.

Contributor checklist

  • I added or updated tests for behavior changes, or explained why they are unnecessary. (docstring only)
  • I updated relevant documentation or examples.
  • I noted any public API, optional dependency, or simulation/live behavior changes. (none)

Recognition

  • Please skip the Discord celebration for this PR.

🤖 Generated with Claude Code

The note said locomotion, flight and catalog commands are live-only and raise
NotSimulatedError in any simulation runtime, and named twin.locomote/twin.flying,
which don't exist. Locomotion and flight methods are marked SimLevel.PLAYGROUND
and run in every sim runtime (as docs/overview/features/simulation.mdx already
says); catalog commands follow their delegate or the controller policy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Thanks for contributing to the Cyberwave Python SDK, @rishabh-bansal!

Maintainer contacts: @KhushiSharma22. When this PR is ready, we request a maintainer review and run an automated advisory review. CI and human review remain the source of truth.

Please describe what changed and how you tested it. See the contribution guide or ask for help on Discord. Drafts are welcome.

Merged human contributions receive a Discord thank-you. To opt out, check the PR template's Discord opt-out box or add <!-- cyberwave:no-celebration --> to the PR description.

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Slack team notifications

  • opened: sent

@github-actions

Copy link
Copy Markdown

Automated advisory review · Claude

Commit: 0ac5335ae2b80bc7051c132e0abcbfbea2788d29. Human review and CI are still required.

The patch modifies only the docstring for the `affect` method in `cyberwave/client.py`. It updates the description of which locomotion/flight commands run in simulation versus raise `NotSimulatedError`. No executable code is changed in the supplied patch excerpt. One concrete concern is identifiable from the docstring change alone: the new text contradicts what the previous note said, and the direction of the change could mislead callers into attempting commands in simulation that will raise `NotSimulatedError` at runtime. However, without access to the actual runtime guard logic or the rest of `client.py`, it is not possible to confirm whether the new docstring accurately reflects behavior or introduces a documentation-driven regression. No behavioral bugs are directly introduced by this patch as supplied.

  • Medium · cyberwave/client.py: The updated docstring states that locomotion and flight methods 'run in every simulation runtime, "playground" included,' but the previous note explicitly marked those same command namespaces (twin.locomote.*, twin.flying.*, twin.commands.*) as live/driver-only and said they raise NotSimulatedError in any simulation runtime. If the runtime guard logic has not changed to match this new description, callers who read the updated docs and attempt twin.move_forward() or twin.takeoff() inside a playground simulation will receive an unexpected NotSimulatedError. Conversely, if the guard logic was changed elsewhere but that change is not in this patch set, reviewers cannot verify consistency. The fix is to ensure the docstring is updated only in the same commit that updates the corresponding runtime guard, and to add a focused regression test that invokes a locomotion method inside a playground-environment mock and asserts it does not raise NotSimulatedError, confirming the two are in sync.

Coverage: 1 of 1 changed files; patch excerpts only. Generated REST code, lockfiles, notebooks, SVGs, missing patches and files beyond the 40-file / 60,000-character budget are excluded. GitHub may truncate individual patches.

This branch has not been deployed

No deployments
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