Repository navigation
fix: update ImagePlane to the bdsim 1.5 graphics block interface - #251
Merged
Merged
Conversation
IMAGEPLANE(watch=True) failed with AttributeError ('StartPlug' object has no
attribute 'start'), because ImagePlane added its input signals to the
watchlist itself and bdsim 1.5 now does that in GraphicsBlock.start. It also
made a second figure, leaving the one the base class makes empty, and
opened a figure when graphics were turned off. watch goes to the base class,
start() uses the figure and axes it makes, data is collected in record(),
which runs for every accepted sample, and step() only redraws.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
| 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.
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.
Updates the
IMAGEPLANEblock to the graphics block interface of bdsim 1.5, which changed a lot since the block was written. Found while annotatingblocks/camera.py(Issue 60).Faults:
IMAGEPLANE(watch=True)crashed at the start of a run withAttributeError: 'StartPlug' object has no attribute 'start'. The block added its input signals to the watchlist itself, and bdsim 1.5 does that inGraphicsBlock.start.graphics=Falseit still opened a figure and used axes that did not exist.Changes, following what bdsim's own
Scopedoes:watchis passed to the base class constructor.start()uses the figure and axes from the base class, and returns early when graphics are off (_enabled).record(), which bdsim calls for every accepted sample.step()only redraws, and bdsim may call it less often.Tests (real bdsim runs on the Agg backend): one figure is opened,
watch=Truerecords the input signal, no watch records nothing, andgraphics=Falsedraws nothing, opens no figure and still records a watched signal. The existing simulation tests are unchanged and pass. mypy reports no issues and the full suite passes (2143 passed, 33 skipped).AI-assisted: written with Claude Code (Claude Sonnet 5.5) and reviewed by the maintainer.
🤖 Generated with Claude Code